#shreyanshcactusglobal_api

1 messages ยท Page 1 of 1 (latest)

earnest dustBOT
#

๐Ÿ‘‹ 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/1308029163998937089

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

nova shoal
#

Yeah unfortunately there isn't a great solution here as you not the pending updates feature doesn't support discounts/coupons. In all likelihood you'd just need to manually rollback the update by reapplying the old state if the payment fails

west sleet
#

Well i can write a cron job which rollsback user packs to lower price.

However i am seeing a funny behaviour.

I tried to upgrade user to higher pack with stimulated payment failure. (The pack movement was to cost $114)
The payment failed & i marked that invoice as void,
And moved the user back to the initial price. But the voiding on invoice and moving the user back to original pack,
Causes to create credit note for ($114) the amount for which charge has failed.

This shouldn't be the case right? If the amount has not successfully charged then why does it create credit note against it?

nova shoal
#

That'll be the proration for the 'unused' time on the voided invocie โ€“ we assuming they're paid and the proration calculation is the same regardless of the state of the invoice

#

You'll probably want to pass proration_behavior: 'none' in your update to avoid that

west sleet
#

That make sense.

The problem here is:

EG: User started subscription on 1st Novermber.

Tried to upgrade to higher price on 10th November. It fails for payment related reason.
We manually try to put that user back to original price on 11th November. At this time i want the user to be back on his cycle which started on 1st November.

If i do proration_behaviour:none then the system will charge the user again for the lower price, Which i don't want. Since the user has already paid for 1st November to 31st November period.

nova shoal
#

Yep then you'd use a trial period to fix the billing cycle back to the original date (1/11) for a free period that they'd already paid for up until the next cycle

west sleet
#

Ah that's what i thought.
This is in the hacky terrain but thanks for your help ๐Ÿ™‚

Have a great day.

nova shoal
#

No problem, glad I could help!