#stavros-malakoudis_api

1 messages ยท Page 1 of 1 (latest)

stray elmBOT
#

๐Ÿ‘‹ 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.

wraith badger
#

๐Ÿ‘‹ 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

blazing rock
#

So apple pay needs strictly off_session

wraith badger
#

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

blazing rock
#

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?

wraith badger
#

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?

blazing rock
#

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

wraith badger
#

OK. Why do you want to do that?

blazing rock
#

Give me a moment to find the relevant documentation

wraith badger
#

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

stray elmBOT
blazing rock
#

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

formal trail
#

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)

blazing rock
#

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

formal trail
#

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

blazing rock
#

setup_future_usage can only be set for a PaymentIntent, right? How can I set it to a PaymentMethod?

formal trail
#

You set it for the PaymentIntent

#

so that the generated PaymentMethod will have it then

blazing rock
#

I will read these through and I will get back, thank you

formal trail
#

Sure, take your time, happy to help!