İşlem Durumu

İşlem durumu sorgulaması için endpoint ve http method bilgisi aşağıda verilmiştir.

İSTEK

Method URL İçerik Türü
POST /api/checkstatus application/json


Tip Parametre Data Tipi Şart
HEADER Authorization string Zorunlu
HEADER Accept string Zorunlu
KEY invoice_id string Zorunlu
KEY merchant_key string Zorunlu
KEY hash_key string Zorunlu

Authorization

Authorization bağlantı girişimine izin verildiğini doğrulayan bir başlık anahtarıdır. Method “Bearer” olmalıdır.

Örnek değer:

Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlMG
VlZGFiZjdhZDhkODYzYTgyMzQ4Nzk5NTFkYzFlMDZkZTUxYjU0N
WRjYmU3MzRjMmQ1OGNkMWFlOWE4YjliZTkyMjdlZGVmZDdlMDliI
n0.eyJhdWQiOiIxNSIsImp0aSI6ImRlMGVlZGFiZjdhZDhkODYzYTgyMz
Q4Nzk5NTFkYzFlMDZkZTUxYjU0NWRjYmU3MzRjMmQ1OGNkMWFlO
WE4YjliZTkyMjdlZGVmZDdlMDliIiwiaWF0IjoxNTczNzUyNDcyLCJuYmYiO
jE1NzM3NTI0NzIsImV4cCI6MTYwNTM3NDg3Miwic3ViIjoiMSIsInNjb3BlcyI
6W119.mDtdzcv15p8SnYjZYJUJrhdskO5NohXbkcAxKWWZ72lNtrg86RZ1y
xQwfQlRu6IPoa1rfG3M4jfsNeH

Acceept

Accept ,müşteri tarafında ne tür bir temsilin istendiğini belirler. Değer "application / json" olmalıdır.

invoice_id

invoice_id üye iş yeri tarafından gönderilen benzersiz işlem id'si

merchant_key

merchant_key Sipay tarafından üye iş yerine sağlanan benzersiz üye işyeri anahtarı

hash_key

hash_key oluşturmak için örnek algoritma ;.

function generateRefundHashKey($invoice_id, $merchant_key, $app_secret) {
    $data = $invoice_id.'|'.$merchant_key;
    $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", null, $iv
    );
    $msg_encrypted_bundle = "$iv:$salt:$encrypted";
    $hash_key = str_replace('/', '__', $msg_encrypted_bundle);
    return $hash_key;
}

Başarılı Yanıt:

{
    "status_code": 100,
    "status_description": "An order has been taken place for this invoice id: 33491162435928”,
    "transaction_status": "Completed",
    "order_id": "162435932934307",
    "transaction_id": "SXY0m-o3kb-TC10-98950-220621",
    "message": "An order has been taken place for this invoice id: 33491162435928",
    "reason": "",
    "bank_status_code": "",
    "bank_status_description": "",
    "invoice_id": "33491162435928",
    "total_refunded_amount": 0,
    "product_price": "20.00",
    "transaction_amount": 22.1,
    "ref_number": ""
    "transaction_type": "Auth",
}

Tekrar Eden İşlem İçin Başarılı Yanıt:

{
    "{
    "status_code": 100,
    "status_description": "An order has been taken place for this invoice id: 16014922137077",
    "transaction_status": "Completed",
    "order_id": "16014922157187",
    "transaction_id": "iH8MK-EQe-TC10-98950-300920",
    "message": "An order has been taken place for this invoice id: 16014922137077",
    "reason": "",
    "bank_status_code": "",
    "bank_status_description": "",
    "invoice_id": "16014922137077",
    "total_refunded_amount": 0,
    "product_price": "100.00",
    "transaction_amount": 100,
    "recurring_id": 303,
    "ref_number": "",
    "recurring_plan_code": "1601492241FdsraX",
    "next_action_date": "2021-05-30 03:10:00",
    "recurring_status": "Active",
    "transaction_type": "Auth",
}

Başarısız Yanıt

{
   "status_code": 41,
    "status_description": "Oder Failed",
    "transaction_status": "Failed",
    "order_id": "162435924998223",
    "transaction_id": "6jvQ7-l3kb-TC10-98950-220621",
    "message": "Oder Failed",
    "reason": "Failed # transaction failed",
    "bank_status_code": "Failed # transaction failed",
    "bank_status_description": "transaction failed",
    "invoice_id": "50781624359247",
    "total_refunded_amount": 0,
    "product_price": "20.00",
    "transaction_amount": 21.2,
    "ref_number": "",
    "transaction_type": "PreAuth",
}