【问题标题】:Undefined index: TXNID in Paytm payment getway未定义索引:Paytm 支付网关中的 TXN ID
【发布时间】:2021-03-03 14:41:45
【问题描述】:

这是控制器文件,我在控制器中创建了两个函数并路由 web.php 尝试 paytm 支付网关集成显示错误 - 未定义索引:Paytm 支付网关中的 TXNID? 公共函数 pay() {

    $payment = PaytmWallet::with('receive');

    $payment->prepare([
      'order' => 25, // your order id staken from cart
      'user' => 'Cust_id_12', // your user id
      'mobile_number' => 7277407765, // your customer mobile no
      'email' => 'abx@gmail.com', // your user email address
      'amount' => 200.00, // amount will be paid in INR.
      'callback_url' => 'http://172.18.0.4:8006/payment/status' // callback URL
    ]);
    
    return $payment->receive();
}


/**
 * Obtain the payment information.
 *
 * @return Object
 */
public function paymentCallback()
{   
    $transaction = PaytmWallet::with('receive');
    // dd($transaction);
    $response = $transaction->response();
    // dd($response);
    // To get raw response as array
    //Check out response parameters sent by paytm here -> http://paywithpaytm.com/developer/paytm_api_doc?target=interpreting-response-sent-by-paytm
    
    if($transaction->isSuccessful()){

    }else if($transaction->isFailed()){
      //Transaction Failed
    }else if($transaction->isOpen()){
      //Transaction Open/Processing
    }
    $transaction->getResponseMessage(); //Get Response Message If Available
    //get important parameters via public methods
    $transaction->getOrderId(); // Get order id

    $transaction->getTransactionId(); // Get transaction id
}

【问题讨论】:

    标签: javascript php laravel payment-gateway


    【解决方案1】:

    可能是因为您再次向 paytm 发送相同的订单 ID,请尝试更改一些独特的订单 ID 系列,这可能会对您有所帮助

    【讨论】:

      猜你喜欢
      • 2022-07-18
      • 2022-06-19
      • 2020-01-29
      • 2016-01-27
      • 2019-11-24
      • 2014-08-05
      • 1970-01-01
      • 2020-09-03
      • 2018-08-15
      相关资源
      最近更新 更多