IPCPurchaseCancel
Purpose
This method is used by myPOS Checkout API to notify the merchant that the customer has canceled the payment. myPOS Checkout will redirect with this method when the customer chooses to cancel the payment. The call will be made on the previously supplied URL_Cancel.
When this happens:
- The customer is redirected to the
URL_Cancelyou’ve provided - myPOS Checkout sends a POST request to that URL with a summary of the transaction that was cancelled
This allows you, the merchant, to be informed and act accordingly (e.g. unlock cart, log the event, or notify the user).
Parameters Sent via POST
| Property | Typical value | Type | Description |
|---|---|---|---|
| Amount | 23.45 | Double | Echo from IPCPurchase. |
| Currency | EUR | A(3) | Echo from IPCPurchase. |
| OrderID | 201203319999999 | String | Echo from IPCPurchase. |
| Signature | BASE64... | BASE64 | SHA-256 HASH for all properties in the command. Signature is ALWAYS THE LAST PARAMETER IN THE POST. |
How to Handle This
- Verify the signature – this ensures the message is authentic and has not been tampered with.
- Mark the order as canceled in your system.
- Display a user-friendly message to inform the customer their payment was not completed.
Example HTTP POST
POST /payment-cancel-handler.php HTTP/1.1
Host: www.yoursite.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 200
Amount=23.45&
Currency=EUR&
OrderID=201203319999999&
Signature=BASe64EnCRypt3dSignATurE==
Security Tip
Always validate the Signature using the same SHA-256 hashing method as with other IPC calls. This ensures the cancellation was truly sent by myPOS Checkout.