#alasdair_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/1384882615437496392
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
Do you create your Payment Intents before or after you initialize Elements client-side?
The Payment Intent that you shared, is that one where you intended to set up a payment method from it?
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
Ah. Gotcha
So, if I make this change, the. The options that don’t support future usage would be filtered out?
Yup, they should be, but let me know if that isn't what you see and I can take another look through things.
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?
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
It's a bit more of a refactor, but you could also consider switching to our flow where you don't create the Payment Intent until after the customer has provided their payment method details:
https://docs.stripe.com/payments/accept-a-payment-deferred
Ok. Sorry, we are doing server side confirmation
The confirmation request for the intent you shared previously was made from your client-side code:
https://dashboard.stripe.com/test/logs/req_sX0pXBa30Pi1VS
(which is a very normal way of handling things, just to be clear)