#Pavan-subscription-flow

1 messages · Page 1 of 1 (latest)

rustic pivot
#

Do you have an example of a subscription update request (req_123) where this happened?

sharp fox
#

It didnt happened yet, we are implementing the flow.

#

We got this doubt

#

and it is valid scenario

#

right ?

rustic pivot
#

And just to clarify what is happening: you update the subscription, the charge on the new amount fails, and you want to know how to tell that if failed from what returns with the subscription.modify call?

sharp fox
#

Yes

rustic pivot
#

If you expand latest_invoice on the modify call you can check its status to see how the payment went

sharp fox
#

Will payment happen in the same call ?

#

Or it happens in background ?

rustic pivot
#

I think so. I am trying to check now.

sharp fox
#

And also if payment fails, subscription quantities won't be updated right ?

rustic pivot
#

It might be best to listen to the invoice.payment_failed event in general to notify users of this kind of failed payment

sharp fox
#

That flow we understand, it is asynhronous

rustic pivot
#

I believe the quantities will be updated

sharp fox
#

How long we can wait ?

rustic pivot
#

Why does it need to be synchronous here?

sharp fox
#

Since payment will be deducted from user, if it fails

#

User should get to know immediatley

#

and also subscription shouldn't have new quantities

#

since it is failing

#

and what happens in the next billing cycle as wel

#

Will they charged with new quantities or old quantities

rustic pivot
#

I am reproducing this behavior now. I will let you know what I find

sharp fox
#

Ok

#

sure

toxic mango
#

@sharp fox while Pompey looks at it, what you need to do is also set this up in Test mode yourself and go through testing this and understanding how it works

sharp fox
#

But how can i know what amount they will deducted at the end of billing cycle

#

Those scenarios can't be tested

toxic mango
#

it's all documented in our docs in details and you, as the developer, can test most of this in a few minutes

sharp fox
#

@toxic mango Suppose customer updates subscription with new quantities but payment failed, what happens in the next billing cycle. Will they charge for new quantities or old quantities. Is it possible to update time to new billing cycle ?

toxic mango
#

this is all explained in the 2 docs I shared above, Can you make sure to take a few minutes to read those end to end and map that to your own business model?

sharp fox
#

If payment fails, rolling back the updates is a manual process. You need to create a new invoice, prorate items on the invoice, and then initiate payment again.

toxic mango
#

@sharp fox you are not reading the docs though you're just assuming here

sharp fox
#

Sorry, reading further

toxic mango
#

that doc covers exactly what you want: defer pricing changes until after they paid!

sharp fox
#

Let me read completely and come back

toxic mango
#

sounds good!

sharp fox
#

If subscription has pending_update and if it is not void. Then what it will do

#

It will keep on trying the payment

toxic mango
#

no we don't retry

#

you have to drive this and get them to pay this otherwise it will revert

sharp fox
#

I mean if payment method gets updated then pending update will become actual update.

toxic mango
#

not sure what that sentence means

sharp fox
#

I am understanding the complications of not void the pending_update

#

Difference between void pending_update and not void pending_update

toxic mango
#

What is the context? The word void is not used once on that doc

#

ugh sorry, the last section was collapsed

#

okay so all that sentence means is that if you want to cancel in real time you void

#

if you don't we will void automatically after 24 hours (it's like the incomplete flow)

sharp fox
#

Cool. Thanks