İşlem İadesi

Method API Uç Noktası (Endpoint) İçerik-Türü
POST /api/refund application/json

HASH KEY OLUŞTURMA

function generateRefundHashKey($amount, $invoice_id, $merchant_key, $app_secret) {

    $data = $amount.'|'.$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;
}

ÖRNEK KODLAR

{
  "amount" : "10",
  "invoice_id" : "c9fa2586-89f5-4898-a6b6-34554fbe1c89",
  "hash_key": "1al1:47tri3g5nM4Snmc_ri3g_R1NylhHZcj0Zu3EuluVWRq9YMaHo2npFjXr7Nfe04po",
  "app_id": "c3d81ae3cc3011ef10dcefa31a458d65",
  "app_secret": "217071ea9f3f2e9b695d8f0039024e64",
  "merchant_key" :"$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he"
}