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

Undefined index: TXNID #32

Open
punitakathiriya opened this issue Mar 30, 2019 · 22 comments
Open

Undefined index: TXNID #32

punitakathiriya opened this issue Mar 30, 2019 · 22 comments

Comments

@punitakathiriya
Copy link

Could you help me out of this issue Undefined index: TXNID

@anandsiddharth
Copy link
Owner

anandsiddharth commented Mar 30, 2019

You need to describe more about the issue.

How to raise an issue :

  1. Your block of code
  2. Expected output
  3. Attach error screenshots
  4. Laravel & PHP version.

@punitakathiriya
Copy link
Author

image

image

transaction id not getting even i m active my paytm account

image

@anandsiddharth
Copy link
Owner

You are trying to fetch transaction id when the transaction was not successful.

@nikunjswami
Copy link

same issues

@kanu786
Copy link

kanu786 commented Jul 25, 2019

Could you help me out of this issue Undefined index: TXNID

It is because your are sending same order id again and again to paytm.. try changing some unique order id series

@ashu1459
Copy link

ashu1459 commented Oct 9, 2019

Actually this is a real issue. This happens when there is a transaction failure.
The reason for this is that Paytm sends query params as well with POST params when it sends failure response.

Issue_1: Anand\LaravelPaytmWallet\Providers\PaytmWalletProvider->response() checks for $this->request->all() which is wrong because all() picks GET and POST both.
Solution : $this->request->all() should be replaced with $this->request->post()

If its a valid response with failure, response will now be validated with checksum and all the variables will be accessible even though its a failure.

Issue_2: Anand\LaravelPaytmWallet\Traits\HasTransactionStatus reads $this->response['STATUS'] everywhere.
Solution1: It should be $this->response()['STATUS']. Notice the brackets.
The library was calling the property earlier but it should call method.
Solution2: Call $transaction->response(); before doing anything with the response. This will fill $this->response with correct response values.

These 2 solution should fix every callback error received.

@SandeepRana1001
Copy link

Having the Same Issue. Please Solve It. Happening In Both Localhost and live website.
Screenshot (35)

@SandeepRana1001
Copy link

Actually this is a real issue. This happens when there is a transaction failure.
The reason for this is that Paytm sends query params as well with POST params when it sends failure response.

Issue_1: Anand\LaravelPaytmWallet\Providers\PaytmWalletProvider->response() checks for $this->request->all() which is wrong because all() picks GET and POST both.
Solution : $this->request->all() should be replaced with $this->request->post()

If its a valid response with failure, response will now be validated with checksum and all the variables will be accessible even though its a failure.

Issue_2: Anand\LaravelPaytmWallet\Traits\HasTransactionStatus reads $this->response['STATUS'] everywhere.
Solution1: It should be $this->response()['STATUS']. Notice the brackets.
The library was calling the property earlier but it should call method.
Solution2: Call $transaction->response(); before doing anything with the response. This will fill $this->response with correct response values.

These 2 solution should fix every callback error received.

Every Thing Is Fine In Laravel 7 and yet we can see the errors

@SandeepRana1001
Copy link

You are trying to fetch transaction id when the transaction was not successful.

Also The status is Fail and TXNID is null when we do dd($transaction);

@rimsofttech
Copy link

rimsofttech commented Aug 30, 2020

i am getting this error sometimes, any solution for above error ?

@rimsofttech
Copy link

@SandeepRana1001 SandeepRana1001 any solution?

@athar-addweb
Copy link

athar-addweb commented Nov 20, 2020

May be It is because you are sending the same order id again to Paytm, try changing some unique order id series which might help you

@SandeepRana1001
Copy link

SandeepRana1001 commented Nov 20, 2020

Try Using Instamojo or any other payment gateway.

@athar-addweb
Copy link

Try Using Instamojo or any other payment gateway.

Paytm payment gateway works fine

@rimsofttech
Copy link

rimsofttech commented Nov 20, 2020 via email

@athar-addweb
Copy link

It is because you are sending the same order id, again and again, to Paytm.. try changing some unique order id series in your code

@rimsofttech
Copy link

For demo api its working fine, but after using production api its throwing error.. and i have checked i am passing unique id ..is ther anything else can be checked

@athar-addweb
Copy link

please read carefully the Paytm developer documentation payment-gateway. and also activate your business account

@KingOfNoobs
Copy link

I also received this error. In my case the order Id was not unique, as mentioned by @kanu786 . If anyone else has the same case as me, just create a unique Id by concatenating userId & timestamp

$orderId = $user_id . time()

@Rohit599
Copy link

Rohit599 commented Dec 9, 2020

Order Id as well User id should be unique

@anandsiddharth
Copy link
Owner

anandsiddharth commented Dec 10, 2020

@Rohit599 User id need not required to be unique, only the order id should have to be

@KingOfNoobs
Copy link

@anandsiddharth Shouldn't this issue be marked as Close now? As the solution of this issue to pass a unique ORDER_ID for each transaction.

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

No branches or pull requests

10 participants