#bhaumik1665_api
1 messages ¡ Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- bhaumik1665_api, 17 minutes ago, 35 messages
- bhaumik1665_api, 4 days ago, 14 messages
- bhaumik1665_api, 6 days ago, 67 messages
đ 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/1242416417094242355
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
okay, I'm sending you the message. give me a moment.
I have one more question, when I use subscription::update for upgrades of quantities immediately.
when I use payment_behavior:default_incomplete and proration_behavior:always_invoice its creating invoice for prorated amount.
but the problem is that.
sometimes the invoice is incomplete and sometimes the invoice is complete. I dont understand why it happens.
it should stay fix (either incomplete or complete)
both invoice examples.
https://dashboard.stripe.com/test/invoices/in_1PIoVLHpCCuanh4qZURn25ln -> This has not generated payment intent (the payment was completed directly)
https://dashboard.stripe.com/test/invoices/in_1PIOZtHpCCuanh4qbC3HsXdX -> This has generated payment intent (incomplete first and then I used Stripe.confirmCardPayment() in frontend to complete that payment.)
I want to make some configurations so that it doesn't use customer balance and generate invoice + payment intent always.
Not possible. We'll always apply the customer balance to invoices
how customer's balance is populated?
I have not added anything in their balance.
how they got money as balance?
We'd credit their balance for any prorated refunds due to unused time when cancelling/downgrading subscriptions, for example: https://docs.stripe.com/billing/customer/balance
okay, so its automatic balance is generated at the time of cancel or downgrading?
Yes, becauyse we don't directly 'refund' for unused time it's applied as credit to their balance which can be used to reduce the amount due on future invoices
You can manually manage the balance if you need
okay, can I make any configuration at cancel or downgrade time, so that It doesn't add amount into balance?
You'd pass proration_behavior: 'none'
can you please give me some example?
but at the time of subscription update as I want to generate invoice I'm using always invoice as parameter.
for proration_behavior
I don't understand the question
you mentioend that I should use proration_behavior: 'none', correct?
Yes, if you want to prevent applying credit to the balance of unused time
okay, now when I upgrade the subscription as I want to create an invoice I am using proration_behavior:always_invoice
so that I generate invoice everytime for an upgrade.
now when I you downgrade, in that case you're saying that I should use proration_behavior:none??
Well, I guess it would depend on the downgrade. But if the downgrade will result in credit for unused time on the current plan, and you want to prevent that, then yes
okay.
$scheduleSchedule = $stripe->subscriptionSchedules->create([
'from_subscription' => $subscriptionId,
]);
$updatedSchedule = $stripe->subscriptionSchedules->update($scheduleSchedule->id, [
'end_behavior' => 'release',
'phases' => [
[
[
'start_date' => $scheduleSchedule->current_phase->start_date,
'end_date' => $scheduleSchedule->current_phase->end_date,
'items' => [
[
'price' => 'price_1P3WuXHpCCuanh4q0ZiyoOjF',
'quantity' => 16
]
]
],
[
'start_date' => $scheduleSchedule->current_phase->end_date,
'items' => [
[
'price' => 'price_1P3WuXHpCCuanh4q0ZiyoOjF',
'quantity' => 15
]
]
],
]
]
]);
I'm downgrading subscription like this.
now where should I use that proration_behavior:none parameter?
API reference has the answers: https://docs.stripe.com/api/subscription_schedules/update#update_subscription_schedule-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.
Or perhaps on the specific phase that is the downgrade: https://docs.stripe.com/api/subscription_schedules/update#update_subscription_schedule-phases-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.