#uh oh
1 messages · Page 1 of 1 (latest)
There are a few cards you can use to test billing detail failures here: https://stripe.com/docs/testing#fraud-prevention
For example, you can use this test card 4000000000000036 to simulate a postal code check failure
But the <details> Has to be in this form right?
const paymentIntentDetails = {
amount: amount,
currency: 'cad',
payment_method_types: ['card'],
customer,
payment_method,
confirm: true,
off_session: true,
};
So my use case is:
- A setup intent was successful
- I want to charge the customer off session with a payment intent, but I want to test failures such as (insufficient funds, etc)
Is there a way for me to test a card by providing it in the <details>?
<details>,
);```
If I use a insufficient fund card for the setup intent, it will fail, so I can't use that pm for the payment_intent_details
Yes, you just pass a token instead of a raw card number: https://stripe.com/docs/testing?testing-method=tokens#fraud-prevention
For example tok_avsLine1Fail will fail on the address check.
Sorry, I'm a bit confused. Do you mean like this?
amount: amount,
currency: 'cad',
payment_method_types: ['card'],
customer,
payment_method: "tok_radarBlock",
confirm: true,
off_session: true,
};```
Yup
thank you!
Hmm, it returns the following error: StripeInvalidRequestError: No such PaymentMethod: 'tok_radarBlock'
Can you send the exact code over that you're running?
const paymentIntent = await stripe.paymentIntents.create({
amount: 300,
currency: 'cad',
payment_method_types: ['card'],
customer,
payment_method: 'tok_radarBlock',
confirm: true,
off_session: true,
},
);
Are you in test mode?
Also, what is customer? Should that be something like customer: "cus_abc123"?
yep!
customer has an existing customer
and yes I am in test mode
But I get No such PaymentMethod: 'tok_radarBlock'"
Ah! Apologies, I meant to send you to the PaymentMethods view (not the Tokens view)