问题描述
函数请求(){ $url = "https://test-nbe.gateway.mastercard.com/api/rest/version/58/merchant/{merchant}/session"; $数据 = "apiOperation=CREATE_CHECKOUT_SESSION" 。 “&apiPassword=密码”。 “&apiUsername=merchant.merchantname”。 “&merchant=EGPTEST1”。 "&interaction.operation=AUTHORIZE" 。 "&order.id=2111" 。 “&interaction.returnUrl=http://localhost/NBA%20Payment”。 "&order.amount=92.00" 。 "&order.currency=USD" ;
print_r($data);
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);// this should be set to true in production
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$headers = array();
$headers[] = 'Content-Type:application/x-www-form-urlencoded';
curl_setopt($ch,CURLOPT_HTTPHEADER,$headers);
$responseData = curl_exec($ch);
if(curl_errno($ch)){
echo 'ERROR' . curl_error($ch);
}
curl_close($ch);
print_r($ch);
// json_decode($responseData);
//return $responseData;
} $responseData = request();
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)