#gsmcdonald - add bad card
1 messages · Page 1 of 1 (latest)
Hello, are you trying to add a test card to get a specific error? Or are you asking something else?
Not really. We're fixing a bug in our system where if a customer has an invalid card on their account (like if the card expired), they're unable to pay by invoice (like by check), because we were making calls to update the billing information on the card. We've fixed the bug, but we'd like to test it (without waiting for September to roll around). We were hoping there would be a way to add a card through Stripe. We're open to adding it in any way though.
Gotcha, I think we have a a test card that can help you there https://stripe.com/docs/testing#declined-payments
If you use our "Decline after attaching" (4000000000000341) card, you can attach it to a customer successfully, but any payment to the card will fail
You can also directly use the ID pm_card_chargeCustomerFail instead of having to tokenize the raw card number
Yeah, in this case we aren't actually charging the card. We need it to fail when being updated.
I'm not sure if I fully understand your scenario. So the customer has a card that expired, you try to update the info, and you want that update to fail?
Yep, exactly!
The update does currently fail, but we don't have a customer in our sub-production environments with an expired card.
Do you have the error message that you saw in live when you tried to do this update?
If possible, can you find the request ID (req_123) from the time you saw this error in your account logs? https://dashboard.stripe.com/logs
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sure. In this case (req_R0LDJCrwRFA87D), it was a payment required.
This is from an customer we did have in our sub-production environment, but we don't anymore. This is just an example (it's not always due to the expiration date)
Do you have other examples? Unfortunately that error is getting masked by the expiration date error, you can always get that by specifying an expiration month that is in the past
That would work. How we can create a new payment method with an expiration date in the past? Keep in mind that the call that generated that request will not be made anymore (as part of the bug fix)
Unfortunately I don't think you can, I think you may be able to test this with test clocks though https://stripe.com/docs/billing/testing/test-clocks
Actually wait, is this related to subscription functionality or are you only working with one time payments here?
We do use subscriptions, but they aren't necessarily related here. This is just the update payment method endpoint (https://stripe.com/docs/api/payment_methods/update)
Gotcha, I think you still may be able to simulate this with the test clocks that I linked to. Like you can add the card with an expiry of next month, advance time two months, and see if the error that you are seeing in live happens https://stripe.com/docs/billing/testing/test-clocks