#yony
1 messages · Page 1 of 1 (latest)
hello! what's your follow up question?
You suggested checking for example on the flutter_stripe package, but the flutter_stripe package does not support flutter web. It is throw the following platform error when trying to use for a web app.
Error: WebUnsupportedError: initPaymentSheet is not supported for Web https://stackoverflow.com/questions/72804750/flutter-web-stripe-error-webunsupportederror-initpaymentsheet-is-not-supported
initPaymentSheet is a mobile method. the flutter_stripe package is only for mobile iirc.
Ok, what are the alternative methods we can use for flutter web?
what we need is to create a connected account for a business owner and send money to the platform account. And also allow them to withdraw back the money they have deposited.
alright, that has nothing to do with Flutter - you'd implement all of that logic in your server using one of our official SDKs
i'd suggest that you start off with this page : https://stripe.com/docs/connect to see which flow fits your use case, and how to implement it
Ok thanks, I have tried to create a connected account and open the return account link url to create account. but couldn't to return back to the app and get the created account id
const account = await stripe.accounts.create({type: 'express'});
const accountLink = await stripe.accountLinks.create({....})
await launchUrl( accountLink, webOnlyWindowName: '_self', );
When the opened page is closed, i need to get back the account id and if the account creation is succeed or failed. but i could find a way of to wait for the account create and get the account id back?
I tried to redirect to the accountLink url from a backend but it throw an " XMLHttpRequest error."
request.redirect(accountLinks.url);
So my main question is how to redicting to the accountLink url and get back the account id after the account creation is completed?
can you provide the full error message?
Ok sure
Actually, it does not throw an error.
but calling request.redirect(accountLink) on nodejs backend returns an HTML for the stripe page URL to the frontend when it is supposed to redirect to the stripe page.
Hi @solid egret I'm taking over this thread
Hi @trail stag
I don't see any error in the screenshot that you posted earlier, can you elaborate more?
Ok,
After getting an accountLink with method stripe.accountLinks.create({...}) , I tried to redirect to the accountLink url by calling request.redirect(accountLink); from the backend. and this method is supposed to redirect to the stripe create account form page, but it just returns back the HTML doc to the frontend as the response body.
Is your server returning a 30x redirect code? https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections
No, the server just returns statusCode 200 and HTML as a body.
Then you should return 30x
I tried to redirect with following but this also gives a statusCode 200 and isRedirect: false.
response.writeHead(301, {Location: accountLinks.url, });
Are you using node.js + express as you backend?
Yes