#raghul-s_docs

1 messages ยท Page 1 of 1 (latest)

red horizonBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

mystic rapids
mild lantern
#

You mean, I should use this param in create payment intent API? In that case, don't I need to specify setupFutureUsage in the Payment element?

mystic rapids
mild lantern
mystic rapids
#

No, the API reference that I shared earlier is about PaymentIntent, not Checkout

mild lantern
#

oh okay, Will that work in our case?
I mean, using the payment_method_options.card.setup_future_usage param in create payment intent API doesn't require us to specify setupFutureUsage in the Payment element. And whatever we set in the Payment intent API (whether off_session or on_session), will be used for the payment method saved with the Payment intent. Is this correct?

mystic rapids
#

It depends, if you are using deferred intent creation flow, then you also need to set the same in Payment element. Otherwise you don't.

mild lantern
#

We use deferred intent flow

#

Then we need to specify setupFutureUsage on element eventhough if we use payment_method_options.card.setup_future_usage in PaymentIntent creation, right?

mystic rapids
#

Yes you need to set them both in elements and paymentIntent

#

The elements options and paymentIntent options must match

red horizonBOT
mild lantern
#

oh okay. I'll try this

mild lantern
#

I tried without specifying setupFutureUsage in Payment element options. And specifying the payment_method_options.card.setup_future_usage in PaymentIntent creation. The flow worked without any errors.
Here are the links,
Create a PI with payment_method_options
https://dashboard.stripe.com/test/payments/pi_3QDIWlByVlfITvRX0rVNKG2w - pm_1QDIWmByVlfITvRX7RGmJlYx
Reusable to subscription https://dashboard.stripe.com/test/subscriptions/sub_1QDIk6ByVlfITvRX5w7SrgJa
Recurring PI of a invoice used pm_1QDIWmByVlfITvRX7RGmJlYx https://dashboard.stripe.com/test/payments/pi_3QDIl0ByVlfITvRX1cm9qupa

You said we need to set setup_future_usage both in elements and paymentIntent. I haven't set it in the elements. Can you check the above links and let me know if it's all fine? And any other issue I can expect as I haven't set it in the elements?

#

Please go through the attached resources and let me know

rotund sentinel
#

๐Ÿ‘‹ Taking over this thread, catching up now

#

BNPL payment method don't support setup for future usage, so it's expected that they are not shown in Payment Element: https://docs.stripe.com/payments/payment-methods/payment-method-support#buy-now-pay-later-api-support

By reviewing the past conversations, it's not necessary to set the setup_future_usage at payment_method_options level since BNPL doesn't support off_session in the first place.

The recommended integration will be:

By doing so, the Payment Element will show all the payment methods that support off_session (which BNPL don't)

Learn how your integration choices affect payment method support.

mild lantern
#

But we need to display BNPL options in the Payment element. When we set setup_future_usage: "off_session", BNPL goes off. When we don't set, we cannot save the payment method for future use. Thats the problem

rotund sentinel
#

If you don't specify setup_future_usage for the payment method under payment_method_options in the element options in the deferred intent flow, BNPL will show in the supported country and currency. However, your EUR isn't supported in CA account, it's expected that BNPL such as Klarna won't show.

The reason why BNPL not shown is not due to whether setup_future_usage is set, but the currency (EUR) and country (CA) filters out the BNPL since this combination doesn't supported BNPL payment method. For example, CA account only supports Klarna in CAD, but not EUR

mild lantern
#

Thats right. We are aware of that. In CA VPN with CAD currency, when I set setup_future_usage: "off-session", BNPL option goes off. If setup_future_usage is not set to off_session, BNPL options displays. I can confirm you this again. Checking this

rotund sentinel
#

Yup! This is expected.

#

Could you share the use case what you would like to use the deferred intent flow for?

#

Elements options for deferred intent is designed to have the same setup_future_usage for all payment methods, and can't be configured at the payment method level

mild lantern
# rotund sentinel `payment_method_options` support at deferred intent flow is limited. Unfortunate...

Yeah, but without specifying the setup_future_usage in payment element options, and specifying in Payment intent creation at level worked

Below are the same sample links I attached in previous messages:
Create a PI with payment_method_options
https://dashboard.stripe.com/test/payments/pi_3QDIWlByVlfITvRX0rVNKG2w - pm_1QDIWmByVlfITvRX7RGmJlYx
Reusable to subscription https://dashboard.stripe.com/test/subscriptions/sub_1QDIk6ByVlfITvRX5w7SrgJa
Recurring PI of a invoice used pm_1QDIWmByVlfITvRX7RGmJlYx https://dashboard.stripe.com/test/payments/pi_3QDIl0ByVlfITvRX1cm9qupa

Can you check this

rotund sentinel
#

without specifying the setup_future_usage in payment element options
BNPL will show if the currency and country is supported.

Your example works because this is the card payment. When your elements set as CA with CAD, Klarna will show. If the customer selects Klarna and make a subscription, the subscription creation will fail

#

Card as a payment method is supported in all the integration types, so that's why your example payment intents and subscriptions will work

mild lantern
#

Thats what I need. I understood that Klarna is only for on session & one time and cannot be saved. Im not looking to save any BNPL methods or any other methods which cannot be saved for future use. I need other payment options which can be saved for future use to have setup_future_usage: off_session

The setup_future_usage in payment element and in Payment intent API should be same, else confirmPayment API throws error.
While initialising the payment element, I need all payment options to be displayed. So, setup_future_usage in payment element hides BNPL options. When they checkout with any payment method except BNPL, they have to be saved for future use.

rotund sentinel
#

In this case, you'd need to maintain the logic whether a payment method is supported for off_session or subscription, then create the Payment Intent accordingly. If any new payment method is enabled, you should ensure this logic is maintained