#hazem-elkhalil_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ 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.
Hi
I need to capture when a payment intent is refunded
Can you share a concrete example/flow ?
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
-> 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 wordingcaptured. What Stripe API are you calling for this step
You are using tax calculation? are you following this guide ?
https://docs.stripe.com/tax/custom
If not is there any guide you are following ?
Yeah it is, however there is no UI for a request a refund on the client
so the refund is initatied through the dashboard
In order to create a refund reversal for the tax, have you had the chance to check this part:
https://docs.stripe.com/tax/custom#reversals
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
You want charge.refunded: https://docs.stripe.com/refunds#refund-webhook-events
Ahh okej so charge.refunded triggers when a refund is initatied through the stripe dashboard ?
Yep, should do. Try it out
Alright that is actually it thanks ! ๐
is there any info of the charge obj ?
nvm found it ๐
Thanks guys ๐
!
No problem, glad I could help!
@ocean robin
Hello
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
No, there's no new intent for a refund
alright thanks ๐