#jamie_97274
1 messages · Page 1 of 1 (latest)
Hello, to clarify your current flow, are you calling createPaymentMethod and then passing that PaymentMethod ID back to your server to confirm an intent? Or are you simply creating the payment method and attaching it to a Customer?
So right now I am just gathering information to understand the correct flow, and have no flow now.
All subscription payments are working for all payment methods in some form of a custom setup. I am now building a way for users to change their payment method.
What I would like to do is use the same stripe elements I have on the payment form almost, but instead of confirming a paymentIntent (or a setupIntent for iDeal) I would like to create a payment method and attach it to a customer
When saving a new PaymentMethod without a payment to be made immediately, you will want to create and confirm a SetupIntent for the customer
Taking a quick step back, in general your flow will look like one of these docs when you are creating your subscription:
So you will either create the subscription first and then confirm its first PaymentIntent with a PM from your page, or you create a PM from your page and then create the subscription with it
Saving a new PaymentMethod has the same basic choice
You can either create your SetupIntent and then confirm it with a PM from the ECE
https://stripe.com/docs/elements/express-checkout-element/accept-a-payment
Or you can use the ECE to create a PM and then create and confirm a SetupIntent with it https://stripe.com/docs/elements/express-checkout-element/accept-a-payment#create-pm
Is that clear/helpful?
So to be clear in this case a subscription already exists, I just want to create a new payment method and attach it to the customer, in my own backend code I will change the subscription default payment method
so for the ECE I am not confirming a payment in this case either
Good point, that does not happen automatically. You will need to set it as the default with another API call
https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Correct, you can follow our "Accept a Payment" Express Checkout Element guide but use a SetupIntent instead of a PaymentIntent
OK so to be clear (as I already in my early dev had to completely rebuild the setup when doing the actual subscription creation with all the different payment methods)
I have to createSetupIntent? As opposed to createPaymentMethod like this?
https://stripe.com/docs/js/payment_methods/create_payment_method
I am wondering if the setupIntent works at all, because the next time an automatic payment is made through recurring payment/subscription, on certain situations it will get stuck on requires_action as it will want a 3ds authentication
I had that issue with setupIntent in the past already
A SetupIntent will be created at some point no matter what you want to do here, the createPaymentMethod method is valid to use for certain flows. I'd reccommend reading through the first two docs I sent to see how this works when applied to PaymentIntents, which work very similarly
This can always happen. The bank can request 3DS on any payment, even if your customer has already completed it successfully. The bank is much less likely to request 3DS again if your customer has already completed it, but there is still a chance that they will ask for it, so definitely make sure your integration can handle 3DS being requested like this
https://stripe.com/docs/billing/subscriptions/overview#requires-action
I see so your advice is
in our "change payment method" form, to create setupIntents in all cases, and get the payment method from the setupIntent, and attach it to the subscription
S'all good, one more question so let's say a future payment or the first payment after changing their payment method has a requires_action status to authenticate, I should notify the user to do so (i.e. via email, as this are off-session recurring payments) - how long does this requires action link stay active?
That is determined by what you have set in the "Manage payments that require confirmation" section on this page https://dashboard.stripe.com/settings/billing/automatic#:~:text=Manage payments that require confirmation
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Also note that the "Send a Stripe-hosted link for customers to confirm their payments when required" setting will tell Stripe to automatically send an email out for you for payments that require 3DS
Ah so stripe can handle this? as in stripe could automatically send the customer an email to authenticate the payment
OK that's good to know thank you
Yep yep
okay thank you for now!
Sorry one more question @burnt breach
On the create SetupIntent API
https://stripe.com/docs/api/setup_intents/create
payment_method_types does not seem to have an option for wallets like Google Wallet & Apple Pay?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Those are included under card at the intent level
OK thanks