#Flux0uz

1 messages · Page 1 of 1 (latest)

shy canopyBOT
lofty bramble
crisp crypt
#

Hey @lofty bramble , This is what I followed

#

Thanks, I saw that,I don't want to load the payment "off_session" but I want the customer to see the registered card, click and proceed with the payment

#

I'm using the react lib with paymentElement

#

I'm waiting for the paymentElement to display the registered card or it doesn't work that way?

lofty bramble
#

No with PaymentElement you can't display saved cards. You can have this behavior using PaymentSheet on mobile platfoms

crisp crypt
#

It's a web app

#

But this example uses "off_session: true", "confirm: true" but I want to use : "on_session"

#

This is what I don't understand

#

Oh sorry, I misread the last answer

#

So if I understand correctly, I have to get the paymentMethod, send it to the frontend to display the registered card, and when my customer clicks on it, create the paymentIntent with this data: intent = Stripe::PaymentIntent.create({ amount: 1099, currency: 'eur', customer: '{{CUSTOMER_ID}}', payment_method: '{{PAYMENT_METHOD_ID}}', off_session: true, confirm: true, })

lofty bramble
#

Yeap!

crisp crypt
#

But then I really don't understand why there is a "setup_future_usage: on_session" option

#

And once again, in the doc it is written:

Set off_session to true to indicate that the customer is not in your checkout flow during this payment attempt—this causes the PaymentIntent to throw an error if authentication is required.

My client is in the checkout flow! I really don't understand this part of the doc

lofty bramble
#

Actually, when using a saved card, you can do the payment flow 100% in the backend without æsking the customer to enter their card

#

in other words, you show your customer a checkout session, but you don't ask him to fill their card details

crisp crypt
#

Yes I understand that, but that's not what I want to do!

#

I want him to be able to click a confirmation, only he doesn't have to enter his card info again

#

So for me, this is where to use: "setup_future_usage"="on_session", but then to create the paymentIntent you have to put "off_session"="true"

#

It's really confusing

lofty bramble
#

I understand you, but for Stripe point of view its an off_session as the user is not entering their card details and the card is already saved.

I want him to be able to click a confirmation, only he doesn't have to enter his card info again
This you can do it in your integration/frontend, and in your backend just fetch the saved PaymentMethod and create a n off_session PaymentIntent and confirm it directly with confirm:true (like you mentioned above)
Hope now it's more clear for you