#coachleyton
1 messages · Page 1 of 1 (latest)
Hello! Yeah, that seems fine if it works as expected for your use case. We have official guidance here for how we recommend you do this: https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#credits-for-downgrades
Does making a refund create an invoice?
I assumed so, so I wrote this logic to get the payment_intent of the last invoice where an actual payment was made. I then use that payment_intent to process the refund. Is this necessary?
No, making a refund does not create an Invoice.
Creating a Refund based on the Payment Intent the Invoice creates is the right approach, yep.
ah, so I don't necessarily need this logic? I could just get the Customer's latest invoice?
That depends on how your system works and how many Invoices are generated, but potentially yes.
For the sake of safety, just in case I misunderstand something, I'll leave that logic in. Also, I have this question (from a note that I wrote for myself yesterday)
Not sure what you mean. Are you seeing that behavior in test mode?
No, haven't seen this behaviour in test mode, but I might've just been doing it wrong, so I thought I'd directly ask here.
Let me re-phrase: Does a refund affect the Customer's Credit once it is successfully processed? If so, there might be a problem. In my current implementation, I manually minus £X from the Customer's credit before the refund occurs, but then once the refund is processed after a few days, will the refunded amount be taken from the Customer's credit a second time?
If that makes sense
I'm not 100% sure what you're asking, to be honest, but the easiest way to find out for sure what will happen is to test it in test mode.
If I don't manually set the user's credit to 0 after processing the refund, would it be set to 0 automatically for me once the refund is successfully processed?
Once that refund is successfully processed (as indicated by a charge.refund webhook), will stripe take away the positive credit from the Customer's balance?
If I'm still not communicating this correctly, then I'm just happy to play around in Test mode to get my answer 🙂
If I understand you correctly the refunds won't impact their balance. You might find this helpful as well: https://support.stripe.com/questions/refunding-credit-balance-to-customer-after-subscription-downgrade-or-cancellation
But I do encourage you to test in test mode to make sure you get the behavior you expect.
ahh yeah yeah that's all I needed to know. Thank you 🙂
Are you okay to leave this thread open temporarily? I want to clarify that my current payment flow is okay. Just need to go through it and actually remember it lol