#eran_acss-setupintent
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/1230632568672616459
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there!
Also, alternatively we tried using stripe.confirmSetup, but we don't know how to change the payment intent for that when the user selects the Pre-authorized debit option.
Hi there!
That method does appear to send the collect name and email, but we would need to change the payment intent to an acss_debit intent for it to work.
Give me a few minutes to test this out. I think you should just be able to use confirmPayment instead
This is for setting up a payment method, not for making a payment
Got it. Can you clarify what you mean by this in that case?
we don't know how to change the payment intent for that when the user selects the Pre-authorized debit option.
The default payment method in the Payment Element is "card" for collecting credit-card details. As such, when we set up the elements object, we pass a "card" setup intent. When the user changes the selected payment method to "Pre-authorized debit", the setup intent is still set to the "Card" intent. If we could change the intent the Payment Element is set up with when the user changes the payment method in the UI, this should work with the stripe.confirmSetup method
We don't see any documentation on how to change the setup intent for the element after its been created
Do you have an example SetupIntent ID I can review?
Are you currently hard coding payment_method_types: ['card'] when creating a SetupIntent?
No, we're passing all the available payment methods. As such, the user is able to switch between them. Here's a quick video to illustrate - https://www.awesomescreenshot.com/video/26866799?key=58fb53d94283705f493932f59fe2f7b0
But the setup intent the element is created with is a card intent
var options = {clientSecret:intentSecret};
var elements = stripe.elements(options);
Like so
Hm, I'm not really following. If you're using dynamic payment methods, I don't understand what you mean by "the setup intent the element is created with is a card intent"
A SetupIntent ID would help me see what's happening/how this is being created
Sure, let me pull up the ID
seti_1P72IzKlOm1BTbHsy44mJ5Qk
When instancing the payment element in JS, you need to pass a setup intent. That setup intent is set up for card payments
Okay, so I see you're creating a SetupIntent and explicitly passing acss_debit only: https://dashboard.stripe.com/test/logs/req_PVVSWMowyGyNJe
Sorry, I sent you the wrong intent. Give me a second
seti_1P72IyKlOm1BTbHsZTfqRDN2
This is the card setup intent. Is it possible to pass more than one method to the setup intent?
Okay, this SetupIntent was also created by explicitly passing acss_debit and card as possible payment method types: https://dashboard.stripe.com/test/logs/req_IUptN0Pipv98ne
This means the PaymentElement renders to give the customer the option to choose either card or ACSS.
I see, though the confirmSetup method complains that it's missing the mandate. If we use stripe.confirmAcssDebitSetup() with the acss intent I sent you earlier, it does work fine
{
"error": {
"message": "A mandate is required. Please either provide the id of an existing mandate on confirmation, or providepayment_method_options[acss_debit][mandate_options].",
"request_log_url": "https://dashboard.stripe.com/acct_1JjKSOKlOm1BTbHs/test/logs/req_MGDoOsJLdn2Zce?t=1713477527",
"type": "invalid_request_error"
}
}
Ah, I see these parameters are missing: https://docs.stripe.com/payments/acss-debit/set-up-payment?payment-ui=direct-api#web-create-setup-intent
Sorry, I should have caught this earlier
So, when you create the SetupIntent server side, including these parameters will automatically create the required mandate
Sure thing!
Appears to work well! Thank you very much for the help ๐
Glad to help! ACSS isn't the most straightforward payment method type ๐
For sure!