#hugues9308_code
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/1238484559750758411
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hey there, can you share your code for this?
Here's the js that I'm using.
And here's the html page. For now, it's a single page application.
Are you there?
Hey there, lots of folks online just jugling threads, sorry
Ok, after reviewing the docs, the Acss collection flow is expected to happen in a modal which your customer will interact with, then you get a result indicating success or error.
It doesn't look like there any expected redirect to another page here, so there is no return_url option
If you want to redirect after success, you can do so after inspecting the setupIntent in the result from confirmAcssDebitSetup
You code looks like it is mixing together async/await and promise chaining (.then()) which might be complicating things
eg, this is likely not going to work:
const {setupIntent, error} = await stripe.confirmAcssDebitSetup(
clientSecret,
{...}
).then(function(result) {...}
The result is already captured by the await and destructured as {setupIntent, error}
instead you likely want something more like:
const {setupIntent, error} = await stripe.confirmAcssDebitSetup(
clientSecret,
{...}
)
if (error) { ... }
else {
if (setupIntent.status === "succeeded") { ... }
}
Sorry for the newby complexities: js isn't my cup of tea, I'll try your simplification. So, for the completion page, are you suggesting that the client should redirect to that completion page on successfull completion?
I'm saying I don't expect any "natural" redirect. You would decide about any potential redirect by inspecting setupIntent after confirmAcssDebitSetup resolves