skip to Main Content

I am integrating paytm payment gateway in php.
I am passing all the required parameters properly to generate checksum code,
After hitting the curl, i am getting a system error issue in response.
we have tried to contact payment regarding this, but they are not much responding regarding this issue, So i am on my own.

Below i have mentioned my code, If anyone came across this issue before, Help me out to solve this prob

Checksum Code:

Kp+cPIrrZDweulOb3kEsYxMB4h3fJCtTOuT//bhEeJ3fpxIa1rvb6OfT5icCOkANyR4XCzbwhpaCrLCtGWDf/27BA06dSORyJnbqdAj8FKg=

Serverside code

 $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);

Initiate Transaction Response:
{"head":{"requestId":null,"responseTimestamp":"1607942634809","version":"v1"},"body":{"extraParamsMap":null,"resultInfo":{"resultStatus":"U","resultCode":"00000900","resultMsg":"System error"}}}

3

Answers


  1. my sample.php file which is working fine may you got your problem

    <?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);```
    
    Login or Signup to reply.
  2. In my case i was using old mid, mkey. And didn’t get proper error message. It just showed "System Error". After changing it with the right mid, key it worked.

    Login or Signup to reply.
  3. I also faced this same issue in my node project but after conversion with paytm my problem solved .

    They ask you to give your mid and after that they will reset you mid and it will work again properly

    ——This is response i get from paytm developers—
    The given staging MID-MID has been migrated and should now function as expected. Please retest the transaction after 1 hour.

    Please let us know if you are having any problems so that we can connect with you as soon as possible.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search