我现在工作WordPress molpay定期付款。我的代码在那里。我有一个定期付款文件。所以我还是被那个文件跟踪了。但我不知道如何解决这个问题。请帮帮我。
$c_cost=isset($_REQUEST[\'m_cost\']) ? $_REQUEST[\'m_cost\'] : \'0\';
$c_pay=$_REQUEST[\'payment\'];
$c_name=$_REQUEST[\'m_c_name\'];
$c_num=$_REQUEST[\'m_cred_num\'];
$c_date=$_REQUEST[\'m_exp_date\'];
$c_cvv=$_REQUEST[\'m_c_vv\'];
if(isset($_REQUEST[\'payment\']) and $_REQUEST[\'payment\'] != \'others\')
{
$amount = $wpdb->get_results ( "SELECT * FROM bootsgrid_mol_payment where `id`=".$c_pay);
$molpay_camount=$amount[0]->money;
$c_month = $amount[0]->month;
}
else
{
$molpay_camount=$c_cost;
$c_month = 0;
}
$user_id = get_current_user_id();
$table_name = "bootsgrid_mol_new_paynow";
$wpdb->insert($table_name, array(\'user_id\' =>$user_id, \'cost\' => $c_cost,\'payment\' => $c_pay ,\'credit_name\' =>$c_name,\'creditcard\' =>$c_num,\'ex_date\'=>$c_date,\'cvv\'=>$c_cvv,\'month\'=>$c_month,\'recurring_money\'=>$molpay_camount,\'created\'=>time()));
//order_id
$last_id = $wpdb->insert_id;
//merchant id and verfig key
$bg_set = $wpdb->get_results ( "SELECT * FROM bootsgrid_molpay_setting" );
$c_merchant_id=$bg_set[0]->merchant_id;
$c_api_key=$bg_set[0]->verify_key;
//amount
$cdecimal_amount= number_format((float)$molpay_camount, 2, \'.\', \'\');
//formula
$Checksum = md5(\'T\'.$c_merchant_id.$c_num.$last_id.\'MYR\'.$cdecimal_amount.$c_api_key );
$recurring_array =array(\'T|\'.$c_merchant_id.\'||\'.$c_num.\'|\'.$last_id.\'|MYR|\'.$cdecimal_amount.\'|\'.$Checksum);
$URL ="https://www.onlinepayment.com.my/MOLPay/API/Recurring/input.php";
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST , TRUE );
curl_setopt($ch, CURLOPT_POSTFIELDS , http_build_query($recurring_array));
curl_setopt($ch, CURLOPT_URL , $URL );
curl_setopt($ch, CURLOPT_HEADER , TRUE );
curl_setopt($ch, CURLINFO_HEADER_OUT , TRUE );
curl_setopt($ch, CURLOPT_RETURNTRANSFER , TRUE );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER , FALSE);
$result = curl_exec($ch);
curl_close($ch);
print_r($result);exit;
我得到了回应
HTTP/1.1 200 OK
Date: Sat, 28 Jan 2017 05:01:14 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=dc32c2870dfdd6f7bb177cd46f17be2f11485579673; expires=Sun, 28-Jan-18 05:01:13 GMT; path=/; domain=.onlinepayment.com.my; HttpOnly
Vary: Accept-Encoding,User-Agent
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Cache-Control: max-age=600
Access-Control-Allow-Credentials: true
Server: cloudflare-nginx
CF-RAY: 3281e2a02e832fdb-MAA
[{"status":"failed","orderid":"69","tranID":"","reason":"Invalid token"}]
如何解决此问题。