Paytm 支付网关,启动交易模式时出现系统错误 php
Paytm Payment gateway, system error in initate transaction mode php
我正在 php 中集成 paytm 支付网关。
我正在正确传递所有必需的参数以生成校验和代码,
击中 curl 后,我收到系统错误响应问题。
我们已经尝试就此联系付款,但他们对此问题的回应不多,所以我只能靠自己了。
下面我提到了我的代码,如果以前有人遇到过这个问题,请帮助我解决这个问题
校验码:
Kp+cPIrrZDweulOb3kEsYxMB4h3fJCtTOut//bhEeJ3fpxIa1rvb6OfT5icCOkANyR4XCzbwhpaCrLCtGWDf/27BA06dSORyJnbqdAj8FKg=
服务器端代码
$encFile = PaytmChecksum::generateSignature($arrInputs,$mid);
$paytmParams["head"] = array(
"signature" => $encFile
);
$post_data = json_encode($paytmParams, JSON_UNESCAPED_SLASHES);
$url = "https://securegw-stage.paytm.in/theia/api/v1/initiateTransaction?mid=$mid&orderId=$transactionId";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
$headers[] = 'X-Redirect-Url: http://localhost/TEWebSite/web/site/paymentresponse';
$response = curl_exec($ch);
发起交易响应:
{"head":{"requestId":null,"responseTimestamp":"1607942634809","version":"v1"},"body":{"extraParamsMap":null,"resultInfo":{"resultStatus":" U","resultCode":"00000900","resultMsg":"系统错误"}}}
我的 sample.php 文件工作正常,你可能遇到问题了
<?php
require_once("PaytmChecksum.php");
$mid = $_POST["mid"];
$orderId = $_POST["orderId"];
$amount = $_POST["amount"];
$userId = $_POST["userId"];
$paytmParams = array();
$paytmParams["body"] = array(
"requestType" => "Payment",
"mid" => $mid,
"websiteName" => "WEBSTAGING",
"orderId" => $orderId,
"callbackUrl" => "https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=$orderId>",
"txnAmount" => array(
"value" => intval($amount),
"currency" => "INR",
),
"userInfo" => array(
"custId" => "userId",
),
);
$checksum = PaytmChecksum::generateSignature(json_encode($paytmParams["body"], JSON_UNESCAPED_SLASHES), "MKMo2%0SvLS_5z4%");
$paytmParams["head"] = array(
"signature" => $checksum
);
$post_data = json_encode($paytmParams, JSON_UNESCAPED_SLASHES);
$url = "https://securegw-stage.paytm.in/theia/api/v1/initiateTransaction?mid=ZpsqDd42488117746297&orderId=$orderId";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
$response = curl_exec($ch);
print_r($response);```
我正在 php 中集成 paytm 支付网关。 我正在正确传递所有必需的参数以生成校验和代码, 击中 curl 后,我收到系统错误响应问题。 我们已经尝试就此联系付款,但他们对此问题的回应不多,所以我只能靠自己了。
下面我提到了我的代码,如果以前有人遇到过这个问题,请帮助我解决这个问题
校验码:
Kp+cPIrrZDweulOb3kEsYxMB4h3fJCtTOut//bhEeJ3fpxIa1rvb6OfT5icCOkANyR4XCzbwhpaCrLCtGWDf/27BA06dSORyJnbqdAj8FKg=
服务器端代码
$encFile = PaytmChecksum::generateSignature($arrInputs,$mid);
$paytmParams["head"] = array(
"signature" => $encFile
);
$post_data = json_encode($paytmParams, JSON_UNESCAPED_SLASHES);
$url = "https://securegw-stage.paytm.in/theia/api/v1/initiateTransaction?mid=$mid&orderId=$transactionId";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
$headers[] = 'X-Redirect-Url: http://localhost/TEWebSite/web/site/paymentresponse';
$response = curl_exec($ch);
发起交易响应: {"head":{"requestId":null,"responseTimestamp":"1607942634809","version":"v1"},"body":{"extraParamsMap":null,"resultInfo":{"resultStatus":" U","resultCode":"00000900","resultMsg":"系统错误"}}}
我的 sample.php 文件工作正常,你可能遇到问题了
<?php
require_once("PaytmChecksum.php");
$mid = $_POST["mid"];
$orderId = $_POST["orderId"];
$amount = $_POST["amount"];
$userId = $_POST["userId"];
$paytmParams = array();
$paytmParams["body"] = array(
"requestType" => "Payment",
"mid" => $mid,
"websiteName" => "WEBSTAGING",
"orderId" => $orderId,
"callbackUrl" => "https://securegw-stage.paytm.in/theia/paytmCallback?ORDER_ID=$orderId>",
"txnAmount" => array(
"value" => intval($amount),
"currency" => "INR",
),
"userInfo" => array(
"custId" => "userId",
),
);
$checksum = PaytmChecksum::generateSignature(json_encode($paytmParams["body"], JSON_UNESCAPED_SLASHES), "MKMo2%0SvLS_5z4%");
$paytmParams["head"] = array(
"signature" => $checksum
);
$post_data = json_encode($paytmParams, JSON_UNESCAPED_SLASHES);
$url = "https://securegw-stage.paytm.in/theia/api/v1/initiateTransaction?mid=ZpsqDd42488117746297&orderId=$orderId";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
$response = curl_exec($ch);
print_r($response);```