Ниже приведена моя хеш-функция
Код: Выделить всё
function get_SecureHash($data_array) {
ksort($data_array);
$str = '';
foreach($data_array as $key => $value) {
if(!empty($value)) {
$str = $str . '&' . $value;
}
}
$str = $saltkey.$str;
$pp_SecureHash = hash_hmac('sha256', $str, $saltkey);
return $pp_SecureHash;
}
Я использую следующий URL:
Код: Выделить всё
$post_url = "https://sandbox.jazzcash.com.pk/ApplicationAPI/API/Purchase/PAY";
Код: Выделить всё
$data_array = array(
"pp_IsRegisteredCustomer"=> "yes",
"pp_ShouldTokenizeCardNumber"=> "yes",
"pp_CustomerID"=> "25352",
"pp_CustomerEmail"=> "abc@abc.com",
"pp_CustomerMobile"=> "03331234567",
"pp_Version"=> "2.0",
"pp_TxnType"=> "MPAY",
"pp_TxnRefNo"=> "T".date('YmdHisu'),
"pp_MerchantID"=> "MYMERCHANTID",
"pp_Password"=> "MYPASSWORD",
"pp_Amount"=> "20000",
"pp_TxnCurrency"=> "PKR",
"pp_TxnDateTime"=> date('YmdHis'),
"pp_TxnExpiryDateTime"=> date('YmdHis',strtotime("+1 hours")),
"pp_BillReference"=> "billRef",
"pp_Description"=> "Description of transaction",
"pp_CustomerCardNumber"=> "512345000000008",
"pp_CustomerCardCVV"=> "100",
"pp_CustomerCardExpiry"=> "01/39",
"pp_SecureHash"=> "",
"pp_DiscountedAmount"=> "",
"pp_DiscountBank"=> "",
"pp_UsageMode"=> "API"
);
Код: Выделить всё
{"responseCode":"110","responseMessage":"Please provide a valid value for pp_ Txn Ref No.","status":null,"pp_RetreivalReferenceNo":null,"secureHash":"9DE9F8E571F29CBD1316DFB2F0388E3FBE1CA9BC26FB9C284DF900DCCBA0C301"}
Подробнее здесь: https://stackoverflow.com/questions/762 ... ntegration
Мобильная версия