#bazylh

1 messages · Page 1 of 1 (latest)

wet robinBOT
merry onyx
#

Hi there. One moment

ionic wolf
#
    user_id: str,
    table: MainTable,
    stripe_id: str,
    stripe_api_key: str,
) -> str:
    customer = table.get_stripe_customer(
        user_id=user_id,
    )

    if customer is None:
        # Create a customer through stripe
        stripe_customer = stripe.Customer.create(
            stripe_account=stripe_id,
            api_key=stripe_api_key,
        )
        # Store the customer
        # TODO: Keep stripe connect id in object?
        table.create_stripe_customer(
            user_id=user_id,
            data=CustomerAccountModels.Visible(
                # TODO: Rename this field to user_id, in upstream. The org_id field here is actually the user_id and is named incorrectly
                org_id=user_id,
                customer_id=stripe_customer["id"],
                CreatedAt=datetime.now(),
                stripe_account=stripe_id,
            ),
        )

        return stripe_customer["id"]

    return customer.customer_id```
merry onyx
#

Ah so it does look like you are passing stripe_account

ionic wolf
#

Yes but when we get it from our db it says it doesnt exist

#

It looks like the customer_id only exists on the connect account. But does not exist when we request it in the setup_intent

#

Yet...

#

Is this still being reviewed?

merry onyx
#

Sorry Discord is very busy

#

Looking now

#

Can you paste the request id where you get a 400

#

It looks like you're just making the request on the platform account not the connect account

#

so that error is expected

ionic wolf
#

req_cKLy3IJS6nktyq

#

Really? Because you can see the on_behalf_of in the req id

merry onyx
#

Yeah no stripe account header was specified on that request