merchantCallbackURL endpoint. For a conceptual explanation of the callback flow, see Payment Response Handling.
What This Endpoint Does
PayGlocal POSTs to this endpoint after every payment — success or failure. The endpoint:- Extracts the
x-gl-tokenfrom the request body - Decodes the JWT payload to read the payment data
- Checks the
statusfield - Updates your order and redirects the customer accordingly
Implementation
Step-by-Step Breakdown
Decoded Payload Structure
Key Notes
Replace
updateOrderStatus and sendConfirmationEmail with your own database and email logic. These are placeholders representing actions you implement.Replace
https://your-domain.com/payment/success and https://your-domain.com/payment/failure with your actual success and failure page URLs.
