#yony

1 messages · Page 1 of 1 (latest)

cosmic ploverBOT
quaint kiln
#

hello! what's your follow up question?

solid egret
#

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

quaint kiln
#

initPaymentSheet is a mobile method. the flutter_stripe package is only for mobile iirc.

solid egret
#

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.

quaint kiln
#

alright, that has nothing to do with Flutter - you'd implement all of that logic in your server using one of our official SDKs

solid egret
#

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?

quaint kiln
solid egret
#

Ok sure

solid egret
#

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.

trail stag
#

Hi @solid egret I'm taking over this thread

solid egret
#

Hi @trail stag

trail stag
#

I don't see any error in the screenshot that you posted earlier, can you elaborate more?

solid egret
#

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.

trail stag
solid egret
#

No, the server just returns statusCode 200 and HTML as a body.

trail stag
#

Then you should return 30x

solid egret
#

I tried to redirect with following but this also gives a statusCode 200 and isRedirect: false.

response.writeHead(301, {Location: accountLinks.url, });

trail stag
#

Are you using node.js + express as you backend?

solid egret
#

Yes