#david2_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/1305555948697292811
๐ 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.
- david2_achdebit-mandate, 3 days ago, 16 messages
call to confirmUsBankAccountSetup looks like
await stripe.value.confirmUsBankAccountSetup(
setupIntent.client_secret,
{
mandate_data: {
customer_acceptance: {
type: "online",
accepted_at: new Date(),
online: {
ip_address: "127.0.0.1",
user_agent: "test playwright chrome/firefox/safari",
}
}
}
}
)
Hi ๐ if you're using an already set up payment method, then you shouldn't use setup_future_usage in your Payment Intent creation request.
If you do you try to trigger the setup flow again, which attempts to generate a new mandate rather than use an existing one.
My current flow is:
create setup intent on server
collectBankAccountForSetup(setupIntent.clientSecret) // stripe modal offering various bank accounts
~show user the mandate via a modal we present~
confirmUsBankAccountSetup(setupIntent.client_secret, ...mandateInfo...)
Is this not correct?
That seems fine. The error you shared though gives me the impression you're also using setup_future_usage on the Payment Intent, which is incorrect.
When confirming a PaymentIntent with a
us_bank_accountPaymentMethod andsetup_future_usage,mandate_datais required.
oh, I see
yes we probably are doing that.
My secondary concern is that the mandate does not reflect what I've provided, and will be generated even if I do not provide mandate_data. Is that expected?
Do you have an example of a mandate where you saw that behavior that I could take a closer look at?
I just created mandate_1QJznSAQbHn4ElzTyaT7AWMU, presumably via confirmUsBankAccountSetup, and provided "test playwright chrome/firefox/safari" as a user_agent, but stripe seems to have used some other value (almost certainly browser generated request header)
customer_acceptance: {
accepted_at: 1731339898,
online: {
ip_address: '107.222.193.223',
user_agent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36'
},
type: 'online'
},
vs what I sent:
const result = await stripe.value.confirmUsBankAccountSetup(
setupIntent.client_secret,
{
mandate_data: {
customer_acceptance: {
type: "online",
accepted_at: new Date(),
online: {
ip_address: "127.0.0.1",
user_agent: "test playwright chrome/firefox/safari",
}
}
}
}
)
Yes, we collect mandate information from the browser automatically, since that is how the customer is providing their authorization. confirmUsBankAccountSetup doesn't show that it accepts mandate_data. Do you see any sort of warning in your browser console when you try to provide it?
If you want to manually be providing bank information and mandate details, you should be confirming these server-side rather than client-side.
Ok, I think I see. I guess I followed the typescript types trying to figure out how to deal with the mandates, and they seem to indicate it's configurable, leading to my confusion:
export interface ConfirmUsBankAccountSetupData
extends SetupIntentConfirmParams {...}
export interface SetupIntentConfirmParams {
/**
* This hash contains details about the Mandate to create
*/
mandate_data?: {[k: string]: any};
/**
* The URL to redirect your customer back to after they authenticate on the payment method's app or site.
* If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
* This parameter is only used for cards and other redirect-based payment methods.
*/
return_url?: string;
}
Thank you for your clarification!