#jenOng

1 messages · Page 1 of 1 (latest)

fervent sorrelBOT
south osprey
#

Hi there!

#

Can you share the PaymentIntent ID (pi_xxx)?

slim crown
#

pi_3NM50sI2FNE5Irmb1XtfaAre

#

i am not setting setup_future-usage

south osprey
#

Thanks! Give me a few minutes to look into this.

slim crown
#

thank you !

south osprey
#

Can you clarify what are you trying to do?

slim crown
#

I used confirmSetup on the frontend to get the paymentMethod id and then paymentIntents.create in the backend to charge the user. I am using PaymentElement to collect credit card info for one time use and I want to charge that credit card without it being saved

south osprey
#

This doesn't really make sense. You basically have two options:

  1. If you want to save the customer's payment method, then use a SetupIntent
  2. If you don't want to save the customer's payment method, then don't use a SetupIntent and directly create a PaymentIntent
slim crown
#

oh okay, how can I collect the paymentMethod id in the frontend to pass to create paymentIntent? I have something like this but it errors out at PaymentElement:

        const cardElement = elements.getElement(PaymentElement);

        const paymentMethod = await stripe.createPaymentMethod({
            type: 'card',
            card: cardElement,
        });
south osprey
slim crown
#

thanks, I'll look into that