According to most banks’ regulations and rules merchants are able to cancel any payment within the same day that payment was received (before banks perform their own reconciliation). If a cancel request is successful, that payment will not show in the credit card statement. The ip and paymentId parameters are required for a cancel request. If the status value of the response is successful.
Parameters to be sent to the service are as follows:
Input Name | Data Type | Mandatory | Description |
---|---|---|---|
paymentid | String | Yes | ID of the payment |
ip | String | No | IP address of request |
locale | String | No | Language (default: tr) |
conversationId | String | No | Optional parameter to match request and response |
Parameters to be returned from the service are as follows:
Output Name | Data Type | Description |
---|---|---|
price | string | Total amount of order |
currency | string | Currency of order |
paymentid | integer | Id of cancelled payment. |
status | string | Service response result (success / failure) |
errorCode | string | Error code if service response status is failure |
errorMessage | string | Error message if service response status is failure |
errorGroup | string | Error group if service response status is failure |
locale | string | Language (default: tr) |
systemTime | integer | Response system timestamp value |
conversationId | string | If set, conversation ID to match request and response |
Sample codes that can be found in iyzico clients:
$request = new \Iyzipay\Request\CreateCancelRequest();
$request->setLocale(\Iyzipay\Model\Locale::TR);
$request->setConversationId("123456789");
$request->setPaymentId("1");
$request->setIp("85.34.78.112");
$cancel = \Iyzipay\Model\Cancel::create($request, Config::options());
CreateCancelRequest request = new CreateCancelRequest();
request.ConversationId = "123456789";
request.Locale = Locale.TR.ToString();
request.PaymentId = "1";
request.Ip = "85.34.78.112";
Cancel cancel = Cancel.Create(request, options);
CreateCancelRequest request = new CreateCancelRequest();
request.setLocale(Locale.TR.getValue());
request.setConversationId("123456789");
request.setPaymentId("1");
request.setIp("85.34.78.112");
Cancel cancel = Cancel.create(request, options);
iyzipay.cancel.create({
locale: Iyzipay.LOCALE.TR,
conversationId: '123456789',
paymentId: '1',
ip: '85.34.78.112'
}, function (err, result) {
console.log(err, result);
done();
});
request = {
locale: 'tr',
conversationId: '123456789',
paymentId: '238',
ip: '85.34.78.112'
}
cancel = Iyzipay::Model::Cancel.new.create(request, @options)
request = dict([('locale', 'tr')])
request['conversationId'] = '123456'
request['paymentId'] = '1'
request['ip'] = '85.34.78.112'
cancel = iyzipay.Cancel()
cancel_response = cancel.create(request, options)
//Request
{
"locale": "tr",
"conversationId": "123456789",
"paymentId": "26130",
"ip": "85.34.78.112"
}
//Response
{
"status": "success",
"locale": "tr",
"systemTime": 1470730734003,
"conversationId": "123456789",
"paymentId": "26130",
"price": 1.1,
"currency": "TRY"
}
If you have questions about this service, get in touch with us and find out how we can help you.