osenco / osen-wc-mpesa

WordPress Plugin that extends WooCommerce functionality to integrate MPESA for making payments, remittances, checking account balance, transaction status and reversals.
https://wcmpesa.co.ke
GNU General Public License v3.0
95 stars 92 forks source link

Failed! MPesa Error 404.001.03: Invalid Access Token #10

Closed josmbolomnyoi closed 5 years ago

josmbolomnyoi commented 6 years ago

I am having difficulty on this any help....any help please

maukoese commented 6 years ago

Check your credentials. Make sure they are all correct. The App Consumer Key, The Consumer Secret are what are used to generate the access token. So make sure those are correct.

josmbolomnyoi commented 6 years ago

remember i am using wordpress plugin

josmbolomnyoi commented 6 years ago

i will try start afresh tommorrow thanks

maukoese commented 6 years ago

Yes. In the admin settings - make sure the credentials you are using there are correct. Kindly do not use the ones provided in the plugin. Create your own.

josmbolomnyoi commented 6 years ago

i am changing the Online Pass Key on the admin side

maukoese commented 6 years ago

The online passkey has noting to do with it. It's the consumer secret ans consumer key that need to be changed.

josmbolomnyoi commented 6 years ago

Have tried its been giving me this since dawn to generate token using my Consumer Key and secrete but below is what i'm getting as response so frustrating

HTTP/1.1 200 OK Age: 44922 Connection: keep-alive Content-Encoding: gzip Content-Length: 856 Content-Type: text/html Date: Thu, 04 Oct 2018 08:37:06 GMT Last-Modified: Fri, 07 Sep 2018 19:43:09 GMT Server: Apigee SPA Proxy Set-Cookie: access_token=;Path=/;Expires=Thu Strict-Transport-Security: max-age=31536000 Vary: Accept-Encoding Via: 1.1 780c40460121bc788be5e09e5483f7dd.cloudfront.net (CloudFront) X-Amz-Cf-Id: BHQnexv1KZ789hqJMeu_gzd9korAjpE3jlvasrZqN_HnnRb0oyBmug== X-Cache: Hit from cloudfront X-Frame-Options: DENY <!doctype html>

Apigee
Error: 404
Sorry, the page you're looking for can't be found.
Try checking the URL for errors?
Keep getting this page? Report this to our support team.
maukoese commented 6 years ago

Give me a call on +254204404993 because this is an issue no one else has faced before. The plugin is rather straightforward.

josmbolomnyoi commented 6 years ago
Failed! MPesa Error 404.001.03: Invalid Access Token

i have use my consumer key and consumer secrete then used test online shortcode and still getting the error

maukoese commented 5 years ago

Hey. Did you ever get this resolved?

maukoese commented 5 years ago

Kindly open your own issue for this.

maukoese commented 5 years ago

What shortcodes are you using?

maisondudigital commented 4 years ago

Hi, I have the exact same issue. Even though my Key and secret are correct.

steve-njuguna-k commented 4 years ago

Greetings, I am receiving Failed! MPesa Error 404.001.03: Invalid Access Token, even though my key and secret are correct.

maukoese commented 4 years ago
  1. Make sure you’ve set the correct environment

  2. If you are on sandbox mode, you cannot use live credentials. Similarly, if you are on live mode, you have to use a production app’s credentials, not a sandbox app.

Sent from my iPhone

On Jun 26, 2020, at 00:12, Steve Njuguna K, notifications@github.com wrote:

 Greetings, I am receiving Failed! MPesa Error 404.001.03: Invalid Access Token, even though my key and secret are correct.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

Dismod commented 4 years ago

Failed! MPesa Error 404.001.03: Invalid Access Token I am also getting the same error

maukoese commented 4 years ago

Check your configuration, make sure you’re using the correct credentials.

Sent from my iPhone

On Aug 31, 2020, at 11:20, Dismod notifications@github.com wrote:

 Failed! MPesa Error 404.001.03: Invalid Access Token I am also getting the same error

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

sulley-maker commented 4 years ago

I'm getting this error Failed! MPesa Error 400.002.02: Bad Request - Invalid CallBackURL

maukoese commented 4 years ago

Which version are you using? Please make sure you are using the latest one.

Sent from my iPhone

On Sep 18, 2020, at 19:24, sulley-maker notifications@github.com wrote:

 I'm getting this error Failed! MPesa Error 400.002.02: Bad Request - Invalid CallBackURL

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

sulley-maker commented 4 years ago

I'm using the latest version 1.20.99

On Fri, 18 Sep 2020, 21:16 Mauko Maunde, notifications@github.com wrote:

Which version are you using? Please make sure you are using the latest one.

Sent from my iPhone

On Sep 18, 2020, at 19:24, sulley-maker notifications@github.com wrote:

 I'm getting this error Failed! MPesa Error 400.002.02: Bad Request - Invalid CallBackURL

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/osenco/osen-wc-mpesa/issues/10#issuecomment-695014504, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARBUTMO6B5VD43YJ6PQJPO3SGOPWHANCNFSM4FYXBV2A .

