To cancel a subscription you would do the following:
- Cancel the subscription in your back-end i.e. subscription management system
- De-register a stored card (if required) i.e. delete the card from our vault.
Deleting a stored card from the Peach Payments vault is relatively easy.
We recommend that merchants provide users with the facility to delete stored cards at any time. A simple implementation is to provide a delete button next to the stored card display on the user account management page.
If a subscription is cancelled / user clicks delete button:
- Execute a transactions with the payment code set to CC.DR / payment type DR
- Send the stored TOKEN (UniqueID from the original RG transaction) in the IDENTIFICATION.REFERENCEID or registration.id field
Deregistering the card also incurs a transaction cost.
Sample Request (you would send in XML):
<Request version="1.0">
<Header>
<Security sender="123a456b789c123d456e789f012g345" />
</Header>
<Transaction mode="LIVE" response="SYNC" channel="678a456b789c123d456e789f012g432">
<User login="421a456b789c123d456e789f012g098" pwd="56b789c123d456e789f"/>
<Identification>
<TransactionID>MerchantAssignedID</TransactionID>
<ReferenceID>ff80808141021bba0141063caccd7e3e</ReferenceID>
</Identification>
<Payment code="CC.DR"/>
</Transaction>
</Request>
Sample Request (you would send in CopyAndPay) - Available here : https://peachpayments.docs.oppwa.com/tutorials/server-to-server/tokenisation#delete
https://test.oppwa.com/v1/registrations/
curl -X DELETE "https://test.oppwa.com/v1/registrations/{id}\ ?entityId=8a8294174e735d0c014e78cf26461790" \ -H "Authorization: Bearer OGE4Mjk0MTc0ZTczNWQwYzAxNGU3OGNmMjY2YjE3OTR8cXl5ZkhDTjgzZQ=="