anandsiddharth / laravel-paytm-wallet

Integrate paytm wallet in your laravel application easily with this package. This package uses official Paytm PHP SDK's.
MIT License
93 stars 42 forks source link

Paytm Error : OOPS Payment Failed Due To Any Of these Reasons #2

Closed armashfankar closed 7 years ago

armashfankar commented 7 years ago

'paytm-wallet' => [ 'env' => 'local', // values : (local | production) 'merchant_id' => '', 'merchant_key' => '', 'merchant_website' => 'WEB_STAGING', 'channel' => 'WEB', 'industry_type' => 'Retail', ]

paytm secure online payment gateway

anandsiddharth commented 7 years ago

Did you provide merchant id & key in your code as provided by paytm

armashfankar commented 7 years ago

Yes.

anandsiddharth commented 7 years ago

You can set config on the fly even as you wanted to set them up dynamically using this built in laravel function config(['services.paytm-wallet.merchant_id' => 'YOUR_MERCHANT_ID'])

anandsiddharth commented 7 years ago

If you are facing issues with payment gateway, pease paste the snippet of code.

armashfankar commented 7 years ago

public function order() {

    $payment = PaytmWallet::with('receive');
    $payment->prepare([
      'order' => '1',
      'user' => '1',
      'mobile_number' => '9967031001',
      'email' => 'armashfankar@gmail.com',
      'amount' => '20',
      'callback_url' => 'http://slncn.com/callback'
    ]);
    return $payment->receive();
}

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

    $response = $transaction->response(); // To get raw response as object'
    dd($response);
    //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
    }

    //get important parameters via public methods
    $transaction->getOrderId(); // Get order id
    $transaction->getTransactionId(); // Get transaction id
} 
anandsiddharth commented 7 years ago

Your code is absolutely correct, you can troubleshoot your code either way:- 1> Try changing the order id. 2> Contact paytm for valid credentials

And also make sure you wrote the config in config/services.php file as mentioned in documentation.

armashfankar commented 7 years ago

i tried by changing order id and it worked. now issue is for callback.

i am redirected to paytm. i logged in using demo credentials provided by paytm. i completed transaction but in callback its showing me error.

screenshot from 2017-01-07 13 43 37

anandsiddharth commented 7 years ago

Try contacting paytm regarding the issue. I can't help you with this, Try using production credentials.

golchha21 commented 5 years ago

Nothing is working.