#hazem-elkhalil_webhooks

1 messages ยท Page 1 of 1 (latest)

topaz heathBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1247500408965042207

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

severe needle
#

Hi

I need to capture when a payment intent is refunded
Can you share a concrete example/flow ?

cloud vapor
#

Hey ๐Ÿ™‚

Yeah

Right now it works like this
-> Payment is captured on a webhook payment_intent.succeeded and a tax calculation is created

Now i want to do
-> Payment intent refunded from dashboard -> Create a tax reversal

#

or am i thinking about it the wrong way

severe needle
#

-> Payment is captured on a webhook payment_intent.succeeded and a tax calculation is created
Sorry, but I'm a bit confused here by the wording captured. What Stripe API are you calling for this step

cloud vapor
#

Yeah it is, however there is no UI for a request a refund on the client

#

so the refund is initatied through the dashboard

topaz heathBOT
severe needle
cloud vapor
#

Yeah, but this is the code i am using, but i need to know when to run that code, like i need an event, when a payment is refunded i can run this code

ocean robin
cloud vapor
#

Ahh okej so charge.refunded triggers when a refund is initatied through the stripe dashboard ?

ocean robin
#

Yep, should do. Try it out

cloud vapor
#

Alright that is actually it thanks ! ๐Ÿ˜„

#

is there any info of the charge obj ?

#

nvm found it ๐Ÿ™‚

#

Thanks guys ๐Ÿ™‚

#

!

ocean robin
#

No problem, glad I could help!

cloud vapor
#

@ocean robin

ocean robin
#

Hello

cloud vapor
#

Do you know if the paymentintent
const charge = event.data.object;
charge.payment_intent!.toString()
is the same paymentintent that was origianlly formed

#

or does it create a new paymentintent for the refund

topaz heathBOT
ocean robin
#

No, there's no new intent for a refund

cloud vapor
#

alright thanks ๐Ÿ™‚