#akdev-testing
1 messages · Page 1 of 1 (latest)
yep there are cards at https://stripe.com/docs/testing#cards-responses to test various declines
Yep, but I pass payment_method parameter when I'm creating PaymentIntent and I can't create payment_method with that card number before because of insufficient funds response. Can I add that card to the user payment methods somehow?
not sure I follow exactly.
and I can't create payment_method with that card number before because of insufficient funds response
you can definitely create a PaymentMethod with those numbers, that wouldn't fail that way. confirming the PaymentIntent will fail yes, but that's the idea, it's what you're testing.
are you asking how to test "insufficient funds" when capturing a previously authorised payment?
because you don't have to, that literally can not happen, so it's not something you have to test. If the PaymentIntent was authorised, you are guaranteed to be able to capture it within 7 days, it won't fail
I cant authorize payment
with this card
because I can't add that card as payment method
and then pass created payment method to the authorization request
How can I do this?
because I can't add that card as payment method
add to what? a Customer object?
Yep
Thanks. I've checked. I've got CardException with declineCode: generic_decline. Will be the same behavior when user card hasn't enough money to authorize payment?
no it would be an insuffecient_funds decline
you just can't test that exact scenario
but it's all the same, it's a decline, you'd handle it in the same overall way. But we don't have test cards to specifically test 'attach to customer, and then get a specific type of decline', just a generic one
Ok, it's good, thanks
Also question: Should I check that the status of authorization request is 'requires_capture' to be sure that authorization is success? Or it enough just to check if it doesn't gives an exception?
I would say you should check the status yep!