#bazylh
1 messages · Page 1 of 1 (latest)
Hi there. One moment
Nothing with that changed recently. On behalf of does not indicate which account the customer is created on. The Stripe Account header indicates this: https://stripe.com/docs/connect/authentication
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```
Ah so it does look like you are passing stripe_account
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?
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
As I said earlier, on_behalf_of does not indicate which account the customer is created on. What you want to specify is stripe account header: https://stripe.com/docs/connect/authentication
Yeah no stripe account header was specified on that request