【问题标题】:Paytm Payment gateway, system error in initate transaction mode phpPaytm支付网关,启动交易模式php中的系统错误
【发布时间】:2020-12-19 05:22:04
【问题描述】:

我正在 php 中集成 paytm 支付网关。 我正在正确传递所有必需的参数以生成校验和代码, 打卷曲后,我收到一个系统错误问题作为响应。 我们已尝试就此联系付款,但他们对此问题没有太多回应,所以我一个人。

下面我提到了我的代码,如果有人以前遇到过这个问题,请帮我解决这个问题

校验码:

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":"系统错误"}}}

【问题讨论】:

  • 你终于让它工作了吗
  • 是的,在生成校验和时发现问题,我与 Paytm 团队验证,在生成校验和时在变量中添加引号后发现引号中的问题。成功了

标签: php paytm


【解决方案1】:

我的 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);```

【讨论】:

    猜你喜欢
    • 2022-06-19
    • 1970-01-01
    • 2018-08-22
    • 1970-01-01
    • 2022-07-18
    • 2020-01-29
    • 2016-01-27
    • 2019-11-24
    • 2013-11-02
    相关资源
    最近更新 更多