Check Status Endpoint and http method information are given below for checking transaction status.
Method | URL | Content-Type |
---|---|---|
POST | application/json |
Type | Params | Data Type | Condition |
---|---|---|---|
HEADER | Authorization | string | Mandatory |
HEADER | Accept | string | Mandatory |
KEY | invoice_id | string | Mandatory |
KEY | merchant_key | string | Mandatory |
KEY | hash_key | string | Mandatory |
Authorization is a header key which defines verification that the connection attempt is allowed. The method should be “Bearer”
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlM
GVlZGFiZjdhZDhkODYzYTgyMzQ4Nzk5NTFkYzFlMDZkZTUxYjU0
NWRjYmU3MzRjMmQ1OGNkMWFlOWE4YjliZTkyMjdlZGVmZDdlM
DliIn0.eyJhdWQiOiIxNSIsImp0aSI6ImRlMGVlZGFiZjdhZDhkODYzY
TgyMzQ4Nzk5NTFkYzFlMDZkZTUxYjU0NWRjYmU3MzRjMmQ1OG
NkMWFlOWE4YjliZTkyMjdlZGVmZDdlMDliIiwiaWF0IjoxNTczNzUyND
cyLCJuYmYiOjE1NzM3NTI0NzIsImV4cCI6MTYwNTM3NDg3Miwic3ViI
joiMSIsInNjb3BlcyI6W119.mDtdzcv15p8SnYjZYJUJrhdskO5NohXbkcAx
KWWZ72lNtrg86RZ1yxQwfQlRu6IPoa1rfG3M4jfsNeH
Accept
Accept determines what type of representation is desired at client side. The value should be “application/json”
invoice_id
invoice_id is a unique order id sent by merchant
merchant_key
merchant_key is the unique key of the merchant provided by Paybull.
hash_key
hash_key generation method is given below.
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;
}
{
"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": "Pre-Authorization",
}
{
"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",
}
{
"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",
}