#uh oh

1 messages · Page 1 of 1 (latest)

fringe notchBOT
tight briar
tiny locust
#

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:

  1. A setup intent was successful
  2. 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

tight briar
tiny locust
#

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,
        };```
tight briar
#

Yup

tiny locust
#

thank you!

#

Hmm, it returns the following error: StripeInvalidRequestError: No such PaymentMethod: 'tok_radarBlock'

tight briar
#

Can you send the exact code over that you're running?

tiny locust
#
    const paymentIntent = await stripe.paymentIntents.create({
          amount: 300,
          currency: 'cad',
          payment_method_types: ['card'],
          customer,
          payment_method: 'tok_radarBlock',
          confirm: true,
          off_session: true,
        },
    );
tight briar
#

Are you in test mode?

#

Also, what is customer? Should that be something like customer: "cus_abc123"?

tiny locust
#

customer has an existing customer

#

and yes I am in test mode

#

But I get No such PaymentMethod: 'tok_radarBlock'"

tight briar
#

Ah! Apologies, I meant to send you to the PaymentMethods view (not the Tokens view)