#nash-refunds

1 messages · Page 1 of 1 (latest)

vocal axle
#

heya @gritty moss , can you explain more about your use case?

gritty moss
#

Hi @vocal axle

#

We basically create a customer and an intent and confirmCardPayment on the intent.

#

On the backend we charge the customer every month.

#

So we associate the customer with the intent.

#

In some cases, customer wants a refund, after first charge or maybe after several charges.

vocal axle
#

yeah, you need the PaymentIntent or Charge id to refund, there's no way around it

gritty moss
#

I see. With charge id, you're referring to old charges api?

vocal axle
#

even if you use PaymentIntents now, there is a charge id generated upon successful payment

gritty moss
#

ah ok.

gritty moss
#

Ahh, I see. stripe payment_intents list --limit 1 | jq '.data[].charges.data[].id'

#

So when I confirm an intent to retrieve it, I can save the charge id.

#

So whenever we charge a customer with an intent, we can save the charge id with our internal charge.

#

Another question, why does an intent have a list of charges? You can make multiple succesfull charges on one intent?

vocal axle
#

i don't have the context on this, but the documentation does mention This list only contains the latest charge, even if there were previously multiple unsuccessful charges.

gritty moss
#

ah ok.

#

Last question for tonight :). I was trying to see if I can get all charges for a customer if I have the customer id. Is that possible?

vocal axle
gritty moss
#

This is even if a charge was made through an intent?

vocal axle
#

yep

gritty moss
#

nice!

#

Thank you. Good night.