I'm trying to set up the new Stripe Checkout Create session
. I'm not able to set the tax rate on the subscription during the session creation as the subscription is automatically created by Stripe.
I have set up a Tax rate on the dashboard with the default 20% VAT Rate. I want this applied automatically to all subscriptions. Can anybody guide me through this?
stripe.checkout.Session.create(
payment_method_types=['card'],
subscription_data={
'items': [{
'plan': plan.stripe_plan_name,
'quantity': 1
}],
},
customer_email = user.email,
success_url='https://www.jetpackdata.com/success',
cancel_url='https://www.jetpackdata.com/cancel'
)
And Picked by stripe.redirectToCheckout
on the client-side.
I'm listening on the webhooks for 'checkout.session.completed'
to upgrade the account on my backend.
I'm listening to 'invoice.created'
and when the status=draft
, I set the default tax rate (As we have an hour during which it can be modified after creation).
Should I listen to instead 'customer.subscription.created'
and set it directly on the subscription instead of setting it on every invoice?
The first client subscription purchase doesn't seem to apply the tax rate as the status doesn't remain in draft for an hour as it does during the subscription cycle. Is it because I'm in Test mode?
Any help would be appreciated.