Open Nickbahson opened 5 years ago
I second you on this. They should just do away with the .env file. I have to edit their repository before i use it. Please work on this
I second you on this. They should just do away with the .env file. I have to edit their repository before i use it. Please work on this
why do you have to edit the repo? just create a .env file and paste your mpesa configs there.
I agree with that. The problem comes when you have to explain this to a client who wants things done and he/she understands nothing about accessing and editing files on a server. It would be better if I just add a section to edit the configuration on their website and for Mpesa SDK to pull the configuration from the database. And using the env method will not support that
It's a design practice for sdks.
so you guys want to store configs in a database?
Not necessarily. I think it would be great if you you went with @Nickbahson option
On it guys. I Will add this option
the best way is to add a config that can override the default env
@josiahke , you don't have to override the default .env file unless you have to.
Would be great if there was a way to set the environment configs on every request, like load the required values from a database before calling e.g. like //Example `$mpesa->setConfigs( [ MPESA_CONSUMER_KEY= [consumer key] MPESA_CONSUMER_SECRET=[consumer secret] MPESA_ENV=[live or sandbox] ]; );
$mpesa->STKPushSimulation();`