maukoese commented 4 years ago

Please, next time open your own issue, instead of commenting on an old issue which is already closed.

maukoese commented 4 years ago

What is the url of your website? Or rather, which website are you using the plugin on?

sulley-maker commented 4 years ago

I'm using wordpress to create a WooCommerce Localhost xampp

On Fri, 18 Sep 2020, 22:34 Mauko Maunde, notifications@github.com wrote:

What is the url of your website? Or rather, which website are you using the plugin on?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/osenco/osen-wc-mpesa/issues/10#issuecomment-695048593, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARBUTMJHRWRPBRMN36USAU3SGOY4BANCNFSM4FYXBV2A .

maukoese commented 4 years ago

That's the problem. You can't use localhost. The localhost in the url is what is making the callback URL invalid.

My suggestion would be to either use virtual hosts, or upload to an actual domain.

sulley-maker commented 4 years ago

Ow Alright Thank you so much

I'm using local host just for the development but when I'm done with it I'll buy a domain

Thank you sir

On Fri, 18 Sep 2020, 23:20 Mauko Maunde, notifications@github.com wrote:

That's the problem. You can't use localhost. The localhost in the url is what is making the callback URL invalid.

My suggestion would be to either use virtual hosts, or upload to an actual domain.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/osenco/osen-wc-mpesa/issues/10#issuecomment-695067330, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARBUTMJU3CBT64FEZHFFCF3SGO6JPANCNFSM4FYXBV2A .

maukoese commented 4 years ago

See this link on how to use virtual hosts. It helps with pretty URLs and stuff

https://www.cloudways.com/blog/configure-virtual-host-on-windows-10-for-wordpress/

sulley-maker commented 4 years ago

Thank you

On Fri, 18 Sep 2020, 23:32 Mauko Maunde, notifications@github.com wrote:

See this link on how to use virtual hosts. It helps with pretty URLs and stuff

https://www.cloudways.com/blog/configure-virtual-host-on-windows-10-for-wordpress/

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/osenco/osen-wc-mpesa/issues/10#issuecomment-695072504, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARBUTMKG7BJ4QVIT4XZFPRDSGO7WLANCNFSM4FYXBV2A .

sulley-maker commented 4 years ago

Hey osenco Thank you for the plugin It works perfectly I wanted to ask you about sandbox and live I'm getting a "Safaricom-test 12" I want the STK Push to show my organisation's name on the phone

Can you help me with that?

On Fri, 18 Sep 2020, 23:37 Suleiman Ali, allyslayman99@gmail.com wrote:

Thank you

On Fri, 18 Sep 2020, 23:32 Mauko Maunde, notifications@github.com wrote:

See this link on how to use virtual hosts. It helps with pretty URLs and stuff

https://www.cloudways.com/blog/configure-virtual-host-on-windows-10-for-wordpress/

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/osenco/osen-wc-mpesa/issues/10#issuecomment-695072504, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARBUTMKG7BJ4QVIT4XZFPRDSGO7WLANCNFSM4FYXBV2A .

maukoese commented 4 years ago

If you are on sandbox it cannot show your organization name. I can assit with going live for KSh 4000. Hit me up on 0705459494 for more.

ghost commented 3 years ago

im getting this error what could be the issue Failed! MPesa Error 404.001.03: Invalid Access Token

maukoese commented 3 years ago

Please read the conversation in this issue before commenting. Thanks.

ghost commented 3 years ago

STK push was working before but now I tried again I'm getting this message "STK Push didn't work? Pay Manually Via M-PESA"

Baldwinsure commented 2 years ago

Hello am getting this error (MPesa Error) 404.001.03: Invalid Access Token. Despite having the consumer key and secret and they are correct in addition the site is on a live domain and the environment is live and the credentials am using are also of a live app which has been approved please help

MuokaPWambua commented 1 year ago

I had the same problem, the problem was that I was using the whole json response when generating the access key access_token = { "access_token": "dGfvhkcJo5rPcEg2vU", "expires_in": "3599" } instead of using the access_token itself, something like this access_token = response['access_token']

maukoese commented 1 year ago

The issue is not with the code. Cause the plugin is working on hundreds of websites ,

The problem comes up when you use the wrong consumer key/secret, probably because you did not copy all of it or there's space; or forgeting to set the correct environment i.e Production when you are using sandbox credentials or vice versa.

Arlus commented 2 months ago

I contacted Mpesa API support and they solved the issue for me with an action on their end.

maukoese commented 2 months ago

Awesome!

brianmak3 commented 2 months ago

Screenshot 2024-09-06 at 20 47 26 Am getting this same error despite doing the correct configuration and using the correct environment. To be sure, I have another app which I only changed the secret, key and pass_key and it worked fine. But on the new app I registered it does not work.

brianmak3 commented 2 months ago

I got my issue sorted from the APIs support team. Sometimes the issue is not your configuration but from their side.