Saklı Kart Düzenleme
Açıklama: Müşterinin kartında yapılacak değişiklik için kullanılan servistir.
URL: /api/editCard
Test Sunucusu: https://test.vepara.com.tr/ccpayment/api/editCard
Canlı Sunucusu: https://app.vepara.com.tr/ccpayment/api/editCard
Method: POST
REQUEST BODY SCHEMA
json
{
"type": "object",
"properties": {
"merchant_key" : {
"type": "string",
"description": "Vepara tarafından sağlanan üye işyerinin benzersiz anahtarıdır."
},
"card_token": {
"type": "string",
"description": "Kart Token"
},
"expiry_year": {
"type": "string",
"description": "Kart son kullanım yılı, dört haneli olmalı"
},
"expiry_mounth": {
"type":"string",
"description": "Kart son kullanım ayı"
},
"customer_number": {
"type": "string",
"description": "Müşterinin numarası"
},
"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."
},
"card_holder_name": {
"type": "string|max:100",
"description": "Kart üzerindeki isim"
},
},
"required": ["merchant_key"],
"required": ["card_token"],
"required": ["expiry_year"],
"required": ["expiry_mounth"],
"required": ["customer_number"],
"required": ["hash_key"],
}
RESPONSE BODY
200 Başarılı Sonuç
json
{
"status_code": 100,
"status_description": "The card token updated successfully",
"card_token": "WNPDZDQNMVNRQO23IAHKDKXIWCRGWHEXCFNRDXXK5CMXGM5A"
}
400 Başarısız Sonuç
json
{
"status_code": 88,
"status_description": "Card update failed"
}
Kod Örnekleri
PHP Örneği
php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://test.vepara.com.tr/ccpayment/api/editCard',
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 =>'{
"card_token": "",
"card_holder_name": "Customer Postman",
"expiry_month": "12",
"expiry_year": "2026",
"merchant_key": "$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he",
"customer_number": "",
"hash_key": "1753db309e540b82:9911:PiRhRNOlY04bwn81S3CWYvEZcXHrq3WwD6yEqbIDg8+7d8JSxrx6__WzuBDh8ZKyeErbng2cZbLFybHszsRXbCXORNY6AwMOkfPuRxenhvtOY6wFDYgcRz1dWVSWBaysX"
}',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Content-Type: application/json',
'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxOSIsImp0aSI6ImFkODMxYTUxYmU3MWEzMzAxYzQzN2I1MTU5MGY4OGJjMTZkZjRmODM4NjZhZGI5NmU3NmJkMzZjZjFjMmU1ZmM1ZDAxZWU5NTFkYjc4MjUxIiwiaWF0IjoxNjk1MjE3NDk2LjI0NjUsIm5iZiI6MTY5NTIxNzQ5Ni4yNDY1LCJleHAiOjE2OTUyMjQ2OTYuMjQwNywic3ViIjoiNiIsInNjb3BlcyI6W119.uXMULNGpNPfH4bLyraz5PV-cBgPM3JZlrRFW4PuGpDcop2HatY4YhKHviNf5-xkgor50iTyaCHYfTGEErNW-1wiWiddxSr62H-Nc7lHP9wRinZEEKFyeF3UbYG7lSAaLy1dTtICsnb3Sixw0XePqGyuAlKw9_gGQOzAmT0p6zQY1VsSzTROIG490G-Sk-CdAeAJS8z0eIgC9avXz2PZ4Esf5AnxH5k9IGX-nLaFnkGP28FdnM3nZMfD8-9OKkrS_uv6DU2uiWmdeZI1pIQknAigJUR2qAZDXa42xJfRfBqBmGA4Ugq-_aje4DzAX063CjHRFSzlWDTv189y2AOM3gCsXSP0UojFwq8KxdxREEj96X-5qebp93q59FevJJiMXmGDKRxwRiAONpXcTNwVXXbrSEerjybZUZRw_SOJxcb6Vmb2NREODqb13S-5bjFo11Lm8K40QBPmKjcc13RsAVb5g_D7Nc7wS3DSNSNxKIzMI8GF7hQPPVKRJ_Wb4_TwlEsPGlZ6HLXwEQ7u4F6KTh38aSvMW4a2Z8dOR9kONgRYdgltnPJ7Z6iUuUY_NHBdrX9q0CAm35R8-eUjOOu8XrX03CLsRLcAimCmZJEREev391yM4o2KLy-If6jBrJ0LGNSMNk0bC6_LGqzACyuZ6vltw84HpiKcPqmE4uXJxESg'
),
));
$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/editCard")
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.eyJhdWQiOiIxOSIsImp0aSI6ImFkODMxYTUxYmU3MWEzMzAxYzQzN2I1MTU5MGY4OGJjMTZkZjRmODM4NjZhZGI5NmU3NmJkMzZjZjFjMmU1ZmM1ZDAxZWU5NTFkYjc4MjUxIiwiaWF0IjoxNjk1MjE3NDk2LjI0NjUsIm5iZiI6MTY5NTIxNzQ5Ni4yNDY1LCJleHAiOjE2OTUyMjQ2OTYuMjQwNywic3ViIjoiNiIsInNjb3BlcyI6W119.uXMULNGpNPfH4bLyraz5PV-cBgPM3JZlrRFW4PuGpDcop2HatY4YhKHviNf5-xkgor50iTyaCHYfTGEErNW-1wiWiddxSr62H-Nc7lHP9wRinZEEKFyeF3UbYG7lSAaLy1dTtICsnb3Sixw0XePqGyuAlKw9_gGQOzAmT0p6zQY1VsSzTROIG490G-Sk-CdAeAJS8z0eIgC9avXz2PZ4Esf5AnxH5k9IGX-nLaFnkGP28FdnM3nZMfD8-9OKkrS_uv6DU2uiWmdeZI1pIQknAigJUR2qAZDXa42xJfRfBqBmGA4Ugq-_aje4DzAX063CjHRFSzlWDTv189y2AOM3gCsXSP0UojFwq8KxdxREEj96X-5qebp93q59FevJJiMXmGDKRxwRiAONpXcTNwVXXbrSEerjybZUZRw_SOJxcb6Vmb2NREODqb13S-5bjFo11Lm8K40QBPmKjcc13RsAVb5g_D7Nc7wS3DSNSNxKIzMI8GF7hQPPVKRJ_Wb4_TwlEsPGlZ6HLXwEQ7u4F6KTh38aSvMW4a2Z8dOR9kONgRYdgltnPJ7Z6iUuUY_NHBdrX9q0CAm35R8-eUjOOu8XrX03CLsRLcAimCmZJEREev391yM4o2KLy-If6jBrJ0LGNSMNk0bC6_LGqzACyuZ6vltw84HpiKcPqmE4uXJxESg"
request.body = JSON.dump({
"card_token": "",
"card_holder_name": "Customer Postman",
"expiry_month": "12",
"expiry_year": "2026",
"merchant_key": "$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he",
"customer_number": "",
"hash_key": "1753db309e540b82:9911:PiRhRNOlY04bwn81S3CWYvEZcXHrq3WwD6yEqbIDg8+7d8JSxrx6__WzuBDh8ZKyeErbng2cZbLFybHszsRXbCXORNY6AwMOkfPuRxenhvtOY6wFDYgcRz1dWVSWBaysX"
})
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({
"card_token": "",
"card_holder_name": "Customer Postman",
"expiry_month": "12",
"expiry_year": "2026",
"merchant_key": "$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he",
"customer_number": "",
"hash_key": "1753db309e540b82:9911:PiRhRNOlY04bwn81S3CWYvEZcXHrq3WwD6yEqbIDg8+7d8JSxrx6__WzuBDh8ZKyeErbng2cZbLFybHszsRXbCXORNY6AwMOkfPuRxenhvtOY6wFDYgcRz1dWVSWBaysX"
})
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxOSIsImp0aSI6ImFkODMxYTUxYmU3MWEzMzAxYzQzN2I1MTU5MGY4OGJjMTZkZjRmODM4NjZhZGI5NmU3NmJkMzZjZjFjMmU1ZmM1ZDAxZWU5NTFkYjc4MjUxIiwiaWF0IjoxNjk1MjE3NDk2LjI0NjUsIm5iZiI6MTY5NTIxNzQ5Ni4yNDY1LCJleHAiOjE2OTUyMjQ2OTYuMjQwNywic3ViIjoiNiIsInNjb3BlcyI6W119.uXMULNGpNPfH4bLyraz5PV-cBgPM3JZlrRFW4PuGpDcop2HatY4YhKHviNf5-xkgor50iTyaCHYfTGEErNW-1wiWiddxSr62H-Nc7lHP9wRinZEEKFyeF3UbYG7lSAaLy1dTtICsnb3Sixw0XePqGyuAlKw9_gGQOzAmT0p6zQY1VsSzTROIG490G-Sk-CdAeAJS8z0eIgC9avXz2PZ4Esf5AnxH5k9IGX-nLaFnkGP28FdnM3nZMfD8-9OKkrS_uv6DU2uiWmdeZI1pIQknAigJUR2qAZDXa42xJfRfBqBmGA4Ugq-_aje4DzAX063CjHRFSzlWDTv189y2AOM3gCsXSP0UojFwq8KxdxREEj96X-5qebp93q59FevJJiMXmGDKRxwRiAONpXcTNwVXXbrSEerjybZUZRw_SOJxcb6Vmb2NREODqb13S-5bjFo11Lm8K40QBPmKjcc13RsAVb5g_D7Nc7wS3DSNSNxKIzMI8GF7hQPPVKRJ_Wb4_TwlEsPGlZ6HLXwEQ7u4F6KTh38aSvMW4a2Z8dOR9kONgRYdgltnPJ7Z6iUuUY_NHBdrX9q0CAm35R8-eUjOOu8XrX03CLsRLcAimCmZJEREev391yM4o2KLy-If6jBrJ0LGNSMNk0bC6_LGqzACyuZ6vltw84HpiKcPqmE4uXJxESg'
}
conn.request("POST", "/ccpayment/api/editCard", 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({
"card_token": "",
"card_holder_name": "Customer Postman",
"expiry_month": "12",
"expiry_year": "2026",
"merchant_key": "$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he",
"customer_number": "",
"hash_key": "1753db309e540b82:9911:PiRhRNOlY04bwn81S3CWYvEZcXHrq3WwD6yEqbIDg8+7d8JSxrx6__WzuBDh8ZKyeErbng2cZbLFybHszsRXbCXORNY6AwMOkfPuRxenhvtOY6wFDYgcRz1dWVSWBaysX"
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://test.vepara.com.tr/ccpayment/api/editCard',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxOSIsImp0aSI6ImFkODMxYTUxYmU3MWEzMzAxYzQzN2I1MTU5MGY4OGJjMTZkZjRmODM4NjZhZGI5NmU3NmJkMzZjZjFjMmU1ZmM1ZDAxZWU5NTFkYjc4MjUxIiwiaWF0IjoxNjk1MjE3NDk2LjI0NjUsIm5iZiI6MTY5NTIxNzQ5Ni4yNDY1LCJleHAiOjE2OTUyMjQ2OTYuMjQwNywic3ViIjoiNiIsInNjb3BlcyI6W119.uXMULNGpNPfH4bLyraz5PV-cBgPM3JZlrRFW4PuGpDcop2HatY4YhKHviNf5-xkgor50iTyaCHYfTGEErNW-1wiWiddxSr62H-Nc7lHP9wRinZEEKFyeF3UbYG7lSAaLy1dTtICsnb3Sixw0XePqGyuAlKw9_gGQOzAmT0p6zQY1VsSzTROIG490G-Sk-CdAeAJS8z0eIgC9avXz2PZ4Esf5AnxH5k9IGX-nLaFnkGP28FdnM3nZMfD8-9OKkrS_uv6DU2uiWmdeZI1pIQknAigJUR2qAZDXa42xJfRfBqBmGA4Ugq-_aje4DzAX063CjHRFSzlWDTv189y2AOM3gCsXSP0UojFwq8KxdxREEj96X-5qebp93q59FevJJiMXmGDKRxwRiAONpXcTNwVXXbrSEerjybZUZRw_SOJxcb6Vmb2NREODqb13S-5bjFo11Lm8K40QBPmKjcc13RsAVb5g_D7Nc7wS3DSNSNxKIzMI8GF7hQPPVKRJ_Wb4_TwlEsPGlZ6HLXwEQ7u4F6KTh38aSvMW4a2Z8dOR9kONgRYdgltnPJ7Z6iUuUY_NHBdrX9q0CAm35R8-eUjOOu8XrX03CLsRLcAimCmZJEREev391yM4o2KLy-If6jBrJ0LGNSMNk0bC6_LGqzACyuZ6vltw84HpiKcPqmE4uXJxESg'
},
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/editCard");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxOSIsImp0aSI6ImFkODMxYTUxYmU3MWEzMzAxYzQzN2I1MTU5MGY4OGJjMTZkZjRmODM4NjZhZGI5NmU3NmJkMzZjZjFjMmU1ZmM1ZDAxZWU5NTFkYjc4MjUxIiwiaWF0IjoxNjk1MjE3NDk2LjI0NjUsIm5iZiI6MTY5NTIxNzQ5Ni4yNDY1LCJleHAiOjE2OTUyMjQ2OTYuMjQwNywic3ViIjoiNiIsInNjb3BlcyI6W119.uXMULNGpNPfH4bLyraz5PV-cBgPM3JZlrRFW4PuGpDcop2HatY4YhKHviNf5-xkgor50iTyaCHYfTGEErNW-1wiWiddxSr62H-Nc7lHP9wRinZEEKFyeF3UbYG7lSAaLy1dTtICsnb3Sixw0XePqGyuAlKw9_gGQOzAmT0p6zQY1VsSzTROIG490G-Sk-CdAeAJS8z0eIgC9avXz2PZ4Esf5AnxH5k9IGX-nLaFnkGP28FdnM3nZMfD8-9OKkrS_uv6DU2uiWmdeZI1pIQknAigJUR2qAZDXa42xJfRfBqBmGA4Ugq-_aje4DzAX063CjHRFSzlWDTv189y2AOM3gCsXSP0UojFwq8KxdxREEj96X-5qebp93q59FevJJiMXmGDKRxwRiAONpXcTNwVXXbrSEerjybZUZRw_SOJxcb6Vmb2NREODqb13S-5bjFo11Lm8K40QBPmKjcc13RsAVb5g_D7Nc7wS3DSNSNxKIzMI8GF7hQPPVKRJ_Wb4_TwlEsPGlZ6HLXwEQ7u4F6KTh38aSvMW4a2Z8dOR9kONgRYdgltnPJ7Z6iUuUY_NHBdrX9q0CAm35R8-eUjOOu8XrX03CLsRLcAimCmZJEREev391yM4o2KLy-If6jBrJ0LGNSMNk0bC6_LGqzACyuZ6vltw84HpiKcPqmE4uXJxESg");
var content = new StringContent("{\r\n \"card_token\": \"\",\r\n \"card_holder_name\": \"Customer Postman\",\r\n \"expiry_month\": \"12\",\r\n \"expiry_year\": \"2026\",\r\n \"merchant_key\": \"$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he\",\r\n \"customer_number\": \"\",\r\n \"hash_key\": \"1753db309e540b82:9911:PiRhRNOlY04bwn81S3CWYvEZcXHrq3WwD6yEqbIDg8+7d8JSxrx6__WzuBDh8ZKyeErbng2cZbLFybHszsRXbCXORNY6AwMOkfPuRxenhvtOY6wFDYgcRz1dWVSWBaysX\"\r\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());