Set up Webhook Event and add charge.refunded.
Click Add Events and after that, click Add Endpoint
Setup Payment Refund Button
In Gateway Transaction, add a Payment Refund button on the page layout
Refund Payment Functionality
If the current Gateway Transaction record Record Type is not Transaction. The Payment Refund page will not display.
In this example, the Record Type is Adjustment, so an error message will display when you click Refund Payment.
If the Current Gateway Transaction record has Transaction as Record Type but the Transaction Status is Pending, the Refund Payment page will not display.
Gateway Transaction record below has Transaction as Record Type but has a Pending Transaction period, when Refund Payment is clicked an error message will display.
3. If the current Gateway Transaction record has Transaction as Record Type but the Transactions Status is Failed, the Refund Payment Page will not display.
If the current Gateway Transaction record has Transaction as Record Type but the Transaction Status is Refunded, a message will display.
If the current Gateway Transaction record has Transaction as Record Type and the Transaction Status is Successful, the Refund Payment page will display.
When Refunding a payment
If the refund is successful
A new Gateway Transaction will be created for refund and the source transaction will be its parent gateway transaction where the refund is being process/held
If the refund is failed
No Gateway Transaction where the Record Type is Refund will not be created