Ödeme Doğrulama
Açıklama: PreAuth ödemede sistemde Ön-Provizyon/Pre-Authorization olarak işlem oluşturulur. Bu işlemi Başarısız/Failed veya Başarılı/Completed yapmak için aşağıdaki istek parametreleri kullanılarak bu API çağrılmalıdır.
Not: Total parametresi gönderilmediğinde veya 0 olarak gönderildiğinde tutarın tamamı onaylanır.
URL: /api/confirmPayment
Test Sunucusu: https://test.vepara.com.tr/ccpayment/api/confirmPayment
Canlı Sunucusu: https://app.vepara.com.tr/ccpayment/api/confirmPayment
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."
},
"invoice_id": {
"type": "string",
"description": "Ödeme yapılacak sepetin sipariş numarası, benzersiz göndermeye dikkat edin"
},
"status": {
"type": "integer",
"description": "Ödeme yapılacak sepetin sipariş numarası, benzersiz göndermeye dikkat edin"
},
"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."
},
"total": {
"type": "integer",
"description": "Toplam ürün tutarı"
},
},
"required": ["merchant_key"],
"required": ["invoice_id"],
"required": ["hash_key"],
"required": ["status"],
}
200 Başarılı Sonuç
json
{
"status_code": 113,
"status_description": "There is no pre auth transaction found for this operation",
"transaction_status": "Unknown",
"order_id": "",
"invoice_id": "invoicee11"
}
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
Hash Key, girdi değeri kullanılarak oluşturulması gereken benzersiz bir anahtardır. Aşağıda hash_key oluşturma yöntemi verilmiştir.
Request Body Scheme
json
{
"type": "object",
"properties": {
"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."
},
"status": {
"type": "integer",
"description": "Ödemenin Durumu"
},
},
"required": ["merchant_key"],
"required": ["invoice_id"],
"required": ["app_secret"],
"required": ["status"],
}
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($merchant_key,$invoice_id,$status,$app_secret)
{
$data = $merchant_key . '|' . $invoice_id . '|' . $status;
$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 'openssl'
require 'digest/sha1'
require 'digest/sha256'
def generate_confirm_payment_hash_key(merchant_key, invoice_id,status, app_secret_getter)
# appSecret'i güvenli bir şekilde al
app_secret = app_secret_getter.call
# Verileri birleştir
data = "#{merchant_key}|#{invoice_id}|#{status}"
# Rastgele IV ve salt oluştur (daha güvenli rastgelelik için OpenSSL::Random kullan)
iv = OpenSSL::Random.random_bytes(16)
salt = OpenSSL::Random.random_bytes(4)
# appSecret'i salt ile hashle
salt_with_password = Digest::SHA256.hexdigest(app_secret + salt.unpack('H*').first)
# AES-256 CBC ile veriyi şifrele
cipher = OpenSSL::Cipher.new('aes-256-cbc')
cipher.encrypt
cipher.key = salt_with_password
cipher.iv = iv
encrypted_data = cipher.update(data) + cipher.final
# IV, salt ve şifrelenmiş veriyi birleştir
msg_encrypted_bundle = "#{iv.unpack('H*').first}:#{salt.unpack('H*').first}:#{encrypted_data.unpack('H*').first}"
# '/' karakterini daha güvenli bir ayraçla değiştir
msg_encrypted_bundle.gsub!('/', '__')
msg_encrypted_bundle
end
# Örnek kullanım (app_secret_getter güvenli bir şekilde anahtar alır diye varsayarak)
def get_app_secret
# appSecret'i güvenli bir şekilde alma mantığınızı buraya yazın (örneğin, ortam değişkenlerinden)
ENV['APP_SECRET']
end
merchant_key = 'your_merchant_key'
invoice_id = '12345'
status = 'success'
encrypted_hash = generate_confirm_payment_hash_key(merchant_key, invoice_id, order_id, status, method(:get_app_secret))
puts encrypted_hash
Python Örneği
python
import os
from hashlib import sha256
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
from Crypto.Util.Padding import pad, unpad
def generateConfrimPaymentHashKey(merchant_key, invoice_id, status, app_secret_getter):
app_secret = app_secret_getter()
data = f"{merchant_key}|{invoice_id}|{status}"
iv = get_random_bytes(16)
salt = get_random_bytes(16)
salt_with_password = sha256(app_secret.encode() + salt).hexdigest()
cipher = AES.new(salt_with_password.encode(), AES.MODE_CBC, iv)
ciphertext = cipher.encrypt(pad(data.encode('utf-8'), AES.block_size))
encrypted_data = ciphertext.hex()
msg_encrypted_bundle = f"{iv.hex()},{salt.hex()},{encrypted_data}"
return msg_encrypted_bundle.replace('/', '__')
# Example usage (assuming app_secret_getter fetches the secret key securely)
def get_app_secret():
# Implement logic to fetch appSecret securely (e.g., from environment variables)
return os.environ.get('APP_SECRET')
merchant_key = 'your_merchant_key'
invoice_id = '12345'
status = 'success'
encrypted_hash = generateConfrimPaymentHashKey(merchant_key, invoice_id, order_id, status, get_app_secret)
print(encrypted_hash)
Nodejs Örneği
javascript
const crypto = require('crypto');
function generateConfrimPaymentHashKey(merchantKey, invoiceId, status, appSecret) {
const data = `${merchantKey}|${invoiceId}|${status}`;
const iv = crypto.randomBytes(16).toString('hex');
const salt = crypto.randomBytes(16).toString('hex');
const saltWithPassword = crypto.createHash('sha256').update(appSecret + salt).digest('hex');
const cipher = crypto.createCipheriv('aes-256-cbc', saltWithPassword, Buffer.from(iv, 'hex'));
cipher.setAutoPadding(true);
const encrypted = cipher.update(data, 'utf8', 'hex') + cipher.final('hex');
const msgEncryptedBundle = `${iv}:${salt}:${encrypted}`;
return msgEncryptedBundle.replace('/', '__');
}
const merchantKey = 'your_merchant_key';
const invoiceId = '12345';
const status = 'complete';
const appSecret = 'your_app_secret';
const encryptedHash = generateConfrimPaymentHashKey(merchantKey, invoiceId, orderId, status, getAppSecret);
console.log(encryptedHash);
C# Örneği
c#
using System;
using System.Security.Cryptography;
using System.Text;
using System.Linq;
public class HashGenerator
{
public string GenerateHashKey(string merchant_key, string invoice_id, string status, string app_secret)
{
string data = merchant_key + "|" + invoice_id + "|" + status;
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("$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he", "Vepara-INVOICE-2","Complete","217071ea9f3f2e9b695d8f0039024e64");
Console.WriteLine("Hash Key:"+ hashKey);
}
}
Kod Örnekleri
PHP Örneği
php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://test.vepara.com.tr/ccpayment/api/confirmPayment',
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 => array('invoice_id' => 'invoicee11','merchant_key' => '$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he','status
' => '1','hash_key' => '5db1c974c2caa81d:4769:xUwwCbzetC5lz55BH5lIhy+yVeeagLFIIGTvLqriLAN60T5DZvmA98AjywiOSF9Ix57uCAg4kRP8IEtGxpfiGBKxoAcHGwlpDU0ieHs__MxE=','total' => '10'),
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxOSIsImp0aSI6ImY3ZjViNzhiYzlhZDc2YjJhMTk4MjVlOWFhMWQ0YzliMzdmNjQ5YmRhMGEyZmM4OGEzZjhkYTY2MTJhMjQ3ZDRjMDViMzRjMjY4MjAxMGY5IiwiaWF0IjoxNjk1MjA2NDU0LjM3MjQsIm5iZiI6MTY5NTIwNjQ1NC4zNzI0LCJleHAiOjE2OTUyMTM2NTQuMzY2NSwic3ViIjoiNiIsInNjb3BlcyI6W119.otOMxuU0RewNj62dARGmnlQ41lDQkVwJPHUMXpHoXQGqlX1PiAx4_U90COJrGWc4g4m5uT_9rI1ts21AGDdPaPjegFPf0ivBqp1aUir2vukwa5p0HmOYOTojakBGPBwmOtpaiJlqKWapMaAVk2e4ZEFKPHBoD2i2PFRYXYstLlef4zMcPORVUE1B-0TN-w7iBF1SS3p0qwiIAdVSkRXvgvMIHb6bvEi47kS50Vtgb2w-AP5kKgxMxeAH28CfRK1i0Cbq-cNsxaAZq14b1zQmecC3QSr2mAdEzPM61f6wIIq0BRM_8xBft7dOzdn8eTCLzRUDUQ8CHTlKCw4-BfsVgV2gkbgfOzvqpKJJtmGMpwjDCY7CDgMrW22CzptfDqycrAaYCrcssxHtjUxK3u1-jDY9s0AQVL2WqCRwSSYNcHz3Gg7xAjht3BL4gGRG-yp2opcQeCYFMatzWPjYdp3D54KRAf5KAgnluRT80Y_iv8aTe5UleYTEeQIsUarb-SxlH4VlRTBTx_uxi5tAIhKL1X78Y5xayOy6ApLusNUc1nI-9I4NW-_P516YKA39milG65F9aEbyTxyd1VrSIHsZzSc3cEh734_v1Jk-52seb-yaOTIYNwx1BGeXQNzzeqW8xPn2XJpzF7anNPCzrmVgfQi940FUxuiBQcIsAa_DI-8',
'Cookie: veparaccpayment_session=7QdLht1NipfGTXLV8YkQhK8L8BaeFYivuCT73DQa'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Ruby Örneği
ruby
require "uri"
require "net/http"
url = URI("https://test.vepara.com.tr/ccpayment/api/confirmPayment")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxOSIsImp0aSI6ImY3ZjViNzhiYzlhZDc2YjJhMTk4MjVlOWFhMWQ0YzliMzdmNjQ5YmRhMGEyZmM4OGEzZjhkYTY2MTJhMjQ3ZDRjMDViMzRjMjY4MjAxMGY5IiwiaWF0IjoxNjk1MjA2NDU0LjM3MjQsIm5iZiI6MTY5NTIwNjQ1NC4zNzI0LCJleHAiOjE2OTUyMTM2NTQuMzY2NSwic3ViIjoiNiIsInNjb3BlcyI6W119.otOMxuU0RewNj62dARGmnlQ41lDQkVwJPHUMXpHoXQGqlX1PiAx4_U90COJrGWc4g4m5uT_9rI1ts21AGDdPaPjegFPf0ivBqp1aUir2vukwa5p0HmOYOTojakBGPBwmOtpaiJlqKWapMaAVk2e4ZEFKPHBoD2i2PFRYXYstLlef4zMcPORVUE1B-0TN-w7iBF1SS3p0qwiIAdVSkRXvgvMIHb6bvEi47kS50Vtgb2w-AP5kKgxMxeAH28CfRK1i0Cbq-cNsxaAZq14b1zQmecC3QSr2mAdEzPM61f6wIIq0BRM_8xBft7dOzdn8eTCLzRUDUQ8CHTlKCw4-BfsVgV2gkbgfOzvqpKJJtmGMpwjDCY7CDgMrW22CzptfDqycrAaYCrcssxHtjUxK3u1-jDY9s0AQVL2WqCRwSSYNcHz3Gg7xAjht3BL4gGRG-yp2opcQeCYFMatzWPjYdp3D54KRAf5KAgnluRT80Y_iv8aTe5UleYTEeQIsUarb-SxlH4VlRTBTx_uxi5tAIhKL1X78Y5xayOy6ApLusNUc1nI-9I4NW-_P516YKA39milG65F9aEbyTxyd1VrSIHsZzSc3cEh734_v1Jk-52seb-yaOTIYNwx1BGeXQNzzeqW8xPn2XJpzF7anNPCzrmVgfQi940FUxuiBQcIsAa_DI-8"
request["Cookie"] = "veparaccpayment_session=7QdLht1NipfGTXLV8YkQhK8L8BaeFYivuCT73DQa"
form_data = [['invoice_id', 'invoicee11'],['merchant_key', '$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he'],['status
', '1'],['hash_key', '5db1c974c2caa81d:4769:xUwwCbzetC5lz55BH5lIhy+yVeeagLFIIGTvLqriLAN60T5DZvmA98AjywiOSF9Ix57uCAg4kRP8IEtGxpfiGBKxoAcHGwlpDU0ieHs__MxE='],['total', '10']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
Python Örneği
python
import http.client
import mimetypes
from codecs import encode
conn = http.client.HTTPSConnection("test.vepara.com.tr")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=invoice_id;'))
dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))
dataList.append(encode("invoicee11"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=merchant_key;'))
dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))
dataList.append(encode("$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=status;'))
dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))
dataList.append(encode("1"))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=hash_key;'))
dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))
dataList.append(encode("5db1c974c2caa81d:4769:xUwwCbzetC5lz55BH5lIhy+yVeeagLFIIGTvLqriLAN60T5DZvmA98AjywiOSF9Ix57uCAg4kRP8IEtGxpfiGBKxoAcHGwlpDU0ieHs__MxE="))
dataList.append(encode('--' + boundary))
dataList.append(encode('Content-Disposition: form-data; name=total;'))
dataList.append(encode('Content-Type: {}'.format('text/plain')))
dataList.append(encode(''))
dataList.append(encode("10"))
dataList.append(encode('--'+boundary+'--'))
dataList.append(encode(''))
body = b'\r\n'.join(dataList)
payload = body
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxOSIsImp0aSI6ImY3ZjViNzhiYzlhZDc2YjJhMTk4MjVlOWFhMWQ0YzliMzdmNjQ5YmRhMGEyZmM4OGEzZjhkYTY2MTJhMjQ3ZDRjMDViMzRjMjY4MjAxMGY5IiwiaWF0IjoxNjk1MjA2NDU0LjM3MjQsIm5iZiI6MTY5NTIwNjQ1NC4zNzI0LCJleHAiOjE2OTUyMTM2NTQuMzY2NSwic3ViIjoiNiIsInNjb3BlcyI6W119.otOMxuU0RewNj62dARGmnlQ41lDQkVwJPHUMXpHoXQGqlX1PiAx4_U90COJrGWc4g4m5uT_9rI1ts21AGDdPaPjegFPf0ivBqp1aUir2vukwa5p0HmOYOTojakBGPBwmOtpaiJlqKWapMaAVk2e4ZEFKPHBoD2i2PFRYXYstLlef4zMcPORVUE1B-0TN-w7iBF1SS3p0qwiIAdVSkRXvgvMIHb6bvEi47kS50Vtgb2w-AP5kKgxMxeAH28CfRK1i0Cbq-cNsxaAZq14b1zQmecC3QSr2mAdEzPM61f6wIIq0BRM_8xBft7dOzdn8eTCLzRUDUQ8CHTlKCw4-BfsVgV2gkbgfOzvqpKJJtmGMpwjDCY7CDgMrW22CzptfDqycrAaYCrcssxHtjUxK3u1-jDY9s0AQVL2WqCRwSSYNcHz3Gg7xAjht3BL4gGRG-yp2opcQeCYFMatzWPjYdp3D54KRAf5KAgnluRT80Y_iv8aTe5UleYTEeQIsUarb-SxlH4VlRTBTx_uxi5tAIhKL1X78Y5xayOy6ApLusNUc1nI-9I4NW-_P516YKA39milG65F9aEbyTxyd1VrSIHsZzSc3cEh734_v1Jk-52seb-yaOTIYNwx1BGeXQNzzeqW8xPn2XJpzF7anNPCzrmVgfQi940FUxuiBQcIsAa_DI-8',
'Cookie': 'veparaccpayment_session=7QdLht1NipfGTXLV8YkQhK8L8BaeFYivuCT73DQa',
'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/ccpayment/api/confirmPayment", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Nodejs Örneği
javascript
const axios = require('axios');
const FormData = require('form-data');
let data = new FormData();
data.append('invoice_id', 'invoicee11');
data.append('merchant_key', '$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he');
data.append('status\n', '1');
data.append('hash_key', '5db1c974c2caa81d:4769:xUwwCbzetC5lz55BH5lIhy+yVeeagLFIIGTvLqriLAN60T5DZvmA98AjywiOSF9Ix57uCAg4kRP8IEtGxpfiGBKxoAcHGwlpDU0ieHs__MxE=');
data.append('total', '10');
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://test.vepara.com.tr/ccpayment/api/confirmPayment',
headers: {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxOSIsImp0aSI6ImY3ZjViNzhiYzlhZDc2YjJhMTk4MjVlOWFhMWQ0YzliMzdmNjQ5YmRhMGEyZmM4OGEzZjhkYTY2MTJhMjQ3ZDRjMDViMzRjMjY4MjAxMGY5IiwiaWF0IjoxNjk1MjA2NDU0LjM3MjQsIm5iZiI6MTY5NTIwNjQ1NC4zNzI0LCJleHAiOjE2OTUyMTM2NTQuMzY2NSwic3ViIjoiNiIsInNjb3BlcyI6W119.otOMxuU0RewNj62dARGmnlQ41lDQkVwJPHUMXpHoXQGqlX1PiAx4_U90COJrGWc4g4m5uT_9rI1ts21AGDdPaPjegFPf0ivBqp1aUir2vukwa5p0HmOYOTojakBGPBwmOtpaiJlqKWapMaAVk2e4ZEFKPHBoD2i2PFRYXYstLlef4zMcPORVUE1B-0TN-w7iBF1SS3p0qwiIAdVSkRXvgvMIHb6bvEi47kS50Vtgb2w-AP5kKgxMxeAH28CfRK1i0Cbq-cNsxaAZq14b1zQmecC3QSr2mAdEzPM61f6wIIq0BRM_8xBft7dOzdn8eTCLzRUDUQ8CHTlKCw4-BfsVgV2gkbgfOzvqpKJJtmGMpwjDCY7CDgMrW22CzptfDqycrAaYCrcssxHtjUxK3u1-jDY9s0AQVL2WqCRwSSYNcHz3Gg7xAjht3BL4gGRG-yp2opcQeCYFMatzWPjYdp3D54KRAf5KAgnluRT80Y_iv8aTe5UleYTEeQIsUarb-SxlH4VlRTBTx_uxi5tAIhKL1X78Y5xayOy6ApLusNUc1nI-9I4NW-_P516YKA39milG65F9aEbyTxyd1VrSIHsZzSc3cEh734_v1Jk-52seb-yaOTIYNwx1BGeXQNzzeqW8xPn2XJpzF7anNPCzrmVgfQi940FUxuiBQcIsAa_DI-8',
'Cookie': 'veparaccpayment_session=7QdLht1NipfGTXLV8YkQhK8L8BaeFYivuCT73DQa',
...data.getHeaders()
},
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/confirmPayment");
request.Headers.Add("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxOSIsImp0aSI6ImY3ZjViNzhiYzlhZDc2YjJhMTk4MjVlOWFhMWQ0YzliMzdmNjQ5YmRhMGEyZmM4OGEzZjhkYTY2MTJhMjQ3ZDRjMDViMzRjMjY4MjAxMGY5IiwiaWF0IjoxNjk1MjA2NDU0LjM3MjQsIm5iZiI6MTY5NTIwNjQ1NC4zNzI0LCJleHAiOjE2OTUyMTM2NTQuMzY2NSwic3ViIjoiNiIsInNjb3BlcyI6W119.otOMxuU0RewNj62dARGmnlQ41lDQkVwJPHUMXpHoXQGqlX1PiAx4_U90COJrGWc4g4m5uT_9rI1ts21AGDdPaPjegFPf0ivBqp1aUir2vukwa5p0HmOYOTojakBGPBwmOtpaiJlqKWapMaAVk2e4ZEFKPHBoD2i2PFRYXYstLlef4zMcPORVUE1B-0TN-w7iBF1SS3p0qwiIAdVSkRXvgvMIHb6bvEi47kS50Vtgb2w-AP5kKgxMxeAH28CfRK1i0Cbq-cNsxaAZq14b1zQmecC3QSr2mAdEzPM61f6wIIq0BRM_8xBft7dOzdn8eTCLzRUDUQ8CHTlKCw4-BfsVgV2gkbgfOzvqpKJJtmGMpwjDCY7CDgMrW22CzptfDqycrAaYCrcssxHtjUxK3u1-jDY9s0AQVL2WqCRwSSYNcHz3Gg7xAjht3BL4gGRG-yp2opcQeCYFMatzWPjYdp3D54KRAf5KAgnluRT80Y_iv8aTe5UleYTEeQIsUarb-SxlH4VlRTBTx_uxi5tAIhKL1X78Y5xayOy6ApLusNUc1nI-9I4NW-_P516YKA39milG65F9aEbyTxyd1VrSIHsZzSc3cEh734_v1Jk-52seb-yaOTIYNwx1BGeXQNzzeqW8xPn2XJpzF7anNPCzrmVgfQi940FUxuiBQcIsAa_DI-8");
request.Headers.Add("Cookie", "veparaccpayment_session=7QdLht1NipfGTXLV8YkQhK8L8BaeFYivuCT73DQa");
var content = new MultipartFormDataContent();
content.Add(new StringContent("invoicee11"), "invoice_id");
content.Add(new StringContent("$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he"), "merchant_key");
content.Add(new StringContent("1"), "status");
content.Add(new StringContent("5db1c974c2caa81d:4769:xUwwCbzetC5lz55BH5lIhy+yVeeagLFIIGTvLqriLAN60T5DZvmA98AjywiOSF9Ix57uCAg4kRP8IEtGxpfiGBKxoAcHGwlpDU0ieHs__MxE="), "hash_key");
content.Add(new StringContent("10"), "total");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());