问题描述
带有 laravel 的 Paytm PHP SDK 在我的本地主机上工作,但是当我从我的 AWS 服务器发出请求时,它显示系统错误。嗯,用我的本地主机服务器测试它,它向我展示了 Paytm 页面。嗯,使用 Paytm 的生产凭证
$paytmParams['body'] =[
'requestType'=>'Payment','mid'=> config('paytm.merchant_id'),'websiteName'=> config('paytm.merchant_website'),'orderId'=> $orderId,'callbackUrl'=> 'https://securegw.paytm.in/theia/paytmCallback?ORDER_ID='.$orderId,'txnAmount' => [
'value'=> number_format($cartData->total,2,'.',''),'currency'=> config('app.currency')
],'userInfo'=>[
'custId' => 'CUST_'.$request->user()->id,'mobile'=> $request->user()->phone_no,],];
$checksum = \paytm\paytmchecksum\PaytmChecksum::generateSignature(json_encode($paytmParams["body"],JSON_UnesCAPED_SLASHES),config('paytm.merchant_key'));
$paytmParams["head"] = [
'signature'=> $checksum,'channelId'=> config('paytm.app_channel')
];
$post_data = json_encode($paytmParams,JSON_UnesCAPED_SLASHES);
$url = "https://securegw.paytm.in/theia/api/v1/initiateTransaction?mid=".config('paytm.merchant_id')."&orderId=".$orderId;
$ch = curl_init();
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$post_data);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
$headers = array();
$headers[] = 'Content-Type: application/json';
curl_setopt($ch,CURLOPT_HTTPHEADER,$headers);
$response = curl_exec($ch);
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)