2D Ödeme
Açıklama: Bu endpoint ile 2D ile ödeme yapılır.
URL: /api/paySmart2D
Test Sunucusu: https://test.vepara.com.tr/ccpayment/api/paySmart2D
Canlı Sunucusu: https://app.vepara.com.tr/ccpayment/api/paySmart2D
Method: POST
REQUEST BODY SCHEMA
json
{
"type": "object",
"properties": {
"cc_holder_name": {
"type": "string",
"description": "Kart üzerindeki isim"
},
"cc_no":{
"type" : "string",
"description" : "Kart Numarası"
},
"expiry_year": {
"type": "int",
"description": "Kart son kullanım yılı, dört haneli olmalı"
},
"expiry_mounth": {
"type":"int",
"description": "Kart son kullanım ayı"
},
"cvv": {
"type": "int",
"description": "Kartın arkasında yer alan en az 3 haneli sayı, AMEX kartlarda 4 hanedir ( vpos_type = insurance ise isteğe bağlı olarak gönderilir)"
},
"currency_code": {
"type": "string",
"description": "Para biriminin ISO kodudur. Örneğin, USD, TRY, EUR vb."
},
"installments_number" : {
"type": "integer",
"description":"Taksit sayısı"
},
"invoice_id": {
"type": "string",
"description": "Ödeme yapılacak sepetin sipariş numarası, benzersiz göndermeye dikkat edin"
},
"invoice_description" : {
"type": "string",
"description" : "Ödeme yapılacak sepete özel bir açıklama giriniz. Örneğin: 4578 nolu sipariş ödemesi"
},
"name" : {
"type" : "string",
"description": "Kişinin adı. Örneğin, ürünü satın alan kişinin adı ''john Dao'' ise ad ''john'' olmalıdır"
},
"surname" : {
"type":"string",
"description": "Kişinin soyadı. Örneğin ürünü satın alan kişinin adı “john Dao” ise soyadı “Dao” olmalıdır."
},
"total": {
"type": "decimal",
"description": "Toplam ürün tutarı"
},
"merchant_key" : {
"type": "string",
"description": "Vepara tarafından sağlanan üye işyerinin benzersiz anahtarıdır."
},
"items": {
"type": "array",
"description": "Sepetteki ürünler, örneğin PHP'de json_encode ile diziyi alın",
"example": [{"name":"Item3","price":885.85,"quantity":1,"description":"item3 description"}]
},
"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."
},
"vpos_type": {
"type": "string",
"description":"Yalnızca Sigorta Üye işyeri tarafından bir sigorta ödemesi başlatmak için geçerlidir Mevcut değer ''insurance'' olmalıdır, aksi takdirde hata alınır."
},
"identity_number": {
"type": "string",
"description":"Yalnızca ''vpos_type'':''insurance'' olduğunda gönderilmelidir, İlgili Değer (tckn/vkn/tin) 10-11 basamak arasında olmalıdır."
},
},
"required": ["cc_holder_name"],
"required": ["cc_no"],
"required": ["expiry_year"],
"required": ["expiry_month"],
"required": ["currency_code"],
"required": ["installments_number"],
"required": ["invoice_id"],
"required": ["invoice_description"],
"required": ["name"],
"required": ["surname"],
"required": ["total"],
"required": ["merchant_key"],
"required" : ["items"],
"required" : ["hash_key"],
}
RESPONSE BODY
200 Başarılı Sonuç
json
{
"status_code": 100,
"status_description": "Payment process successful",
"data": {
"order_no": "169268701575565",
"order_id": "169268701575565",
"invoice_id": "sss1250",
"credit_card_no": "413226****0003",
"transaction_type": "Auth",
"payment_status": 1,
"payment_method": 1,
"error_code": 100,
"error": "Transaction Successful",
"auth_code": 350268,
"merchant_commission": 0.02,
"user_commission": 0,
"merchant_commission_percentage": 1.5,
"merchant_commission_fixed": 0,
"payment_reason_code": "",
"payment_reason_code_detail": "",
"hash_key": "713c7d0ad182f243:e7ee:gAdaa7IghCr7DYb2rmPtC4S__mJeTshu3ryVVt4KEQtk=",
"original_bank_error_code": "",
"original_bank_error_description": ""
}
}
200 Başarılı Sonuç (Invalid Hash Key Hatası)
json
{
"data": {
"status_code": 68,
"status_description": "Invalid hash key",
"data": {
"invoice_id": "sss12530",
"order_no": "169269258537892",
"order_id": "169269258537892",
"credit_card_no": "",
"transaction_type": "Auth",
"payment_status": 0,
"payment_method": 1,
"error_code": 68,
"error": "Invalid hash key",
"auth_code": "",
"hash_key": "9e5d67e25a3ce798:982c:kWDLkWBfUnt3upQW87A+zboEY871RlNX3moP6ab+21vptESwG+R79gR1qgKMMDN0"
}
},
"message": "Payment 2D process failed."
}
422 Başarısız Sonuç
json
{
"message": "The merhchant key field must be a string. (and 1 more error)",
"errors": {
"merchant_key": [
"The merhchant key field must be a string.",
"The merchant key field is required."
]
}
}
Hash-Key Oluşturma
Request Body Scheme
json
{
"type": "object",
"properties": {
"currency_code": {
"type": "string",
"description": "Para biriminin ISO kodudur. Örneğin, USD, TRY, EUR vb."
},
"merchant_key" : {
"type": "string",
"description": "Vepara tarafından sağlanan üye işyerinin benzersiz anahtarıdır."
},
"invoice_id": {
"type": "string",
"description": "Ödeme yapılacak sepetin sipariş numarası, benzersiz göndermeye dikkat edin"
},
"app_secret": {
"type": "string",
"description": "app_secret üye işyerine verilen benzersiz ve gizli bir anahtardır."
},
"total": {
"type": "string",
"description": "Toplam ürün tutarı"
},
"installments_number" : {
"type": "string",
"description":"Taksit sayısı"
},
},
"required": ["merchant_key"],
"required": ["currency_code"],
"required": ["invoice_id"],
"required": ["app_secret"],
"required": ["total"],
"required": ["installments_number"],
}
RESPONSE BODY
200 Başarılı Sonuç
json
{
"Hash Key": "fd11c23d8e654717:88c8:hgHyeat3CAXK+1k6MC09m9rlfQ31Z6Bnd1ElcGxVAq9oYAmCWfTl+73TnuQ0SBjleoOujI2NUv8SRb8jprForFMSUvpPPvn+dnPXMqNi2hA="
}
Hash Key Oluşturma Kod Örnekleri
PHP Örneği
php
public static function hashGenerator($currency_code,$merchant_key,$invoice_id,$app_secret,$total,$installments_number)
{
$data = $total . '|' . $installmentsNumber . '|' . $currency_code . '|' . $merchant_key . '|' . $invoice_id;
$iv = substr(sha1(mt_rand()), 0, 16);
$password = sha1($app_secret);
$salt = substr(sha1(mt_rand()), 0, 4);
$saltWithPassword = hash('sha256', $password . $salt);
$encrypted = openssl_encrypt(
$data, 'aes-256-cbc', $saltWithPassword, 0, $iv
);
$msg_encrypted_bundle = $iv . ':' . $salt . ':' . $encrypted;
$msg_encrypted_bundle = str_replace('/', '__', $msg_encrypted_bundle);
return response()->json(['Hash Key' =>$msg_encrypted_bundle ]);
}
Ruby Örneği
ruby
require "digest"
def generateHashKey(secretKey, iv, salt, status, total, invoiceId, orderId, currencyCode)
if secretKey.nil? || iv.nil? || salt.nil?
return nil
end
# Combine secretKey and salt, and then hash the result using SHA256
saltSum = Digest::SHA1.hexdigest(secretKey) + salt
saltHash = Digest::SHA256.hexdigest(saltSum)
# Construct the decryptedMsg string
decryptedMsg = "#{status}|#{total}|#{invoiceId}|#{orderId}|#{currencyCode}"
# Combine iv, saltHash, and decryptedMsg using a colon separator
hashKey = "#{iv}:#{saltHash}:#{decryptedMsg}"
# Replace forward slashes with underscores in the hashKey
hashKey = hashKey.gsub("/", "_")
return hashKey
end
Python Örneği
python
from Crypto.Hash import SHA1
from Crypto.Hash import SHA256
def generateHashKey(secretKey, iv, salt, status, total, invoiceId, orderId, currencyCode):
if secretKey is None or iv is None or salt is None:
return None
# Create a SHA1 hash of the secretKey
hashStr = SHA1.new()
hashStr.update(secretKey.encode("UTF-8"))
password = hashStr.hexdigest()
# Combine password and salt, then create a SHA256 hash
strSum = password + salt
hashSalt = SHA256.new()
hashSalt.update(strSum.encode("UTF-8"))
salt = hashSalt.hexdigest()
# Construct the decryptedMsg string
decryptedMsg = f"{status}|{total}|{invoiceId}|{orderId}|{currencyCode}"
# Combine iv, salt, and decryptedMsg using a colon separator
hashKey = f"{iv}:{salt}:{decryptedMsg}"
# Replace forward slashes with underscores in the hashKey
hashKey = hashKey.replace("/", "_")
return hashKey
secretKey = "your_secret_key"
iv = "your_iv"
salt = "your_salt"
status = "your_status"
total = "your_total"
invoiceId = "your_invoice_id"
orderId = "your_order_id"
currencyCode = "your_currency_code"
generatedHashKey = generateHashKey(secretKey, iv, salt, status, total, invoiceId, orderId, currencyCode)
print("Generated Hash Key:", generatedHashKey)
Nodejs Örneği
javascript
function generateHashKey(secretKey, iv, salt, status, total, invoiceId, orderId, currencyCode) {
var hashKey = iv + ':' + salt + ':' + status + '|' + total + '|' + invoiceId + '|' + orderId + '|' + currencyCode;
hashKey = hashKey.replace(/\//g, '_');
var password = CryptoJS.SHA1(secretKey).toString();
var strSalt = password + salt;
var saltHash = CryptoJS.SHA256(strSalt).toString();
return hashKey.replace(/\//g, '_');
}
var secretKey = "your_secret_key";
var iv = "your_iv";
var salt = "your_salt";
var status = "your_status";
var total = "your_total";
var invoiceId = "your_invoice_id";
var orderId = "your_order_id";
var currencyCode = "your_currency_code";
var generatedHashKey = generateHashKey(secretKey, iv, salt, status, total, invoiceId, orderId, currencyCode);
console.log("Generated Hash Key: " + generatedHashKey);
C# Örneği
c#
using System;
using System.Security.Cryptography;
using System.Text;
using System.Linq;
public class HashGenerator
{
public string GenerateHashKey(string total, string installment, string currency_code, string merchant_key, string invoice_id, string app_secret)
{
string data = total + "|" + installment + "|" + currency_code + "|" + merchant_key + "|" + invoice_id;
Random mt_rand = new Random();
string iv = Sha1Hash(mt_rand.Next().ToString()).Substring(0, 16);
string password = Sha1Hash(app_secret);
string salt = Sha1Hash(mt_rand.Next().ToString()).Substring(0, 4);
string saltWithPassword = "";
using (SHA256 sha256Hash = SHA256.Create())
{
saltWithPassword = GetHash(sha256Hash, password + salt);
}
string encrypted = Encryptor(data, saltWithPassword.Substring(0, 32), iv);
string msg_encrypted_bundle = iv + ":" + salt + ":" + encrypted;
msg_encrypted_bundle = msg_encrypted_bundle.Replace("/", "__");
return msg_encrypted_bundle;
}
private string GetHash(HashAlgorithm hashAlgorithm, string input)
{
byte[] data = hashAlgorithm.ComputeHash(Encoding.UTF8.GetBytes(input));
var sBuilder = new StringBuilder();
for (int i = 0; i < data.Length; i++)
{
sBuilder.Append(data[i].ToString("x2"));
}
return sBuilder.ToString();
}
private string Sha1Hash(string password)
{
return string.Join("", SHA1CryptoServiceProvider.Create().ComputeHash(Encoding.UTF8.GetBytes(password)).Select(x => x.ToString("x2")));
}
private string Encryptor(string TextToEncrypt, string strKey, string strIV)
{
byte[] PlainTextBytes = System.Text.Encoding.UTF8.GetBytes(TextToEncrypt);
AesCryptoServiceProvider aesProvider = new AesCryptoServiceProvider();
aesProvider.BlockSize = 128;
aesProvider.KeySize = 256;
aesProvider.Key = System.Text.Encoding.UTF8.GetBytes(strKey);
aesProvider.IV = System.Text.Encoding.UTF8.GetBytes(strIV);
aesProvider.Padding = PaddingMode.PKCS7;
aesProvider.Mode = CipherMode.CBC;
ICryptoTransform cryptoTransform = aesProvider.CreateEncryptor(aesProvider.Key, aesProvider.IV);
byte[] EncryptedBytes = cryptoTransform.TransformFinalBlock(PlainTextBytes, 0, PlainTextBytes.Length);
return Convert.ToBase64String(EncryptedBytes);
}
public static void Main(string[] args)
{
HashGenerator hashGenerator = new HashGenerator(); // HashGenerator sınıfından bir nesne oluşturun
string hashKey = hashGenerator.GenerateHashKey("10", "1", "TRY", "$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he", "Vepara-INVOICE-2", "217071ea9f3f2e9b695d8f0039024e64");
Console.WriteLine("Hash Key:"+ hashKey);
}
}
Pay Smart 2D Kod Örnekleri
PHP Örneği
php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://test.vepara.com.tr/ccpayment/api/paySmart2D',
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 =>'{
"cc_holder_name":"Test kart",
"cc_no":"4132260000000003",
"expiry_month":"12",
"expiry_year":"2024",
"cvv":"555",
"currency_code":"TRY",
"installments_number": 1,
"invoice_id":"s1211111111",
"invoice_description":" INVOICE TEST DESCRIPTION",
"total":10,
"merchant_key":"$2y$10$HmRgYosneqcwHj.UH7upGuyCZqpQ1ITgSMj9Vvxn.t6f.Vdf2SQFO",
"items":[{"name":"Item3","price":10,"qnantity":1,"description":"item3 description"}],
"name" : "John",
"surname" : "Dao",
"hash_key" : "4ceae33d55ce49f9:7800:WheFAz8QSZTZkA6kxHfpPpzLiSOG7RC8RZ4UZCpotgMUGXNQ4S7h48THDmNxN6fwzZzSeQ7Ps13whEIxoLZ7LSz__shMHuaNBQWw72iyZZhW__PmrFbB4j2qGg3C4Njcj1"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Accept: application/json',
'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxNSIsImp0aSI6ImEyZTlkMzllYTcxMTRhMTE4ODY3NmQxNmNmMWZjYzNmYzcyYmJmYTBkYTRiNWZlMDRmZjFlNmY1ZmY4M2E4N2JiOTcyNzBlMWIyOTNhYjQ3IiwiaWF0IjoxNjkzMzExMjI5LjQ1ODcsIm5iZiI6MTY5MzMxMTIyOS40NTg3LCJleHAiOjE2OTMzMTg0MjkuNDUzMiwic3ViIjoiMzgyIiwic2NvcGVzIjpbXX0.GyabFvLN5JldPXpnX-q3bBUEcPWlVMxsoaGnB3-2Erxuk-aaezCCtbS6ccJpEgUF3TnWdLv3jCpRiFy0NvXpKVAfH5MCKGRoe1D6FDoa-aPHswqEd-avo5VfbT346S2nsHytYYWcFWGVuhrJ3ZprLP0GYdDCqMTJd4jV33_pyMET_J0VFuEdKNJ051F7JyhzSMysE5dsC-sdIRMENYtZzVnO41lr0FJmdLJjwiZSIBmf_0C3CRRwRD8qLkGnUITO13CJvLbx_Wgz4mrXe-CrlvuOtqybBqK24iiNDY2WIMjnRyYsi9QbMeenU46x4UlH9SSDVb0ypQRX5fI7oYx7v6yJE0kYmSX8SmOgFuTup-86Hmd52KfvRfn8lpV35Ul2tqWmhP5INhyP9klyuITmFyj4FjNkRBBFLJR-1jyCVdyL3XdwMNzxVcZA-QcHwOiaU1hBsuHlbWOY7E7SWt8nrn4Zz1OJVHuuiL5Fcrntik-r17pNIvmN7QZJl9hXcsM7hLNVZN79NnOiKhDx7Vn_q211YxVu-MEFG31o8-HEQ3XmGCqk2xydyuRKWE1jbl9CFsD1VYZ80Z1Xpb0AH2Wb3WbemQaWA0qlGTQo21vnVSTQK4KLwgzifdVl2aUQK0KqzCMph4TFaqv88Xvs46So0s1fazkLhysX1R6GYLfaQpU'
),
));
$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/paySmart2D")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Authorization"] = "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxNSIsImp0aSI6ImEyZTlkMzllYTcxMTRhMTE4ODY3NmQxNmNmMWZjYzNmYzcyYmJmYTBkYTRiNWZlMDRmZjFlNmY1ZmY4M2E4N2JiOTcyNzBlMWIyOTNhYjQ3IiwiaWF0IjoxNjkzMzExMjI5LjQ1ODcsIm5iZiI6MTY5MzMxMTIyOS40NTg3LCJleHAiOjE2OTMzMTg0MjkuNDUzMiwic3ViIjoiMzgyIiwic2NvcGVzIjpbXX0.GyabFvLN5JldPXpnX-q3bBUEcPWlVMxsoaGnB3-2Erxuk-aaezCCtbS6ccJpEgUF3TnWdLv3jCpRiFy0NvXpKVAfH5MCKGRoe1D6FDoa-aPHswqEd-avo5VfbT346S2nsHytYYWcFWGVuhrJ3ZprLP0GYdDCqMTJd4jV33_pyMET_J0VFuEdKNJ051F7JyhzSMysE5dsC-sdIRMENYtZzVnO41lr0FJmdLJjwiZSIBmf_0C3CRRwRD8qLkGnUITO13CJvLbx_Wgz4mrXe-CrlvuOtqybBqK24iiNDY2WIMjnRyYsi9QbMeenU46x4UlH9SSDVb0ypQRX5fI7oYx7v6yJE0kYmSX8SmOgFuTup-86Hmd52KfvRfn8lpV35Ul2tqWmhP5INhyP9klyuITmFyj4FjNkRBBFLJR-1jyCVdyL3XdwMNzxVcZA-QcHwOiaU1hBsuHlbWOY7E7SWt8nrn4Zz1OJVHuuiL5Fcrntik-r17pNIvmN7QZJl9hXcsM7hLNVZN79NnOiKhDx7Vn_q211YxVu-MEFG31o8-HEQ3XmGCqk2xydyuRKWE1jbl9CFsD1VYZ80Z1Xpb0AH2Wb3WbemQaWA0qlGTQo21vnVSTQK4KLwgzifdVl2aUQK0KqzCMph4TFaqv88Xvs46So0s1fazkLhysX1R6GYLfaQpU"
request.body = JSON.dump({
"cc_holder_name": "Test kart",
"cc_no": "4132260000000003",
"expiry_month": "12",
"expiry_year": "2024",
"cvv": "555",
"currency_code": "TRY",
"installments_number": 1,
"invoice_id": "s1211111111",
"invoice_description": " INVOICE TEST DESCRIPTION",
"total": 10,
"merchant_key": "$2y$10$HmRgYosneqcwHj.UH7upGuyCZqpQ1ITgSMj9Vvxn.t6f.Vdf2SQFO",
"items": [
{
"name": "Item3",
"price": 10,
"qnantity": 1,
"description": "item3 description"
}
],
"name": "John",
"surname": "Dao",
"hash_key": "4ceae33d55ce49f9:7800:WheFAz8QSZTZkA6kxHfpPpzLiSOG7RC8RZ4UZCpotgMUGXNQ4S7h48THDmNxN6fwzZzSeQ7Ps13whEIxoLZ7LSz__shMHuaNBQWw72iyZZhW__PmrFbB4j2qGg3C4Njcj1"
})
response = https.request(request)
puts response.read_body
Python Örneği
python
import requests
import json
url = "https://test.vepara.com.tr/ccpayment/api/paySmart2D"
payload = json.dumps({
"cc_holder_name": "Test kart",
"cc_no": "4132260000000003",
"expiry_month": "12",
"expiry_year": "2024",
"cvv": "555",
"currency_code": "TRY",
"installments_number": 1,
"invoice_id": "s1211111111",
"invoice_description": " INVOICE TEST DESCRIPTION",
"total": 10,
"merchant_key": "$2y$10$HmRgYosneqcwHj.UH7upGuyCZqpQ1ITgSMj9Vvxn.t6f.Vdf2SQFO",
"items": [
{
"name": "Item3",
"price": 10,
"qnantity": 1,
"description": "item3 description"
}
],
"name": "John",
"surname": "Dao",
"hash_key": "4ceae33d55ce49f9:7800:WheFAz8QSZTZkA6kxHfpPpzLiSOG7RC8RZ4UZCpotgMUGXNQ4S7h48THDmNxN6fwzZzSeQ7Ps13whEIxoLZ7LSz__shMHuaNBQWw72iyZZhW__PmrFbB4j2qGg3C4Njcj1"
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxNSIsImp0aSI6ImEyZTlkMzllYTcxMTRhMTE4ODY3NmQxNmNmMWZjYzNmYzcyYmJmYTBkYTRiNWZlMDRmZjFlNmY1ZmY4M2E4N2JiOTcyNzBlMWIyOTNhYjQ3IiwiaWF0IjoxNjkzMzExMjI5LjQ1ODcsIm5iZiI6MTY5MzMxMTIyOS40NTg3LCJleHAiOjE2OTMzMTg0MjkuNDUzMiwic3ViIjoiMzgyIiwic2NvcGVzIjpbXX0.GyabFvLN5JldPXpnX-q3bBUEcPWlVMxsoaGnB3-2Erxuk-aaezCCtbS6ccJpEgUF3TnWdLv3jCpRiFy0NvXpKVAfH5MCKGRoe1D6FDoa-aPHswqEd-avo5VfbT346S2nsHytYYWcFWGVuhrJ3ZprLP0GYdDCqMTJd4jV33_pyMET_J0VFuEdKNJ051F7JyhzSMysE5dsC-sdIRMENYtZzVnO41lr0FJmdLJjwiZSIBmf_0C3CRRwRD8qLkGnUITO13CJvLbx_Wgz4mrXe-CrlvuOtqybBqK24iiNDY2WIMjnRyYsi9QbMeenU46x4UlH9SSDVb0ypQRX5fI7oYx7v6yJE0kYmSX8SmOgFuTup-86Hmd52KfvRfn8lpV35Ul2tqWmhP5INhyP9klyuITmFyj4FjNkRBBFLJR-1jyCVdyL3XdwMNzxVcZA-QcHwOiaU1hBsuHlbWOY7E7SWt8nrn4Zz1OJVHuuiL5Fcrntik-r17pNIvmN7QZJl9hXcsM7hLNVZN79NnOiKhDx7Vn_q211YxVu-MEFG31o8-HEQ3XmGCqk2xydyuRKWE1jbl9CFsD1VYZ80Z1Xpb0AH2Wb3WbemQaWA0qlGTQo21vnVSTQK4KLwgzifdVl2aUQK0KqzCMph4TFaqv88Xvs46So0s1fazkLhysX1R6GYLfaQpU'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Nodejs Örneği
javascript
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://test.vepara.com.tr/ccpayment/api/paySmart2D',
'headers': {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxNSIsImp0aSI6ImEyZTlkMzllYTcxMTRhMTE4ODY3NmQxNmNmMWZjYzNmYzcyYmJmYTBkYTRiNWZlMDRmZjFlNmY1ZmY4M2E4N2JiOTcyNzBlMWIyOTNhYjQ3IiwiaWF0IjoxNjkzMzExMjI5LjQ1ODcsIm5iZiI6MTY5MzMxMTIyOS40NTg3LCJleHAiOjE2OTMzMTg0MjkuNDUzMiwic3ViIjoiMzgyIiwic2NvcGVzIjpbXX0.GyabFvLN5JldPXpnX-q3bBUEcPWlVMxsoaGnB3-2Erxuk-aaezCCtbS6ccJpEgUF3TnWdLv3jCpRiFy0NvXpKVAfH5MCKGRoe1D6FDoa-aPHswqEd-avo5VfbT346S2nsHytYYWcFWGVuhrJ3ZprLP0GYdDCqMTJd4jV33_pyMET_J0VFuEdKNJ051F7JyhzSMysE5dsC-sdIRMENYtZzVnO41lr0FJmdLJjwiZSIBmf_0C3CRRwRD8qLkGnUITO13CJvLbx_Wgz4mrXe-CrlvuOtqybBqK24iiNDY2WIMjnRyYsi9QbMeenU46x4UlH9SSDVb0ypQRX5fI7oYx7v6yJE0kYmSX8SmOgFuTup-86Hmd52KfvRfn8lpV35Ul2tqWmhP5INhyP9klyuITmFyj4FjNkRBBFLJR-1jyCVdyL3XdwMNzxVcZA-QcHwOiaU1hBsuHlbWOY7E7SWt8nrn4Zz1OJVHuuiL5Fcrntik-r17pNIvmN7QZJl9hXcsM7hLNVZN79NnOiKhDx7Vn_q211YxVu-MEFG31o8-HEQ3XmGCqk2xydyuRKWE1jbl9CFsD1VYZ80Z1Xpb0AH2Wb3WbemQaWA0qlGTQo21vnVSTQK4KLwgzifdVl2aUQK0KqzCMph4TFaqv88Xvs46So0s1fazkLhysX1R6GYLfaQpU'
},
body: JSON.stringify({
"cc_holder_name": "Test kart",
"cc_no": "4132260000000003",
"expiry_month": "12",
"expiry_year": "2024",
"cvv": "555",
"currency_code": "TRY",
"installments_number": 1,
"invoice_id": "s1211111111",
"invoice_description": " INVOICE TEST DESCRIPTION",
"total": 10,
"merchant_key": "$2y$10$HmRgYosneqcwHj.UH7upGuyCZqpQ1ITgSMj9Vvxn.t6f.Vdf2SQFO",
"items": [
{
"name": "Item3",
"price": 10,
"qnantity": 1,
"description": "item3 description"
}
],
"name": "John",
"surname": "Dao",
"hash_key": "4ceae33d55ce49f9:7800:WheFAz8QSZTZkA6kxHfpPpzLiSOG7RC8RZ4UZCpotgMUGXNQ4S7h48THDmNxN6fwzZzSeQ7Ps13whEIxoLZ7LSz__shMHuaNBQWw72iyZZhW__PmrFbB4j2qGg3C4Njcj1"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
C# Örneği
c#
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://test.vepara.com.tr/ccpayment/api/paySmart2D");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxNSIsImp0aSI6ImEyZTlkMzllYTcxMTRhMTE4ODY3NmQxNmNmMWZjYzNmYzcyYmJmYTBkYTRiNWZlMDRmZjFlNmY1ZmY4M2E4N2JiOTcyNzBlMWIyOTNhYjQ3IiwiaWF0IjoxNjkzMzExMjI5LjQ1ODcsIm5iZiI6MTY5MzMxMTIyOS40NTg3LCJleHAiOjE2OTMzMTg0MjkuNDUzMiwic3ViIjoiMzgyIiwic2NvcGVzIjpbXX0.GyabFvLN5JldPXpnX-q3bBUEcPWlVMxsoaGnB3-2Erxuk-aaezCCtbS6ccJpEgUF3TnWdLv3jCpRiFy0NvXpKVAfH5MCKGRoe1D6FDoa-aPHswqEd-avo5VfbT346S2nsHytYYWcFWGVuhrJ3ZprLP0GYdDCqMTJd4jV33_pyMET_J0VFuEdKNJ051F7JyhzSMysE5dsC-sdIRMENYtZzVnO41lr0FJmdLJjwiZSIBmf_0C3CRRwRD8qLkGnUITO13CJvLbx_Wgz4mrXe-CrlvuOtqybBqK24iiNDY2WIMjnRyYsi9QbMeenU46x4UlH9SSDVb0ypQRX5fI7oYx7v6yJE0kYmSX8SmOgFuTup-86Hmd52KfvRfn8lpV35Ul2tqWmhP5INhyP9klyuITmFyj4FjNkRBBFLJR-1jyCVdyL3XdwMNzxVcZA-QcHwOiaU1hBsuHlbWOY7E7SWt8nrn4Zz1OJVHuuiL5Fcrntik-r17pNIvmN7QZJl9hXcsM7hLNVZN79NnOiKhDx7Vn_q211YxVu-MEFG31o8-HEQ3XmGCqk2xydyuRKWE1jbl9CFsD1VYZ80Z1Xpb0AH2Wb3WbemQaWA0qlGTQo21vnVSTQK4KLwgzifdVl2aUQK0KqzCMph4TFaqv88Xvs46So0s1fazkLhysX1R6GYLfaQpU");
var content = new StringContent("{\t\r\n\t\"cc_holder_name\":\"Test kart\",\r\n\t\"cc_no\":\"4132260000000003\",\r\n\t\"expiry_month\":\"12\",\r\n\t\"expiry_year\":\"2024\",\r\n\t\"cvv\":\"555\",\r\n\t\"currency_code\":\"TRY\", \r\n \"installments_number\": 1,\r\n\t\"invoice_id\":\"s1211111111\",\r\n\t\"invoice_description\":\" INVOICE TEST DESCRIPTION\",\r\n\t\"total\":10,\r\n\t\"merchant_key\":\"$2y$10$HmRgYosneqcwHj.UH7upGuyCZqpQ1ITgSMj9Vvxn.t6f.Vdf2SQFO\",\r\n\t\"items\":[{\"name\":\"Item3\",\"price\":10,\"qnantity\":1,\"description\":\"item3 description\"}],\r\n\t\"name\" : \"John\",\r\n\t\"surname\" : \"Dao\",\r\n \"hash_key\" : \"4ceae33d55ce49f9:7800:WheFAz8QSZTZkA6kxHfpPpzLiSOG7RC8RZ4UZCpotgMUGXNQ4S7h48THDmNxN6fwzZzSeQ7Ps13whEIxoLZ7LSz__shMHuaNBQWw72iyZZhW__PmrFbB4j2qGg3C4Njcj1\"\r\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());