Comments (40)
Does the sandbox sometimes for no reason just refuse to push back to one's callback URL? Mine was working and now it seems it does not hit the endpoint at all.
from mpesa-php-sdk.
Hello,
I am having this problem too.
I have been working on an STK push integration on an API currently working on. The STK Push callback has been working well until 26th October 2022 when it just went silent.
What could be the issue?
How can it be solved?
Thanks in advance.
Ogego
from mpesa-php-sdk.
Make sure your call back route is a POST and not GET. Also ensure no CSRF validation as in some frameworks
from mpesa-php-sdk.
Make sure you disable ufw firewall if you are using ubuntu. That work for me .sudo ufw disable
from mpesa-php-sdk.
Hey @nellycheboi12 please make sure that your Callback route is accessible from the internet. Callbacks are sent to applications on the sandbox too.
from mpesa-php-sdk.
You need to use a tool like ngrok to expose your routes to the outside world download it from here https://ngrok.com/ this tool will expose your app on the internet, therefore making it easy for MPesa to hit your callback endpoints properly
from mpesa-php-sdk.
Hello
what we put in under callback url
from mpesa-php-sdk.
Php way have a look at https://3v4l.org/rYfdr
from mpesa-php-sdk.
I have my callback on new cpanel host. Im dumping all request data to text file via global $_REQUEST. Im not receiving anything yet. @weddingjuma @here Kindly advice. Thanks.
from mpesa-php-sdk.
$callbackJSONData=file_get_contents('php://input');
$callbackData=json_decode($callbackJSONData);
$resultCode=$callbackData->Body->stkCallback->ResultCode;
$resultDesc=$callbackData->Body->stkCallback->ResultDesc;
$merchantRequestID=$callbackData->Body->stkCallback->MerchantRequestID;
$checkoutRequestID=$callbackData->Body->stkCallback->CheckoutRequestID;
$amount=$callbackData->stkCallback->Body->CallbackMetadata->Item[0]->Value;
$mpesaReceiptNumber=$callbackData->Body->stkCallback->CallbackMetadata->Item[1]->Value;
$balance=$callbackData->stkCallback->Body->CallbackMetadata->Item[2]->Value;
$b2CUtilityAccountAvailableFunds=$callbackData->Body->stkCallback->CallbackMetadata->Item[3]->Value;
$transactionDate=$callbackData->Body->stkCallback->CallbackMetadata->Item[4]->Value;
$phoneNumber=$callbackData->Body->stkCallback->CallbackMetadata->Item[5]->Value;
$result=[
"resultDesc"=>$resultDesc,
"resultCode"=>$resultCode,
"merchantRequestID"=>$merchantRequestID,
"checkoutRequestID"=>$checkoutRequestID,
"amount"=>$amount,
"mpesaReceiptNumber"=>$mpesaReceiptNumber,
"balance"=>$balance,
"b2CUtilityAccountAvailableFunds"=>$b2CUtilityAccountAvailableFunds,
"transactionDate"=>$transactionDate,
"phoneNumber"=>$phoneNumber
];
return json_encode($result);
try this
from mpesa-php-sdk.
from mpesa-php-sdk.
Your callback url should be accessible from the internet and should also be a https for you to be able to get a response from the safaricom api
from mpesa-php-sdk.
experiencing the same problem
from mpesa-php-sdk.
I am implementing Lipa Na Mpesa STK push and I am not getting response at my callback url after transaction .
kindly Help !
from mpesa-php-sdk.
@kalyangadgil ensure you are using HTTPS for your Callback URL. Sometimes this is the issue. You can use some tunneling software if you are testing on localhost -. I hope that helps
from mpesa-php-sdk.
Yes . I am using HTTPS for my callback URL .
right now I am using their test credentials .
AND in my callback function following is the code :
$yourJsonHere = file_get_contents('php://input');
$rooms = json_decode($yourJsonHere);
var_dump($rooms);
Query :
- Do I need to make my app live to receive response from Lipa na Mpesa at my callback url ?
Thank you !
from mpesa-php-sdk.
@kalyangadgil can you try to dump the contents into a file with
file_put_contents('mpesa_push.txt',json_encode( $yourJsonHere));
Since the async might not happen immediately. Just wild thought then you can check the contents of the file
from mpesa-php-sdk.
i have the same problem call back url not working
from mpesa-php-sdk.
same here, I am getting a successful registration for the Validation and Confirmation URLs but during simulation it does not redirect to the validation URL. Is this a problem with sandbox?
from mpesa-php-sdk.
There has to be a problem with sandbox, i am not receiving any data either. Kindly let us know when any of you find a solution thanks.
from mpesa-php-sdk.
from mpesa-php-sdk.
I am simulating a C2B transaction. The following are the steps I have taken:
- Get auth token.
- Register Callback URLs
- Simulate payment.
All the above are successful.
However the callback URL is not getting any hits. It is not a UFW issue cause another STK callback script running (m-pesa live) is getting hits of the callback.
What could I be missing here?
from mpesa-php-sdk.
Did anyone find a solution to this thread? Not getting the callback data from Mpesa Sandbox. Posting data using the same url path on postman gives data, but the sandbox callback data doesn't appear
from mpesa-php-sdk.
Am getting the same issue yet i have i exposed the url on the internet
from mpesa-php-sdk.
Read in there daraja forum, a number of developers are facing the same issue. I guess they could be having an issue with callbacks in there API
from mpesa-php-sdk.
Am getting the same issue yet i have i exposed the url on the internet
Hello @Gloriahmutungi I have the same issue. Did you find a solution?
from mpesa-php-sdk.
Warning: file_get_contents(D:\xampp\htdocs\login\investpage/mpesa_public_cert.cer): Failed to open stream: No such file or directory in D:\xampp\htdocs\login\investpage\status.php on line 48
Warning: openssl_public_encrypt(): key parameter is not a valid public key in D:\xampp\htdocs\login\investpage\status.php on line 49
Warning: Undefined property: stdClass::$ResponseCode in D:\xampp\htdocs\login\investpage\status.php on line 88
Transaction doesnt exist
kindly help
from mpesa-php-sdk.
Am getting the same issue yet i have i exposed the url on the internet
Hello @Gloriahmutungi I have the same issue. Did you find a solution?
There is just an issue with sandbox callback so i used live credentials for test and the response is coming ..you may test with live credentials you know if the issue is with you code as well
from mpesa-php-sdk.
Am getting the same issue yet i have i exposed the url on the internet
Hello @Gloriahmutungi I have the same issue. Did you find a solution?
There is just an issue with sandbox callback so i used live credentials for test and the response is coming ..you may test with live credentials you know if the issue is with you code as well
Okay. Thanks for replying.
from mpesa-php-sdk.
Hello did anyone find solution to this since I am getting the same problem
from mpesa-php-sdk.
from mpesa-php-sdk.
Hello did anyone find solution to this since I am getting the same problem
Yes i did find a solution, what language are you using?
from mpesa-php-sdk.
inbox me for help, i had the same issue but i found a way around it
…
On Thu, 25 Jan 2024 at 04:58, Anonymous @.> wrote: Hello did anyone find solution to this since I am getting the same problem — Reply to this email directly, view it on GitHub <#17 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWO2NAFLVOD2TUPKSTE5MQ3YQJJHVAVCNFSM4EYQQAMKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJRGAYTMOBQG44Q . You are receiving this because you commented.Message ID: @.>
why dont you just share with the rest . why the inbox tena.
from mpesa-php-sdk.
I can help what language are u using?
from mpesa-php-sdk.
from mpesa-php-sdk.
im using JS(Node js)
…
On Sat, Jan 27, 2024 at 1:13 AM davisbravinprograms < @.> wrote: I can help what language are u using? — Reply to this email directly, view it on GitHub <#17 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH3HNUSJ4FEQBNIIMO2CD6DYQQS7XAVCNFSM4EYQQAMKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJRGI3TMNBQHEZA . You are receiving this because you commented.Message ID: @.>
inbox me in the email, needs some explanations
from mpesa-php-sdk.
i am getting the same issue i am using laravel.
from mpesa-php-sdk.
Well someone can get the result of the test transaction by querying mpesa with the CheckoutRequestID (this is returned in the body of initial sdk ).One can make a post request to https://sandbox.safaricom.co.ke/mpesa/stkpushquery/v1/query.
I found how to query by login->select APIs->click on query button in the M-Pesa Express card.
Hope this helps those in test env but I would suggest one moves to production to avoid the many hustle of dealing with CheckoutRequestIDs
from mpesa-php-sdk.
Yes moving to production solved my issue @samuelmaina
from mpesa-php-sdk.
Yes moving to production solved my issue @samuelmaina
@jameskanyiri you got a real paybill from safaricom or you deployed your app?
from mpesa-php-sdk.
Related Issues (20)
- How to register new urls HOT 2
- documentation is poor HOT 3
- load environment configs from database HOT 8
- Possible typo on:
- function to get data from callback is returning a non object HOT 4
- Using IIS to host the app
- TransactionCallbacks result for c2b has the same value for both key and value HOT 1
- Trying to understand the $SecurtyCredential parameter in AccountBalance API
- AccountBalance API returns "The initiator information is invalid." HOT 9
- Composer autoload path not working: ../vendor/autoload.php HOT 4
- StkPushQuerry- Bad Request - Invalid Timestamp HOT 3
- MPESA API Intergration to a CORE PHP Project HOT 2
- laravel issue on config:cache HOT 3
- No response from callback url HOT 11
- Lina na mpesa: AccountReference is invalid HOT 1
- Security Credential
- Callback value HOT 6
- Error: call to URL https://sandbox.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials failed with status 503, response
- Error: call to URL https://sandbox.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials failed with status 503, response Request unsuccessful. Incapsula incident ID: 173000240624511593-81996337350772249
- failure to get response at my callback php file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mpesa-php-sdk.