#alasdair_api

1 messages · Page 1 of 1 (latest)

frank kindleBOT
#

👋 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/1384882615437496392

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

undone mesa
#

Hi 👋 you are correct that Klarna and Afterpay do not support being setup for future usage:
https://docs.stripe.com/connect/manage-payout-schedule

Can you elaborate more on how you built this integration? I'll try to piece it together from the intent ID that you shared, but it will take me time to do so and likely be faster if you can tell me about your integration.

oblique bobcat
#

Hi Toby.

#

We use your api and stripe payment element on the frontend

undone mesa
#

Do you create your Payment Intents before or after you initialize Elements client-side?

oblique bobcat
#

Before

#

And we create the PI with ‘automatic_payment_methods’ enabled.

undone mesa
#

The Payment Intent that you shared, is that one where you intended to set up a payment method from it?

oblique bobcat
#

Yes

#

I specifically wanted to see if PayPal supported this.

undone mesa
#

Ah, so the reason payment method types that don't support setup_future_usage aren't being filtered out, is because you're using payment_method_options.card.setup_future_usage to configure setup_future_usage.
https://dashboard.stripe.com/test/logs/req_obI8LurVxLQt1S

Doing so via the payment_method_options hash, causes your settings to only be applied to specific payment method types, rather than being applied universally for all payment method types supported by the intent.

You'd want to use the top-level setup_future_usage parameter instead:
https://docs.stripe.com/api/payment_intents/create#create_payment_intent-setup_future_usage

oblique bobcat
#

Ah. Gotcha

#

So, if I make this change, the. The options that don’t support future usage would be filtered out?

undone mesa
#

Yup, they should be, but let me know if that isn't what you see and I can take another look through things.

oblique bobcat
#

Ok. Great. Thanks. One other question if I may. We create the PI when the customer goes from submitting their address details to the payment page. We had intended to have a checkbox on the payment page to ask the user if they wanted to save details for future use. But by this point the PI has been made. Is it possible to update the PI when payment is submitted?

undone mesa
#

You could if you were doing server-side confirmation, but you can't with client-side confirmation like you're currently using.

You could make a request from your backend to update the intent though, and if you already have initialized Elements you can use fetchUpdates() to pull the updated information from the payment intent client-side:
https://docs.stripe.com/js/elements_object/fetch_updates

oblique bobcat
#

Ok. Sorry, we are doing server side confirmation

undone mesa
#

(which is a very normal way of handling things, just to be clear)

oblique bobcat
#

Ok. Think I confused myself!

#

The PI is created by the server.

#

Thank you very much for your help.