Delete

This method is used to deactivate pf record for a specific merchant. Also every request has to provide unique pf id which can be used later to initiate a payment. If pf id is already registered in the system, the registration procedure will be terminated. The function mentioned below should be used to generate the proper hash to go with the request.

Method URL Content-Type
POST Test: https://provisioning.sipay.com.tr/ccpayment/api/deleteSubMerchantPF application/json
POST Production: https://app.sipay.com.tr/ccpayment/api/deleteSubMerchantPF application/json


Parameters Values Condition
Header/Authorization Bearer/string Mandatory
merchant_key string Mandatory
pf_id digits:5 Mandatory
hash_key string Mandatory


Authorization

Authorization is a header key which defines verification that the connection attempt is allowed. The method should be “Bearer”

hash_key

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

Request

{
    "merchant_key" : "$2y$10$w/ODdbTmfubcbUCUq/ia3OoJFMUmkM1UVNBiIQIuLfUlPmaLUT1he",
    "pf_id": "10295",
    "hash_key":"944357f199c09d70:1481:6ssfvYiTGF2iU3fYFI5F3A=="
}

Fail Response

{
    "status_code": 100,
    "status_description": "Record deleted/inactivated successfully.",
    "data": null
}

Success Response

{
      "status_code": 90,
      "status_description": "Hash key validation error."
  }