TR EN


Cancel Transaction



A cancel transaction cancels any transaction, apart from itself. Cancel cannot be canceled. You will get success response for cancel transactions only if they are not included in the end-of-day settlement process taking place at the issuer's side. This is the process runs at the end of business day to settle all transactions. This is when the actual funds are transferred from the cardholder's credit card to merchant's bank account. So, for example; if you would like to cancel a sale transaction that is already processed as part of the end-of-day settlement, then you will get a failed error code for the cancel request. In this case, you will need to use refund as alternative to cancel action.


Request parameters
merchant: required
merchant name which you created in your Payfull account.

type: required
Transaction type should be Cancel.

language: required
Response message language can be en / tr

client_ip: required
The client IP who uses the application which sends the request to the API.

transaction_id: required
Sale transaction ID to be refunded which is generated from Payfull

passive_data: optional
This parameter can take any passive data, then API will save it and return it to the caller in the response.

merchant_trx_id: optional
This parameter is for defining and sending a unique id value for the operation. You need to use this value for Transaction Status Information that you generated before.

hash: required
Generated hash code on the caller side

To generate the hash code please follow the steps below:
  • - arrange the parameters alphabetically from A to Z
  • - Create a parameters string which has the length for each parameters with its value side by side
  • - Create the sha256 hash code from the parameters string and pass the merchant password as Shared secret key
  • - Add the hash code to the request parameters


Sample request


merchant: merchant name
type: Cancel
language: tr
client_ip: 192.168.1.1
transaction_id: T4U_8d8125d10a_481a77f38
passive_data: just any passive data
hash: 14339MjuG01015018



Sample Response


{
"type":"Cancel",
"status":1,
"transaction_id":"16252PLnE01010438",
"ErrorMSG":"Success Transaction",
"ErrorCode":"00",
"passive_data":just any passive data,
"total":"10.01",
"currency":"TRY",
"bank_id":"Akbank",
"time":"08-09-2016 03:13:16"
}


PHP Example