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

Wrong Credentials error #47

Open
NjiruClinton opened this issue Dec 18, 2022 · 2 comments
Open

Wrong Credentials error #47

NjiruClinton opened this issue Dec 18, 2022 · 2 comments

Comments

@NjiruClinton
Copy link

NjiruClinton commented Dec 18, 2022

I get this response error when I do an stk push using this package

  • I'm trying to initiate a test stk push working with sandbox. My mpesa app in daraja has all three products mapped. I feel something is missing or wrong but cant figure it out.
  • using "express": "^4.18.2" node v14.18.1 and "mpesa-node": "^0.1.3"
data: {
      requestId: '2275-94324073-1',
      errorCode: '500.001.1001',
      errorMessage: 'Wrong credentials'
    }

here's my code:

const lnm = async () => {
    const mpesaApi = new Mpesa({
    consumerKey: 'myconsumerkey',
    consumerSecret: 'myconsumerasecret',
    environment: 'sandbox',
    shortCode: 174379
    })

const testMSISDN = "254720003332"
const amount = 100
const callBackURL = "http://arbaaz.herokuapp.com/log.txt"
const accountRef = "CLINTON"
const transactionDesc = "Test-CLINTON"
const transactionType = "CustomerPayBillOnline"
const shortCode = 174379
const passKey ="MTc0Mzc5YmZiMjc5ZjlhYTliZGJjZjE1OGU5N2RkNzFhNDY3Y2QyZTBjODkzMDU5YjEwZjc4ZTZiNzJhZGExZWQyYzkxOTIwMTkxMjEzMTA1NzEz"


await mpesaApi.lipaNaMpesaOnline(
    testMSISDN, 
    amount, 
    callBackURL,
    accountRef,
    transactionDesc,
    transactionType,
    shortCode,
    passKey
    )
    .then((result) => {
                console.log("result here.. ", result);
            })
            .catch((err) => {
                console.log("error here.. ", err);
            })

}

lnm();

@geofmureithi-zz @Beliot @DGatere @jeffnyauke

@WAMBUGUS
Copy link

WAMBUGUS commented Jan 6, 2023

How can i login mpesa app if my device is rooted

@NjiruClinton
Copy link
Author

NjiruClinton commented Jan 6, 2023 via email

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

2 participants