#haroon2022
1 messages · Page 1 of 1 (latest)
hi there!
so what the issue exactly? that the charge failed after 14 days?
can you share the Subscription ID (sub_xxx)?
thanks! give me a few minutes to look into this.
looks like hte bank declined the payment, which can happens sometimes: https://dashboard.stripe.com/payments/pi_3OSwRoEaCipTvbCZ0rVI8P3m
Upon cancellation, stripe added a credit equivalent to the plan amount. I'm trying to understand how it happened. Is there any issue with the way we are cancelling the subscription?
yes possible. I think you can setprorate: falseto avoid any credit on the customer
ok but will it charge user for used time?
and if a user is charged and the subscription gets cancelled after 2-3 days using this option will refund the customer for the unused time?
@late warren ??
sorry for the delay, having a look
and if a user is charged and the subscription gets cancelled after 2-3 days using this option will refund the customer for the unused time?
what do you mean? if the payment is succesfull but you still decide to cancel the subscription a few days later?
in general I would recommend to test all of this in test mode to see what happens exactly. and you can use Test Clocks for this: https://stripe.com/docs/billing/testing/test-clocks
Yes, I mean if user has purchased the subscription for a month but cancel it after 2 days. I want to charge him for 2 days and adjust the rest of the amount in his other subscriptions
what do you mean? if the payment is succesfull but you still decide to cancel the subscription a few days later?
then in this case you want prorate: true
👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
@unkempt cradle I have 2 use cases.
One is that the customer has paid me and I only want to refund him the amount that he had paid us.
The other case is that the customer hasn't paid us but still upon cancellation the unused amount is being credited but it shouldn't be the case. I don't want to add this as credit because he hadn't paid us
One is that the customer has paid me and I only want to refund him the amount that he had paid us.
when you say refund, do you mean to their Customer Balance or directly to them?
Adding them to customer balance as credit
ok
let's start with that first use case
and then we can take a look at the other one
does that sound good?
yup, thanks
for the second use case, are you using smart retries? https://stripe.com/docs/billing/subscriptions/overview#smart-retries
Yes, stripe attempt to charge 3 times. But I cancel the subscription after 1st attempt of charge
you can just use the smart retries and remove the 3 scheduled times and keep only one
this way the cancel is done by Stripe instead of your code
but still if user manually cancel the subscription I only want to refund him if it's vali
valid*
you can check the status of the latest_invoice on the subscription, and based on that either use the code we've discussed earlier for invoicing now and refunding or just use prorate: false if you don't want to be any proration
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok thanks