#tyson
1 messages · Page 1 of 1 (latest)
Let's start over
Just pasting the original question here
Same question as bismarck:
Is the customer paying all at once here?
Or is this like an installments type thing?
Can you give an example just so I understand correctly
But a customer may come to the page and their may only be 3 sessions left ect or just want to go to one
Its for a 4 weeks every sunday their is a football session that costs £9 if you book for all 4 its £9 each so total £36. If you come and there is only 3 weeks left you pay for £27
If you only want one session however you have to pay £11
Thats the kinda gist of it.
Got it that makes sense. If they just want 1 session, then you could create the checkout session in "payment" mode (ie a one time payment): https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-mode. Just set the amount to $11/week: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data-unit_amount. Otherwise if they will have > 1 session you will need a subscription. So, create the checkout session in "subscription" mode: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-mode with a price of $9/week.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
The problem though is since it's a subscription, it will continue to bill every week forever
However, after the customer has checked out, you can update the underlying subscription object to set a cancel_at date: https://stripe.com/docs/api/subscriptions/update#update_subscription-cancel_at
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
This way they will only be billed for the dates that you want them to
You'll also want to set proration_behavior to None for that update: https://stripe.com/docs/api/subscriptions/update#update_subscription-proration_behavior
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So that the customer is charged the full $9
Ok sweet thanks for that! But it can't be done in one checkout session?