X-Payments:Callback request with service payment information
- API versions supported
- Samples
- API requests
- API Requests from the store to X-Payments
- Callback requests (web-hooks) from X-Payments to the store
- Browser-related
- Appendix A. Status codes.
- See also
This is a background request that X-Payments sends to the store after a payment has been completed and its result (accepted, declined, etc) has been received from the payment gateway. The request is sent via HTTP POST to the callbackURL defined in the Payment initialisation request. Once this request has been sent, the customer is redirected back to the store.
In API 1.9, this callback request is sent only if the action is performed outside the store. For example, if it is a payment from a card (including a saved card) or a Capture/Refund/Void initiated from the store back end, there will be no callback request. But if a Capture/Refund/Void is initiated from the X-Payments admin back end, or a callback from the gateway is received in X-Payments, then X-Payments will also send a callback to the store.
POSTed data
Field | Value | Type | Description |
action | callback | fixed string | Identifies the callback request |
txnId | (mixed) | string (MD5 hash) | A unique ID of the payment on the side of X-Payments |
updateData | (mixed) | string | Encrypted response from X-Payments |
X-Payments does not expect a response from the store for this request; however, if the HTTP status of the response is not 200 OK, the request is considered failed, and a special notification is sent to the X-Payments admin. The store needs to decrypt the encrypted part of the response and update the order on its side accordingly. Once the updateData value has been decrypted, it is an XML document with the same structure as the response for Payment information request.