#akdev-testing

1 messages · Page 1 of 1 (latest)

bold imp
earnest frigate
#

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?

bold imp
#

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

earnest frigate
#

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?

bold imp
#

because I can't add that card as payment method
add to what? a Customer object?

earnest frigate
#

Yep

bold imp
#

ok you didn't mention that though

#

anyway then you want the card 4000000000000341

earnest frigate
#

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?

bold imp
#

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

earnest frigate
#

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?

bold imp
#

I would say you should check the status yep!

earnest frigate
#

Ok, thanks

#

Can you give me some card that return other status than 'requires_capture' ?

bold imp
#

any of those decline cards

#

like the 4000000000000002 one for instance