Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load environment configs from database #34

Open
Nickbahson opened this issue Jan 23, 2019 · 8 comments
Open

load environment configs from database #34

Nickbahson opened this issue Jan 23, 2019 · 8 comments

Comments

@Nickbahson
Copy link

Nickbahson commented Jan 23, 2019

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();`

@Davisonpro
Copy link

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

@ngarawakimani
Copy link
Contributor

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.

@Davisonpro
Copy link

Davisonpro commented Feb 9, 2019

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.

@ngarawakimani
Copy link
Contributor

so you guys want to store configs in a database?

@Davisonpro
Copy link

Not necessarily. I think it would be great if you you went with @Nickbahson option

@mossey
Copy link
Contributor

mossey commented Feb 21, 2019

On it guys. I Will add this option

@josiahke
Copy link

the best way is to add a config that can override the default env

@Nickbahson
Copy link
Author

@josiahke , you don't have to override the default .env file unless you have to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants