LNMOnlineAndroidSample icon indicating copy to clipboard operation
LNMOnlineAndroidSample copied to clipboard

Lipa na mpesa using STK Error

Open weddingjuma opened this issue 7 years ago • 176 comments

why do I get this error, Am testing because I want to move into production { "requestId": "1494-250373-3", "errorCode": "500.001.1001", "errorMessage": "[MerchantValidate] - Wrong credentials" }

same a s this https://developer.safaricom.co.ke/content/merchantvalidate-wrong-credentials-stkpush-simulation

weddingjuma avatar Oct 21 '17 16:10 weddingjuma

You need to provide more details ,like what you have tried first

bdhobare avatar Nov 23 '17 14:11 bdhobare

Hi @weddingjuma basically the shortcode you are using in your request body is not allowed to perform STK push request, there is a test shortcode on the dev portal, however for production you will have to apply for an LNMOnline shortcode

kisese avatar Dec 03 '17 15:12 kisese

Thanks @kisese for your reply, for the test credentials are you referring to Shortcode 1, shortcode 2 or the Lipa Na Mpesa Online Shortcode am reffering to test credentilas on the developers portal

weddingjuma avatar Dec 18 '17 08:12 weddingjuma

@weddingjuma use the Lipa Na Mpesa Online Shortcode and the Lipa Na MPESA Online passkey

kisese avatar Dec 19 '17 13:12 kisese

Thanks @kisese, i will try it out

weddingjuma avatar Dec 20 '17 19:12 weddingjuma

In step 2 using the screen shot (https://github.com/safaricom/LNMOnlineAndroidSample) ie (Add a customers phone number:) is it the Marchant or the Customer who gets this on their phone

weddingjuma avatar Dec 22 '17 09:12 weddingjuma

@weddingjuma Its the merchant who gets this i.e the merchant enters the customers phone number on the app so that the customer gets the STKPush and proceeds to pay. Did you solve the Merchant Validation issue?

dennisoft avatar Dec 23 '17 19:12 dennisoft

@dennisoft Which marchant validation issue? Are you referring to the issue of invalid token? if so I realized some times the safaricom test Short code does not work, so me i normally test in in the night, and most of the time it work

weddingjuma avatar Dec 25 '17 14:12 weddingjuma

@weddingjuma how did you get yours sorted? I still can't get past that error.

kennbuluma avatar Apr 09 '18 11:04 kennbuluma

@weddingjuma how did you manage to go about solving this { "requestId": "1494-250373-3", "errorCode": "500.001.1001", "errorMessage": "[MerchantValidate] - Wrong credentials" }

CossyCossy avatar Apr 19 '18 16:04 CossyCossy

Hello guys. Am using test details. My project does not show on successful payment dialog. What could be the problem.

philodoer avatar May 02 '18 13:05 philodoer

I want my customer to be awarded points on every success payment but don't know how to trigger this action. Where exactly should I put this code.

philodoer avatar May 02 '18 13:05 philodoer

Not yet

On Sun, Aug 5, 2018, 23:30 Madona Syombua [email protected] wrote:

Were this issues resolved? would love to help out :) 👍

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/safaricom/LNMOnlineAndroidSample/issues/8#issuecomment-410545820, or mute the thread https://github.com/notifications/unsubscribe-auth/AlHMLN9AimINziY9s3IP7nk5ngCIJH1hks5uN1XQgaJpZM4QBnmf .

philodoer avatar Aug 05 '18 23:08 philodoer

Okay waiting

On Mon, Aug 6, 2018, 02:38 Madona Syombua [email protected] wrote:

@philodoer https://github.com/philodoer I see, would love to see what the team says. 😊 and also if they accept contributions.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/safaricom/LNMOnlineAndroidSample/issues/8#issuecomment-410556693, or mute the thread https://github.com/notifications/unsubscribe-auth/AlHMLNAlveVUV6f-1zgmJdy3-tNWkn1hks5uN4HkgaJpZM4QBnmf .

philodoer avatar Aug 06 '18 00:08 philodoer

Check it out here https://www.youtube.com/watch?v=_04nuPavXUU&lc=z23xvn0hiyv4x1n4i04t1aokgxh4os2y5mgsuf1weibhrk0h00410.1533472313830777

weddingjuma avatar Aug 06 '18 21:08 weddingjuma

make sure you are using ssl, the url has to be on ssl otherwise you will always get errors

weddingjuma avatar Aug 06 '18 21:08 weddingjuma

@weddingjuma Did you manage to sort your error? Also getting the same on Daraja 👍 { "requestId": "11274-4828039-1", "errorCode": "500.001.1001", "errorMessage": "[MerchantValidate] - Wrong credentials" } but on web passing the same data I a different error Note ,amount passed is 100:

