Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
armashfankar opened this issue Jan 7, 2017 · 9 comments
Closed

Comments

@armashfankar
Copy link

'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
Copy link
Owner

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

@armashfankar
Copy link
Author

Yes.

@anandsiddharth
Copy link
Owner

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
Copy link
Owner

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

@armashfankar
Copy link
Author

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
Copy link
Owner

anandsiddharth commented Jan 7, 2017

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
Copy link
Author

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
Copy link
Owner

anandsiddharth commented Jan 11, 2017

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

@golchha21
Copy link

Nothing is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants