LNMOnlineAndroidSample
LNMOnlineAndroidSample copied to clipboard
Lipa na mpesa using STK Error
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
You need to provide more details ,like what you have tried first
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
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 use the Lipa Na Mpesa Online Shortcode and the Lipa Na MPESA Online passkey
Thanks @kisese, i will try it out
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 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 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 how did you get yours sorted? I still can't get past that error.
@weddingjuma how did you manage to go about solving this { "requestId": "1494-250373-3", "errorCode": "500.001.1001", "errorMessage": "[MerchantValidate] - Wrong credentials" }
Hello guys. Am using test details. My project does not show on successful payment dialog. What could be the problem.
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.
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 .
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 .
Check it out here https://www.youtube.com/watch?v=_04nuPavXUU&lc=z23xvn0hiyv4x1n4i04t1aokgxh4os2y5mgsuf1weibhrk0h00410.1533472313830777
make sure you are using ssl, the url has to be on ssl otherwise you will always get errors
@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" }
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
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
@Nellyazx Kindly share(if ur willing) a sample of your working stk_push_request
'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; ?>
Remember to change your Bearer Access Token
Thanks @Nellyazx it worked,really appreciate.....b blessed
Welcome...I had the same problem too...Took me two weeks..
weh! been scratching ma head for dayz... was aging fast
Shared Knowledge is better than Hoarded information
HI, am planning to do a proper video of this https://www.youtube.com/watch?v=_04nuPavXUU&list=UUV4FsD2gBl4m9D0l-lF9o6Q&index=4
@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.
@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.
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"}]}}}