<p>我正在尝试集成 JazzCash Gateway V2,并希望进行直接支付交易,文档将其定义为“这是授权付款并将资金从付款人帐户转移到商家帐户的单笔交易。”</p >
<p>以下是我的哈希函数</p>
<pre class="brush:php;toolbar:false;">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;
}</pre>
<p>我已经匹配了我的哈希值,它与文档推荐的 HashCalculator 计算的哈希值相同。https://github.com/aliabidzaidi/HashCalculator
<p>我正在使用以下网址:</p>
$post_url = "https://sandbox.jazzcash.com.pk/ApplicationAPI/API/Purchase/PAY";
;
<p>我的吞吐量如下所示:</p>
$data_array = array(
“pp_IsRegisteredCustomer”=> “是”,
“pp_ShouldTokenizeCardNumber”=> “是”,
“pp_CustomerID”=> “25352”,
“pp_CustomerEmail”=> “abc@abc.com”,
“pp_CustomerMobile”=> “03331234567”,
“pp_Version”=> “2.0”,
“pp_TxnType”=> “支付”,
“pp_TxnRefNo”=> "T".date('YmdHisu'),
“pp_MerchantID”=> “我的商家ID”,
“pp_密码”=> “我的密码”,
“pp_Amount”=> “20000”,
“pp_TxnCurrency”=> “PKR”,
“pp_TxnDateTime”=>日期('YmdHis'),
“pp_TxnExpiryDateTime”=> date('YmdHis',strtotime("+1 小时")),
“pp_BillReference”=> “账单参考”,
“pp_描述”=> “交易描述”,
“pp_CustomerCardNumber”=> “512345000000008”,
“pp_CustomerCardCVV”=> “100”,
“pp_CustomerCardExpiry”=> “01/39”,
“pp_SecureHash”=> “”,
“pp_DiscountedAmount”=> ””,
“pp_DiscountBank”=> ””,
“pp_UsageMode”=> “API”
);</前>
<p>当我运行curl时,我得到以下输出:</p>
{"responseCode":"110","responseMessage":"请为 pp_ Txn Ref No. 提供有效值"," “status”:null,“pp_RetreivalReferenceNo”:null,“secureHash”:“9DE9F8E571F29CBD1316DFB2F0388E3FBE1CA9BC26FB9C284DF900DCCBA0C301”}
<p>接下来我可以尝试什么?</p>
可能是因为pp_TxnDateTime和pp_TxnRefNo的日期格式改变了
在您的数组中,
"pp_TxnRefNo"=> "T".date('YmdHisu')
和"pp_TxnDateTime"=> date('YmdHis')
确保格式相同,因此,更改以下内容:
"pp_TxnRefNo"=> "T".date('YmdHisu')
进入"pp_TxnRefNo"=> "T".date('YmdHis')
希望它能起作用。