#hendie-rawpan-block

1 messages · Page 1 of 1 (latest)

dusk craterBOT
frigid wigeon
#

Gotcha

#

But that might not be sufficient especially if this is for an automated test suite

#

You likely wouldn't want this to remain enabled I'm assuming

dense crown
#

well, we have continuous integration so our specs run all the time

frigid wigeon
#

Gotcha

#

Thinking of options

#

I suppose you could create a separate stripe account for testing and enable this functionality

#

That way passing card details isn't enabled for your live account

dense crown
#

honestly, I feel this is something that should be possible in test mode without having to introduce a different Stripe account with the accompanying configuration changes that detects for test mode, etc, etc

#

I am quite happy that you be strict in production mode, but we need the above functionality (and have had it for years) for tests

frigid wigeon
#

Yeah I can take a feature request to enable this for only test mode. Your usecase is for sure valid. I think they rolled out this change just because in general they try to make test mode match live as much as possible

dense crown
#

this is seriously affecting our deploy process, all our test cases are now blocked

frigid wigeon
#

Let me actually ask a colleague if there's another way around this for test mode atm

#

Understood. Let me get back to you

dense crown
#

thank you

#

that would be great, since a feature request is not going to solve this for our deploy tomorrow. Our requirements for deploy is a green spec run, so this is a serious blocker for us.

#

what about a lower API version test key. I have seen other discussions here where folks have mentioned that older API keys do not exhibit this behaviour

#

We are experiencing this on a brand new Stripe account we need to start using, so the API keys are on API ver 2022-11-15

#

and we'll only need at test API key on an older version, the production keys can be the latest, at least until there is some way of getting a more specific test token than the ones you make available today.

astral basin
#

@dense crown I'm taking over as I have more context

#

If you use stripe-mock and never hit our API you wouldn't hit this issue at all. If you do hit our real API (in Live or Test mode) on a brand new Stripe account then you will hit that issue

#

I'm fairly certain that you're hitting this issue because you are not mocking that API request and hit our real API

dense crown
#

that I have seen, yes

astral basin
#

hendie-rawpan-block

#

We're working on blocking raw PANs access by default on most accounts. We're doing this carefully and have started with brand new accounts which can't do this anymore at all without official approval (before you just had to flip a Dashboard setting)

dense crown
#

I appreciate that

#

alternatively, is there a way to get a test token with a specified expiry date?

astral basin
#

What are you really trying to test? The expiration date shouldn't really matter in most cases

dense crown
#

our app is directing requests to two different platform accounts, and we need to test that too - so a full StripeMock will not work - for those tests we need to hit the real Stripe test servers

#

We have a process that sends out an email to a user when their card is within two months of expiry

astral basin
#

My advice is to never hit our real API for any tests 🙂

#

Especially for cases like this with emails, I would just mock the response entirely and simulate that

dense crown
#

so do you a mock libraries for Ruby that handle bank accounts, ach, terminals, etc?

astral basin
#

stripe-mock does that. You get a Token back and then you change the values you care about and mock that. Or just bypass this entirely since the cron job you're running is likely pulling from internal data in your own database and unrelated to our API

#

Ultimately, while we can give PAN access in Test mode, it's usually limited to accounts that need PAN access in Live mode instead

dense crown
#

yeah, that's not us