Comments (4)
I suspect it should be this on line 10 of Mpesa.php
require 'vendor/autoload.php';
from mpesa-php-sdk.
Or possibly something like Carbon.php does?
$dir = __DIR__.'/..';
if (!file_exists($dir.'/autoload.php')) {
$dir = __DIR__.'/../vendor';
}
if (!file_exists($dir.'/autoload.php')) {
$dir = __DIR__.'/../../..';
}
if (!file_exists($dir.'/autoload.php')) {
echo 'Autoload not found.';
exit(1);
}
require $dir.'/autoload.php';
Or ../../autoload.php ?
I'm attempting to use this with Laravel.
from mpesa-php-sdk.
Lia
Or possibly something like Carbon.php does?
$dir = __DIR__.'/..'; if (!file_exists($dir.'/autoload.php')) { $dir = __DIR__.'/../vendor'; } if (!file_exists($dir.'/autoload.php')) { $dir = __DIR__.'/../../..'; } if (!file_exists($dir.'/autoload.php')) { echo 'Autoload not found.'; exit(1); } require $dir.'/autoload.php';
Or ../../autoload.php ?
I'm attempting to use this with Laravel.
I gave up on this MPESA SDK as the developer(s) never replied to my opened bug request. I ended up writing custom PHP code to interact with the API. Please see MPESA API guiding docs here: https://developer.safaricom.co.ke/APIs
I wish you luck and all the best with your integration.
from mpesa-php-sdk.
Thanks @jukwahewa , I will probably be forced to do the same as this is not the only issue I have noticed with this code.
- The way env variables are loaded does not let us cache the config in Laravel.
- Dotenv used in the function similar to laravel, looks like it might not actually load the .env file when used in a Laravel project wrong path?
- self::env should be used put all the conditional checks in it.
- What if json_decode fails in the TransactionCallback methods?
- No confirmation that the response comes from their servers.
- No hash in response/headers to verify the message has not been tampered with.
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
- 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.