#dusk-_api
1 messages ยท Page 1 of 1 (latest)
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.
- dusk-_docs, 8 hours ago, 9 messages
๐ 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/1237798138270711809
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
account = stripe.Account.create(
business_type="non_profit",
capabilities={
"card_payments": {"requested": True},
"transfers": {"requested": True},
"us_bank_account_ach_payments": {"requested": True},
},
company={
"address": {
"city": "San Francisco",
"country": "US",
"line1": "1234 Main Street",
"postal_code": "94111",
"state": "CA",
},
"name": "John Doe's Company",
"phone": "+11234567890",
"tax_id": "000000001",
},
country="US",
email=f"stripeuser+{int(time.time())}@gmail.com",
type="custom",
)
This is my Python code
Hello! Looking at your logs I'm not seeing a failed attempt that doesn't use + or -. The phone number should just be the numbers themselves, nothing else.
I am using a placeholder number here. Could you write one for me, possibly?
Just a sec
stripe._error.InvalidRequestError: Request req_12KqFnfTSGyzgt: "11234567890" is not a valid phone number
This failed as well
Oh, I think that has one too many digits, and the extra 1 at the beginning isn't valid for a US phone number I think. Try 2345556789.
Happy to help! You too!
@shy plover I have another question related to Stripe Connect Onboarding / Stripe Account.
It's not letting me create a new thread so can I ask here?
Yep, what's up?
So, after creating an account, my backend is doing this
account_link = stripe.AccountLink.create(
account=account.id,
type="account_onboarding",
refresh_url="https://example.com/reauth",
return_url="https://example.com/return",
)
Are the refresh and return url's optional?
Asking because the (docs)[https://docs.stripe.com/api/account_links/create] show they're required but the Python stripe library shows the parameters as NotOptional
The Python class is AccountLink.CreateParams and it shows the 2 fields like this
refresh_url: NotRequired[str]
"""
The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link's URL so they can continue with Connect Onboarding. If a new account link cannot be generated or the redirect fails you should display a useful error to the user.
"""
return_url: NotRequired[str]
"""
The URL that the user will be redirected to upon leaving or completing the linked flow.
"""
No, they are required. I'm not sure why the Python library is showing they're optional.
Hmm, so I am going to be using this account onboarding url as an iframe in my Flutter app.
I would rather not have a return_url in place since the user will never leave the app
Or is there an event I can watch out for so I can just hide the iframe as soon as the user is supposed to return
That's not really possible with an account link. The onboarding is going to happen on Stripe's site, not yours. We don't recommend doing the onboarding in a Flutter app the way you're describing.
Yep, it is going to happen on Stripe's site.
An iframe will just render that Stripe site inside our web app or mobile app
Yeah, to be clear, not recommended to have this happen in an iframe.
You might want to try the embedded onboarding component instead: https://docs.stripe.com/connect/supported-embedded-components/account-onboarding
Yep, I am using that
Although I'm not sure how well that will work in a Flutter app.
Oh wait, yeah
Wait, what?
Actually I could not show that in Flutter, yeah
I thought you said you were creating Account Links?
Yeah, my bad. I mixed them up
My original plan was embedded component but I could not find a way to do it in Flutter
Because the only 2 options it shows are raw html/js and react
Yeah, I can't really advise on the Flutter side of things as we don't officially support Flutter.
My top recommendation would be to use Account Links and have your Flutter app open the Account Link URL in the device's native browser, then have the return and refresh URLs send them back to your app when done.
That way people can use their password managers and other browser features you can't offer inside your app.
If you try to force onboarding to happen in your app it's going to make the experience worse.
Is there a way I can get a URL for the embeddable component? If so, I could render that as an iframe and embed it in my app
Asking because if you go to the example component at https://docs.stripe.com/connect/supported-embedded-components/account-onboarding?client=js, and if you open dev tools and click inspect element at the embedded component, you can see even stripe is using an iframe to render that component
No, you can't get the URL of that iframe in code.
We do use an iframe in the implementation, but even the embedded onboarding is still going to kick out to a full page redirect in some circumstances.
So, my only option is the account link or API onboarding https://docs.stripe.com/connect/onboarding#api-onboarding ?
Yes.
Got it, thanks
Unless you hosted a page on your server with the embedded onboarding component, then loaded that in your app.
Again, not really recommended, but might be worth trying.
Yeah
I was thinking that
Would it be worth requesting stripe to provide urls (for iframe) for embedded component? I think many people could benefit from this
I don't think that's something we would ever support, but you can request it if you want. ๐
Okay
Is there a CDN server for the javascript package @stripe/connect-js?
Seen here in the .js file example
That way I can add the cdn url in a <script></script> tag in my html code
Sweet, thank you. I am going to go with the hosting this on my backend and loading this as an iframe on my frontend approach
Do I need to create an Account first and use the account id in replacement of '{{CONNECTED_ACCOUNT_ID}}'?
https://docs.stripe.com/connect/get-started-connect-embedded-components#create-an-accountsession
Yep.
One last thing. Regarding this parameter when creating an account, is there a doc where I can see what's the difference between each type?
Yes, although those types have been replaced by controller properties. Have a look here: https://docs.stripe.com/connect/migrate-to-controller-properties