İşlem İade
Açıklama: Ödemesi yapılmış bir işlemin iadesi için kullanılır.
Not İade edilecek tutar 0 veya " " (Boş) gönderildiği taktirde tutarın tamamı iade edilir
URL: /api/refund
Test Sunucusu: https://test.vepara.com.tr/ccpayment/api/refund
Canlı Sunucusu: https://app.vepara.com.tr/ccpayment/api/refund
Method: POST
REQUEST BODY SCHEMA
json
{
"type": "object",
"properties": {
"invoice_id": {
"type": "string",
"description": "Ödeme yapılacak sepetin sipariş numarası, benzersiz göndermeye dikkat edin"
},
"amount": {
"type": "double/empty string",
"description": "İade edilecek tutarı ifade eder"
},
"app_id": {
"type": "string",
"description": "app_id üye işyerine atanan benzersiz bir anahtardır."
},
"app_secret": {
"type": "string",
"description": "app_secret üye işyerine verilen benzersiz ve gizli bir anahtardır."
},
"merchant_key" : {
"type": "string",
"description": "Vepara tarafından sağlanan üye işyerinin benzersiz anahtarıdır."
},
"hash_key": {
"type": "string",
"description": "işlemin bankaya ulaşmadan, kullanıcının ödemeyle ilgili değişiklikler yapamamasını ve ödemenin güvenli olarak tamamlanmasını sağlamaktadır. Aşağıda verilen hash anahtarını yazmak için kullanılan algoritma için tıklayınız veya sağ taraftaki PHP sekmesinden örneğini inceleyiniz."
},
"refund_transaction_id": {
"type": "string",
},
"refund_webhook_key": {
"type": "string",
"description": "Bankadan iade için başarılı cevap gelmediği zaman işlem manuel iadeye düşüyor, bu durumda bildirim almak için iade webhook'unu kullanabilirsiniz"
},
},
"required": ["invoice_id"],
"required": ["amount"],
"required": ["app_id"],
"required": ["app_secret"],
"required": ["merchant_key"],
"required": ["hash_key"],
}
200 Başarılı Sonuç
json
{
"status_code": 100,
"status_description": "Refund completed successfully",
"order_no": "16952164787436841",
"invoice_id": "wEWIcIVOifMGsqc",
"ref_no": "",
"ref_number": ""
}
400 Başarısız Sonuç
json
{
"status_code": 31,
"status_description": "Transaction Not Found",
"order_no": "",
"invoice_id": "wEWIcIVOifMGc",
"ref_no": "",
"ref_number": ""
}
Kod Örnekleri
PHP Örneği
php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://test.vepara.com.tr/ccpayment/api/refund',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"merchant_key": "$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he",
"invoice_id": "wEWIcIVOifMGc",
"amount": 10,
"app_id": "c3d81ae3cc3011ef10dcefa31a458d65",
"app_secret": "217071ea9f3f2e9b695d8f0039024e64",
"hash_key": "90cb8102b218c917:4e8f:0dZYhYItbY+kSj700DLHUK22__wl8wwReDjP4boWzKUZUD3ZP7Kh0jAQR2Gt0T7+PcgWXpKywhFvxb1cRlNov7PIxnv6pARNO19ybyURYDc4="
}',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Content-Type: application/json',
'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxOSIsImp0aSI6IjRkYzBjY2FiYWU0MjczYWE2YTk4ODRlYWZlN2VhYmJjYTUxZTA1MzQ5ZjYxNDk5MzhmMmQ1YmUyYzUyMDI5YWI0ODQ3NDMwOTMwYzcxYWQzIiwiaWF0IjoxNjk1MjE3NDQ5LjAxNzgsIm5iZiI6MTY5NTIxNzQ0OS4wMTc4LCJleHAiOjE2OTUyMjQ2NDkuMDEyOCwic3ViIjoiNiIsInNjb3BlcyI6W119.l4kUfAJx5V6B9BdARFkhg8dAAdfT6LqBeUkVuh1k2sOfz7BCA-vcdHHG-k-y5hZJshedmk-AwVPRoYc3Ce9LIE4CZnJZWHqhUTZifSSj8bokMLrbH0BERcZS2IaZdba7oJ8sjFgAd9p6pr-e__E2HwbYp9Y2TzqEzF8jsouEpFrsqqRUovMNJnJs5iMtZkBJTXYYF_4fC7FGeN70glg3Hi3O5gWmwEuC62N6kb_uIXPDj56x0ZfBdey3fpg6ugQV_mrWxcWNT2fUF5-Jxct7X7PQ8yp6wyELo4boYvproWbRJojhcqrYID3CKEtPEldxxFEcSetx-zNCFHb44rbRSyyYrcPedM2zCEU-ycufTAGG_kwVa1Akssh1kLwZN-vNt2Xsx2AXZbf9nih6kdA20E1ip2PU4cqa_TohmfqBrjW9LuVWkNUbhLclFA2NZBuZLC6jrCULTbs4YLEilEMW53oX90qK354n1oNBq6w5NLKg6XW1k1GHgj7pd6gs0z5dKD1cet_UAl_kHg08m_jx7oeniZGhmqBqNAHGwdJZ94OjY8ZvEqFZc8MjCFJWz81g7KoUl68fdIpBZ4aYnJtd6uYsg0QHuR4fYL1dCpAl_--enCYl8XJMM31-4ddfVS-cbpYJKg-MRB9gEo0FdN7C-3fZBQHH0SqfjVpMt9lx9Bg',
'Cookie: veparaccpayment_session=ZOq6q12h3Pfw5AsQhwayL7GZ1EiJz0MK8GsXLj2a'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Ruby Örneği
ruby
require "uri"
require "json"
require "net/http"
url = URI("https://test.vepara.com.tr/ccpayment/api/refund")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = "application/json"
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxOSIsImp0aSI6IjRkYzBjY2FiYWU0MjczYWE2YTk4ODRlYWZlN2VhYmJjYTUxZTA1MzQ5ZjYxNDk5MzhmMmQ1YmUyYzUyMDI5YWI0ODQ3NDMwOTMwYzcxYWQzIiwiaWF0IjoxNjk1MjE3NDQ5LjAxNzgsIm5iZiI6MTY5NTIxNzQ0OS4wMTc4LCJleHAiOjE2OTUyMjQ2NDkuMDEyOCwic3ViIjoiNiIsInNjb3BlcyI6W119.l4kUfAJx5V6B9BdARFkhg8dAAdfT6LqBeUkVuh1k2sOfz7BCA-vcdHHG-k-y5hZJshedmk-AwVPRoYc3Ce9LIE4CZnJZWHqhUTZifSSj8bokMLrbH0BERcZS2IaZdba7oJ8sjFgAd9p6pr-e__E2HwbYp9Y2TzqEzF8jsouEpFrsqqRUovMNJnJs5iMtZkBJTXYYF_4fC7FGeN70glg3Hi3O5gWmwEuC62N6kb_uIXPDj56x0ZfBdey3fpg6ugQV_mrWxcWNT2fUF5-Jxct7X7PQ8yp6wyELo4boYvproWbRJojhcqrYID3CKEtPEldxxFEcSetx-zNCFHb44rbRSyyYrcPedM2zCEU-ycufTAGG_kwVa1Akssh1kLwZN-vNt2Xsx2AXZbf9nih6kdA20E1ip2PU4cqa_TohmfqBrjW9LuVWkNUbhLclFA2NZBuZLC6jrCULTbs4YLEilEMW53oX90qK354n1oNBq6w5NLKg6XW1k1GHgj7pd6gs0z5dKD1cet_UAl_kHg08m_jx7oeniZGhmqBqNAHGwdJZ94OjY8ZvEqFZc8MjCFJWz81g7KoUl68fdIpBZ4aYnJtd6uYsg0QHuR4fYL1dCpAl_--enCYl8XJMM31-4ddfVS-cbpYJKg-MRB9gEo0FdN7C-3fZBQHH0SqfjVpMt9lx9Bg"
request["Cookie"] = "veparaccpayment_session=ZOq6q12h3Pfw5AsQhwayL7GZ1EiJz0MK8GsXLj2a"
request.body = JSON.dump({
"merchant_key": "$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he",
"invoice_id": "wEWIcIVOifMGc",
"amount": 10,
"app_id": "c3d81ae3cc3011ef10dcefa31a458d65",
"app_secret": "217071ea9f3f2e9b695d8f0039024e64",
"hash_key": "90cb8102b218c917:4e8f:0dZYhYItbY+kSj700DLHUK22__wl8wwReDjP4boWzKUZUD3ZP7Kh0jAQR2Gt0T7+PcgWXpKywhFvxb1cRlNov7PIxnv6pARNO19ybyURYDc4="
})
response = https.request(request)
puts response.read_body
Python Örneği
python
import http.client
import json
conn = http.client.HTTPSConnection("test.vepara.com.tr")
payload = json.dumps({
"merchant_key": "$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he",
"invoice_id": "wEWIcIVOifMGc",
"amount": 10,
"app_id": "c3d81ae3cc3011ef10dcefa31a458d65",
"app_secret": "217071ea9f3f2e9b695d8f0039024e64",
"hash_key": "90cb8102b218c917:4e8f:0dZYhYItbY+kSj700DLHUK22__wl8wwReDjP4boWzKUZUD3ZP7Kh0jAQR2Gt0T7+PcgWXpKywhFvxb1cRlNov7PIxnv6pARNO19ybyURYDc4="
})
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxOSIsImp0aSI6IjRkYzBjY2FiYWU0MjczYWE2YTk4ODRlYWZlN2VhYmJjYTUxZTA1MzQ5ZjYxNDk5MzhmMmQ1YmUyYzUyMDI5YWI0ODQ3NDMwOTMwYzcxYWQzIiwiaWF0IjoxNjk1MjE3NDQ5LjAxNzgsIm5iZiI6MTY5NTIxNzQ0OS4wMTc4LCJleHAiOjE2OTUyMjQ2NDkuMDEyOCwic3ViIjoiNiIsInNjb3BlcyI6W119.l4kUfAJx5V6B9BdARFkhg8dAAdfT6LqBeUkVuh1k2sOfz7BCA-vcdHHG-k-y5hZJshedmk-AwVPRoYc3Ce9LIE4CZnJZWHqhUTZifSSj8bokMLrbH0BERcZS2IaZdba7oJ8sjFgAd9p6pr-e__E2HwbYp9Y2TzqEzF8jsouEpFrsqqRUovMNJnJs5iMtZkBJTXYYF_4fC7FGeN70glg3Hi3O5gWmwEuC62N6kb_uIXPDj56x0ZfBdey3fpg6ugQV_mrWxcWNT2fUF5-Jxct7X7PQ8yp6wyELo4boYvproWbRJojhcqrYID3CKEtPEldxxFEcSetx-zNCFHb44rbRSyyYrcPedM2zCEU-ycufTAGG_kwVa1Akssh1kLwZN-vNt2Xsx2AXZbf9nih6kdA20E1ip2PU4cqa_TohmfqBrjW9LuVWkNUbhLclFA2NZBuZLC6jrCULTbs4YLEilEMW53oX90qK354n1oNBq6w5NLKg6XW1k1GHgj7pd6gs0z5dKD1cet_UAl_kHg08m_jx7oeniZGhmqBqNAHGwdJZ94OjY8ZvEqFZc8MjCFJWz81g7KoUl68fdIpBZ4aYnJtd6uYsg0QHuR4fYL1dCpAl_--enCYl8XJMM31-4ddfVS-cbpYJKg-MRB9gEo0FdN7C-3fZBQHH0SqfjVpMt9lx9Bg',
'Cookie': 'veparaccpayment_session=ZOq6q12h3Pfw5AsQhwayL7GZ1EiJz0MK8GsXLj2a'
}
conn.request("POST", "/ccpayment/api/refund", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Nodejs Örneği
javascript
const axios = require('axios');
let data = JSON.stringify({
"merchant_key": "$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he",
"invoice_id": "wEWIcIVOifMGc",
"amount": 10,
"app_id": "c3d81ae3cc3011ef10dcefa31a458d65",
"app_secret": "217071ea9f3f2e9b695d8f0039024e64",
"hash_key": "90cb8102b218c917:4e8f:0dZYhYItbY+kSj700DLHUK22__wl8wwReDjP4boWzKUZUD3ZP7Kh0jAQR2Gt0T7+PcgWXpKywhFvxb1cRlNov7PIxnv6pARNO19ybyURYDc4="
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://test.vepara.com.tr/ccpayment/api/refund',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxOSIsImp0aSI6IjRkYzBjY2FiYWU0MjczYWE2YTk4ODRlYWZlN2VhYmJjYTUxZTA1MzQ5ZjYxNDk5MzhmMmQ1YmUyYzUyMDI5YWI0ODQ3NDMwOTMwYzcxYWQzIiwiaWF0IjoxNjk1MjE3NDQ5LjAxNzgsIm5iZiI6MTY5NTIxNzQ0OS4wMTc4LCJleHAiOjE2OTUyMjQ2NDkuMDEyOCwic3ViIjoiNiIsInNjb3BlcyI6W119.l4kUfAJx5V6B9BdARFkhg8dAAdfT6LqBeUkVuh1k2sOfz7BCA-vcdHHG-k-y5hZJshedmk-AwVPRoYc3Ce9LIE4CZnJZWHqhUTZifSSj8bokMLrbH0BERcZS2IaZdba7oJ8sjFgAd9p6pr-e__E2HwbYp9Y2TzqEzF8jsouEpFrsqqRUovMNJnJs5iMtZkBJTXYYF_4fC7FGeN70glg3Hi3O5gWmwEuC62N6kb_uIXPDj56x0ZfBdey3fpg6ugQV_mrWxcWNT2fUF5-Jxct7X7PQ8yp6wyELo4boYvproWbRJojhcqrYID3CKEtPEldxxFEcSetx-zNCFHb44rbRSyyYrcPedM2zCEU-ycufTAGG_kwVa1Akssh1kLwZN-vNt2Xsx2AXZbf9nih6kdA20E1ip2PU4cqa_TohmfqBrjW9LuVWkNUbhLclFA2NZBuZLC6jrCULTbs4YLEilEMW53oX90qK354n1oNBq6w5NLKg6XW1k1GHgj7pd6gs0z5dKD1cet_UAl_kHg08m_jx7oeniZGhmqBqNAHGwdJZ94OjY8ZvEqFZc8MjCFJWz81g7KoUl68fdIpBZ4aYnJtd6uYsg0QHuR4fYL1dCpAl_--enCYl8XJMM31-4ddfVS-cbpYJKg-MRB9gEo0FdN7C-3fZBQHH0SqfjVpMt9lx9Bg',
'Cookie': 'veparaccpayment_session=ZOq6q12h3Pfw5AsQhwayL7GZ1EiJz0MK8GsXLj2a'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
C# Örneği
c#
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://test.vepara.com.tr/ccpayment/api/refund");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxOSIsImp0aSI6IjRkYzBjY2FiYWU0MjczYWE2YTk4ODRlYWZlN2VhYmJjYTUxZTA1MzQ5ZjYxNDk5MzhmMmQ1YmUyYzUyMDI5YWI0ODQ3NDMwOTMwYzcxYWQzIiwiaWF0IjoxNjk1MjE3NDQ5LjAxNzgsIm5iZiI6MTY5NTIxNzQ0OS4wMTc4LCJleHAiOjE2OTUyMjQ2NDkuMDEyOCwic3ViIjoiNiIsInNjb3BlcyI6W119.l4kUfAJx5V6B9BdARFkhg8dAAdfT6LqBeUkVuh1k2sOfz7BCA-vcdHHG-k-y5hZJshedmk-AwVPRoYc3Ce9LIE4CZnJZWHqhUTZifSSj8bokMLrbH0BERcZS2IaZdba7oJ8sjFgAd9p6pr-e__E2HwbYp9Y2TzqEzF8jsouEpFrsqqRUovMNJnJs5iMtZkBJTXYYF_4fC7FGeN70glg3Hi3O5gWmwEuC62N6kb_uIXPDj56x0ZfBdey3fpg6ugQV_mrWxcWNT2fUF5-Jxct7X7PQ8yp6wyELo4boYvproWbRJojhcqrYID3CKEtPEldxxFEcSetx-zNCFHb44rbRSyyYrcPedM2zCEU-ycufTAGG_kwVa1Akssh1kLwZN-vNt2Xsx2AXZbf9nih6kdA20E1ip2PU4cqa_TohmfqBrjW9LuVWkNUbhLclFA2NZBuZLC6jrCULTbs4YLEilEMW53oX90qK354n1oNBq6w5NLKg6XW1k1GHgj7pd6gs0z5dKD1cet_UAl_kHg08m_jx7oeniZGhmqBqNAHGwdJZ94OjY8ZvEqFZc8MjCFJWz81g7KoUl68fdIpBZ4aYnJtd6uYsg0QHuR4fYL1dCpAl_--enCYl8XJMM31-4ddfVS-cbpYJKg-MRB9gEo0FdN7C-3fZBQHH0SqfjVpMt9lx9Bg");
request.Headers.Add("Cookie", "veparaccpayment_session=ZOq6q12h3Pfw5AsQhwayL7GZ1EiJz0MK8GsXLj2a");
var content = new StringContent("{\r\n \"merchant_key\": \"$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he\",\r\n \"invoice_id\": \"wEWIcIVOifMGc\",\r\n \"amount\": 10,\r\n \"app_id\": \"c3d81ae3cc3011ef10dcefa31a458d65\",\r\n \"app_secret\": \"217071ea9f3f2e9b695d8f0039024e64\",\r\n \"hash_key\": \"90cb8102b218c917:4e8f:0dZYhYItbY+kSj700DLHUK22__wl8wwReDjP4boWzKUZUD3ZP7Kh0jAQR2Gt0T7+PcgWXpKywhFvxb1cRlNov7PIxnv6pARNO19ybyURYDc4=\"\r\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());