“Refund to Balance” feature will allow you to refund instantly to your customers whenever you approve the “refund request”. How?
Requirements
• Refund to Balance button
The parameters that should be sent to the service are as follows:
Parameter name | Type | Mandatory | Description |
---|---|---|---|
locale | string | no | Language settings (default: tr) |
conversationId | string | no | Conversation ID to match request and response |
paymentId | string | yes | ID of the related payment. |
callbackUrl | string | yes | Redirection URL(https) |
The response parameters are as follows:
Parameter name | Type | Description |
---|---|---|
token | string | Unique value created for refund. This token is sent to callBackUrl |
url | string | Url to start the refund to iyzico account process |
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 |
$request = new \Iyzipay\Request\CreateRefundToBalanceRequest();
$request->setPaymentId("11654127");
$request->setCallbackUrl("https://www.callback");
$refundToBalance = \Iyzipay\Model\RefundToBalance::create($request, Config::options());
request = {
locale: Iyzipay::Model::Locale::TR,
conversationId: '123456789',
paymentId: '11661247',
callbackUrl: 'https://merchanturl.com'
}
refundToBalance = Iyzipay::Model::RefundToBalance.new.create(request, @options)
//Request
{
"locale": "tr",
"conversationId": "123456",
"paymentId": "11661247",
"callbackUrl": "https://merchanturl.com"
}
//Response
{
"status": "success",
"locale": "tr",
"systemTime": 1470730913791,
"conversationId": "123456",
"token": "1xxyyzzqq345",
"url": "https://sandbox-consumer.iyzico.com/xyz"
}
Örnek Kodlar