#dusk-_api

1 messages ยท Page 1 of 1 (latest)

gleaming latchBOT
mellow canopyBOT
#

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.

gleaming latchBOT
#

๐Ÿ‘‹ 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.

tidal folio
#
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

shy plover
#

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.

tidal folio
#

I am using a placeholder number here. Could you write one for me, possibly?

shy plover
#

Try 11234567890

#

Without the +.

tidal folio
#

Just a sec

#

stripe._error.InvalidRequestError: Request req_12KqFnfTSGyzgt: "11234567890" is not a valid phone number

#

This failed as well

shy plover
#

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.

tidal folio
#

Think that worked!

#

Thanks for your help @shy plover. Have a great day

shy plover
#

Happy to help! You too!

tidal folio
#

@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?

shy plover
#

Yep, what's up?

tidal folio
#

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.
        """
shy plover
#

No, they are required. I'm not sure why the Python library is showing they're optional.

tidal folio
#

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

shy plover
#

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.

tidal folio
#

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

shy plover
#

Yeah, to be clear, not recommended to have this happen in an iframe.

tidal folio
#

Yep, I am using that

shy plover
#

Although I'm not sure how well that will work in a Flutter app.

tidal folio
#

Oh wait, yeah

shy plover
#

Wait, what?

tidal folio
#

Actually I could not show that in Flutter, yeah

shy plover
#

I thought you said you were creating Account Links?

tidal folio
#

Yeah, my bad. I mixed them up

shy plover
#

Ah.

#

Yeah, give the embedded component a try.

tidal folio
#

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

shy plover
#

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.

tidal folio
shy plover
#

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.

tidal folio
shy plover
#

Yes.

tidal folio
#

Got it, thanks

shy plover
#

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.

tidal folio
#

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

shy plover
#

I don't think that's something we would ever support, but you can request it if you want. ๐Ÿ™‚

tidal folio
#

Okay

#

Is there a CDN server for the javascript package @stripe/connect-js?

#

That way I can add the cdn url in a <script></script> tag in my html code

tidal folio
#

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

shy plover
#

Yep.

tidal folio
#

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?

shy plover