【发布时间】:2018-06-20 10:00:01
【问题描述】:
我们关注此文档http://www.corvuspay.hr/download/CorvusPay-Integration-and-Message-Protocol.pdf 了解交易状态 [第 33 页]
我们需要获取带有交易状态的卡信息。但我们无法得到它。我们发现了这个错误信息:
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<msg>Missing hash field</msg>
<code>1802</code>
</errors>
这是我们的代码:
$url = "https://testcps.corvus.hr/status";
$cert_file = 'Corvus.crt.pem';
$key_file = 'Corvus.key.pem';
$cert_password = 'PASSWORD_HERE';
$store_id = '5519';
$order_number = 'ORDER_NUMBER_HERE';
$account_id = '627100';
$secret_key = 'SECREAT_CODE_REPLACE_HERE';
$currency_code = 191;
$timestamp = date('YmdHis');
$hash = sha1($secret_key . $order_number . $store_id . $currency_code . $timestamp);
$post_params = array(
'store_id' => urlencode($store_id),
'order_number' => urlencode($order_number),
'account_id' => urlencode($account_id),
'currency_code' => $currency_code,
'timestamp' => $timestamp,
'hash' => urlencode($hash),
);
$post_params_string = '';
foreach ($post_params as $key => $value) {
$post_params_string .= $key . '=' . $value . '&';
}
rtrim($post_params_string, '&');
$ch = curl_init();
$options = array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => $post_params,
CURLOPT_URL => $url,
CURLOPT_SSLCERT => $cert_file,
CURLOPT_SSLKEY => $key_file,
CURLOPT_SSLCERTPASSWD => $cert_password,
CURLOPT_HTTPHEADER => "Content-Type: application/x-www-form-urlencoded",
);
curl_setopt_array($ch, $options);
$output = curl_exec($ch);
if (!$output) {
echo "Curl Error : " . curl_error($ch);
} else {
echo '<pre>' . htmlentities($output) . '</pre>';
}
请帮助我们
【问题讨论】:
标签: transactions payment-gateway