{ "requestId":"18519-4869397-1", "errorCode": "400.002.02", "errorMessage": "Bad Request - Invalid Amount" } { "requestId":"18519-4869397-1", "errorCode": "400.002.02", "errorMessage": "Bad Request - Invalid Amount" }

ruddy12 avatar Aug 14 '18 05:08 ruddy12

I used to get te same Errors, replace your whole code with what safaricom has given on the developers portal, then use the test credentials

Nellyazx avatar Aug 14 '18 06:08 Nellyazx

Hi @Nellyazx

I took the curl they have provided and passed the test credentials they have, also encodedbase64.encode(Shortcode+Passkey+Timestamp) but getting the same issue.

Also Daraja is geving a different error from web though I pass the test credentials with the same token

ruddy12 avatar Aug 14 '18 06:08 ruddy12

@Nellyazx Kindly share(if ur willing) a sample of your working stk_push_request

ruddy12 avatar Aug 14 '18 06:08 ruddy12

'174379', 'Password' => 'MTc0Mzc5YmZiMjc5ZjlhYTliZGJjZjE1OGU5N2RkNzFhNDY3Y2QyZTBjODkzMDU5YjEwZjc4ZTZiNzJhZGExZWQyYzkxOTIwMTgwODE0MDg1NjIw', 'Timestamp' => '20180814085620', 'TransactionType' => 'CustomerPayBillOnline', 'Amount' => '10', 'PartyA' => '254701121217', 'PartyB' => '174379', 'PhoneNumber' => '254701121217', 'CallBackURL' => 'https://agizapap.com/rideNeibaResponse', 'AccountReference' => 'Debt', 'TransactionDesc' => 'Pay Now' ); $data_string = json_encode($curl_post_data); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string); $curl_response = curl_exec($curl); //print_r($curl_response); echo $curl_response; ?>

Nellyazx avatar Aug 14 '18 06:08 Nellyazx

Remember to change your Bearer Access Token

Nellyazx avatar Aug 14 '18 06:08 Nellyazx

Thanks @Nellyazx it worked,really appreciate.....b blessed

ruddy12 avatar Aug 14 '18 06:08 ruddy12

Welcome...I had the same problem too...Took me two weeks..

Nellyazx avatar Aug 14 '18 06:08 Nellyazx

weh! been scratching ma head for dayz... was aging fast funny-aging-saying

ruddy12 avatar Aug 14 '18 06:08 ruddy12

Shared Knowledge is better than Hoarded information

Nellyazx avatar Aug 14 '18 06:08 Nellyazx

HI, am planning to do a proper video of this https://www.youtube.com/watch?v=_04nuPavXUU&list=UUV4FsD2gBl4m9D0l-lF9o6Q&index=4

weddingjuma avatar Aug 18 '18 16:08 weddingjuma

@philodoer I see, would love to see what the team says. and also if they accept contributions.

I think giving discounts is better to points.

onyashed avatar Sep 21 '18 17:09 onyashed

@philodoer the reason I am suggesting this. is from the bitcoin story. On 22 May 2010, Laszlo Hanyecz made the first real-world transaction by buying two pizzas in Jacksonville, Florida for 10,000Bit Coins approx $30. Today that is worth 100million USD. Let us pull guys to online transactions because hakuna kanjo hapa.

onyashed avatar Sep 21 '18 17:09 onyashed

Im trying a B2B online transaction with this body segment: 'CommandID' => 'BusinessTransferFromMMFToUtility', 'SenderIdentifierType' => '4', 'RecieverIdentifierType' => '4', 'Amount' => '2319101', 'PartyA' => '601322', 'PartyB' => '601322', 'AccountReference' => 'b201', The error result is shown below. The reverse works. From utility to MMF. What is this rule they are talking about..."Limit rule" {"Result":{"ResultType":0,"ResultCode":2,"ResultDesc":"Declined due to limit rule: less than the minimum transaction amount.","OriginatorConversationID":"25162-171379-1","ConversationID":"AG_20180921_000065cf2b24777821af","TransactionID":"MIL31H6SD3","ResultParameters":{"ResultParameter":{"Key":"DebitAccountCurrentBalance","Value":"{Amount={CurrencyCode=KES, MinimumAmount=2319100, BasicAmount=23191.00}}"}},"ReferenceData":{"ReferenceItem":[{"Key":"QueueTimeoutURL","Value":"https://internalsandbox.safaricom.co.ke/mpesa/b2bresults/v1/submit"},{"Key":"Occassion"}]}}}

onyashed avatar Sep 21 '18 17:09 onyashed