#bhaumik1665_api

1 messages ¡ Page 1 of 1 (latest)

glossy tokenBOT
old ruinBOT
#

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.

glossy tokenBOT
#

👋 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.

oblique whale
#

Can you summarise the question here please

#

We don't re-open threads

thick nebula
#

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.

oblique whale
thick nebula
#

how customer's balance is populated?

I have not added anything in their balance.

#

how they got money as balance?

oblique whale
thick nebula
#

okay, so its automatic balance is generated at the time of cancel or downgrading?

oblique whale
#

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

thick nebula
#

okay, can I make any configuration at cancel or downgrade time, so that It doesn't add amount into balance?

oblique whale
#

You'd pass proration_behavior: 'none'

thick nebula
#

can you please give me some example?

oblique whale
thick nebula
#

but at the time of subscription update as I want to generate invoice I'm using always invoice as parameter.

#

for proration_behavior

oblique whale
#

I don't understand the question

thick nebula
#

you mentioend that I should use proration_behavior: 'none', correct?

oblique whale
#

Yes, if you want to prevent applying credit to the balance of unused time

thick nebula
#

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??

oblique whale
#

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

thick nebula
#

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?

oblique whale
thick nebula
#

okay.

#

I think that's all I had so far.

Thank you for your help!!