Giter VIP home page Giter VIP logo

mpesa-android-sdk's People

Contributors

bdhobare avatar piusdan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mpesa-android-sdk's Issues

Invalid Access Token

Hello,

When trying to pay up, this Token error always pops up. I have registered the app with Safaricom Developer's portal and it is approved. What could be the problem?
Thanks.

Invalid Access Token

When i click pay i get Invalid Access Token.
My Access token in Daraja Dashboard is active and have not yet expired.

I am using the test details from the dashboard as below
public static final String BUSINESS_SHORT_CODE = "174379"; public static final String PASSKEY = "bfb279f9aa9bdbcf158e97dd71a467cd2e0c893059b10f78e6b72ada1ed2c919";

`private void pay(String phone, int amount){
dialog.show();

    STKPush.Builder builder = new STKPush.Builder(BUSINESS_SHORT_CODE, PASSKEY, amount,BUSINESS_SHORT_CODE, phone);

// SharedPreferences sharedPreferences = getSharedPreferences(SHARED_PREFERENCES, MODE_PRIVATE);
// String token = sharedPreferences.getString("InstanceID", "");

    builder.setFirebaseRegID(FIREBASE_KEY);
    builder.setCallBackURL(CALLBACK_URL);
    STKPush push = builder.build();



    Mpesa.getInstance().pay(this, push);

}`

the OnError method is the one that returns that message.

@Override public void onMpesaError(Pair<Integer, String> result) { Toast.makeText(context,"Auth error: "+result.message,Toast.LENGTH_LONG).show(); dialog.dismiss(); }

What would be causing this Since i am on the sandbox.
And in the code there is no option of inputting the access key generated from daraja dashboard
{ "access_token": "", "expires_in": "3599" }

Getting Invalid Access Token (Result Code : 404)

Hi,

What i'm i doing wrong? I keep on getting the below error when trying to process payment using the below samples.

//passkey, bsnCode2, bsnCode and testNumber sourced from developer.safaricom.co.ke

passKey = "bfb279f9aa9bdbcf158e97dd71a467cd2e0c893059b10f78e6b72ada1ed2c919";

bsnCode2 = "600147";
bsnCode = "174379";

testNumber = "254708374149";

// STKPush.Builder builderPay = new STKPush.Builder(bsnCode2, passKey, amount, bsnCode,testNumber);

//STKPush.Builder builderPay = new STKPush.Builder(bsnCode, passKey, amount, bsnCode, testNumber);

//repeated both steps with personal number instead of testNumber still got the same error

E/mpesaFailed: Invalid Access Token result Code :404

API outdated

I recently found issues with API its giving me a warning that API would be outdated soon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.