#stavros-malakoudis_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1450422154134028298
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
๐ Hi there! Let me take a look
When creating a Payment Intent, you would need to pass setup_future_usage: off_session
That's also what the Apple Pay docs say:
Create a PaymentIntent with setup_future_usage=off_session
There's no need to set it on the payment_method_options
So apple pay needs strictly off_session
There's not really anything specific to Apple Pay here ๐
If you want to set up a payment method so that you can charge it in future, when the customer is not on your website (e.g. something like a recurring subscription payment), then you need to set up the payment method to be used off-session
So this part Apple Pay terms forbid using a saved payment method for usage=on_session payments. If the customer is in the flow, youโre required to have them authorize and generate a new cryptogram for that transaction. basically says that we cannot use "on_session" payment methods for payments where the customer is not present, like the example you mentioned, correct?
Yes, but that's the same for all payment method types: if the customer is not present, a Payment Intent should be created with off_session: true
What's the payment flow you're wanting to build?
We have already built the payment flow and we are trying to undrestand how to migrate from the "off_session" flag on the root of the payment intent to the "future_usage" flag on the nested "payment_mehtod_options -> card" field
OK. Why do you want to do that?
Give me a moment to find the relevant documentation
Right, got it.
We upgraded the FE stripe sdk version for our project, and the "setup_future_usage" field is removed from the confirmation token on the new version. So, based on this https://docs.stripe.com/payments/payment-element/migration-ct#conditional-options we think we need to migrate from the offsesion flag on the root of the payment intent to the nested one
Thanks. So what you're sending in the request you shared looks correct overall
But since you're talking about off-session payments, you'd want it to be setup_future_usage: off_session
Yeah thas correct, I'm mostly concerned about the actual flag that needs to be populated. I accidentally shared a payment intent that's on_session.
Just for me to understand though, if we populate the off_session flag, like this payment intent req_XnsUdR4fjwqD0g instead of the setup_future_usage , what will the actual difference be?
On our website, we need support for both on and off session payments and we are trying to understand how to move forward with the deprecation of the setup_future_usage flag on the confirmation token
Hey! Taking over for my colleague. Let me catch up.
Just for me to understand though, if we populate the off_session flag, like this payment intent req_XnsUdR4fjwqD0g instead of the setup_future_usage , what will the actual difference be?
setup_future_usage if for setting the used PaymentMethod for future usage
off_session: true is to flag if the customer is on session or off session (from your backend)
Is there a need to set both? To give you an example of the payment flow, the user creates a payment method, using this we create an authorization and when the order ships we capture the initial authorization or create a new payment if for any reason the total has been updated
Up until now, we only used the off_session flag and we are wondering if we are required to update the logic after deprecating the setup_future_usage from the Confirmation Token
Is there a need to set both?
It makes no sense
to set both
First you need to save the PaymentMethod for future usage with setup_future_usage then set off_session to true/false when reusing that saved PaymentMethod
depending on your use case: wether the customer is on session or not
setup_future_usage can only be set for a PaymentIntent, right? How can I set it to a PaymentMethod?
You set it for the PaymentIntent
so that the generated PaymentMethod will have it then
Try to follow this guide step by step in order to better understand the usage of these settings:
https://docs.stripe.com/payments/save-during-payment?payment-ui=elements
You create the PaymentIntent with setup_future_usage:
https://docs.stripe.com/payments/save-during-payment?payment-ui=elements#create-the-paymentintent
Then you use the generated PaymetnMethod for off session:
https://docs.stripe.com/payments/save-during-payment?payment-ui=elements#charge-saved-payment-method
I will read these through and I will get back, thank you
Sure, take your time, happy to help!