gpt4 book ai didi

php - Paytm 支付网关,启动交易模式 php 中的系统错误

转载 作者:行者123 更新时间:2023-12-05 06:55:24 28 4
gpt4 key购买 nike

我正在将 paytm 支付网关集成到 php 中。我正在正确传递所有必需的参数以生成校验和代码,击中 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","re​​sultCode":"00000900","re​​sultMsg":"系统错误"}}}

最佳答案

我的 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 支付网关,启动交易模式 php 中的系统错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65366962/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com