#bungee_checkout-prorations
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1217165031939248169
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Sorry I missed your question! Are you trying to update an existing subscription? Is this a new Subscription you're creating?
bungee_checkout-prorations
@gray girder just checking in to make sure you saw my questoin
Hi! Yes update a subscription via checkout session
You can't update Subscriptions through Checkout Sessions - you can only create new ones.
You should be using things like the Customer Portal if you want a stripe-hosted UI where you can update a subscription
My flow is the following:
- User subscribes to plan A (15$)
- Then they decide to upgrade to plan B (30$)
Due to proration, there's a $15 credit after upgrading that it's added to their balance, which I prefer to refund immediately. However, the credit appears an hour post-invoice, not instantly, making immediate refunds challenging as the balance temporarily shows $0. Can the checkout session be adjusted for immediate charging, allowing instant credit for any proration?
Again, the Checkout Session wouldn't be involved in the upgrading at all since that's soemthing you can only use for subscription creation. How are you upgrading your Subscription to plan B? Usually with upgrade the Invoice is finalized immediately, so I 'm surprised you're seeing the one hour delay. Do you have an example subscription we could take a look at?
To upgrade the plan I'm creating a new Checkout Session with the parameter proration behavior, as shown here: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-subscription_data-proration_behavior
The previous subscription is cancelled, and the new one is applied. Attached is a screenshot of a test that I performed using test mode.
In this example, I went from a plan of $30 to one of $60.
๐ Ah the delay is because you're creating a new subscription which is not required.
You can upgrade an existing subscription instead
You can specify the proration behavior when you update a subscription object
Oh! Interesting, that should help, thanks!
Another quick question: is it a good practice (as a workaround) to listen to the webhook event payment_intent.succeeded and perform the refund when listening to it? Or is preferred to use the subscription endpoint instead?
What are these refunds for exactly?
Trying to refund Credit Balance to customer after Subscription Downgrade or Cancellation
Gotcha. Since you're working with subscriptions which uses invoices to manage subscription statuses, I'd say you should listen to invoice.paid event instead.
Ah! makes sense, cool cool, thanks!