anandsiddharth/laravel-paytm-wallet

execute else if($transaction->isFailed()) condition when call paymentCallback() in laravel 7

Closed this issue · 0 comments

public function paymentCallback()
{
$transaction = PaytmWallet::with('receive');

    $response = $transaction->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()){
      //Transaction Successful
    }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
}    

}

at the end else if($transaction->isFailed()) condition is execute every time