I'm trying to use Stripe Checkout with a connected account. Where I would be able to create a subscription with transfer_data["destination"] and application_fee_percent.
The flow expected:
- Create checkout Session (server side)
checkout_session = stripe.checkout.Session.create(
success_url=domain_url + "/success.html",
cancel_url=domain_url + "/canceled.html",
payment_method_types=["card"],
mode="subscription",
line_items=[
{
"price": priceId,
"quantity": 1
}
],
customer=customerId)
- Redirect the user to Stripe checkout page
- User enters his card details and subscribe
I tried with subscription_data["application_fee_percent"] and with Stripe-Account set. But this is not working because customer is not found. Because I guess all customers are created on the platform account, not the connected account (that I want to conserve)
So my question: What's the way to do this with Checkout?
My other choice would be:
- Collect card information to create a payment method
- Create a subscription with application_fee_percent and transfer_data[destination].
But I would prefer to use Checkout for collecting card details which seems to me a better and easier user flow...
All advices will be appreciated. Thanks.