#coachleyton

1 messages · Page 1 of 1 (latest)

pale otterBOT
viral lark
storm wasp
#

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?

viral lark
#

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.

storm wasp
#

ah, so I don't necessarily need this logic? I could just get the Customer's latest invoice?

viral lark
#

That depends on how your system works and how many Invoices are generated, but potentially yes.

storm wasp
#

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)

viral lark
#

Not sure what you mean. Are you seeing that behavior in test mode?

storm wasp
#

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

viral lark
#

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.

storm wasp
#

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 🙂

viral lark
#

But I do encourage you to test in test mode to make sure you get the behavior you expect.

storm wasp
#

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

viral lark
#

We never delete threads, you can always access this thread at any time in the future by searching for it.

#

We do close idle threads though.