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

Bug #1

Closed
kefahwambai opened this issue Nov 21, 2023 · 1 comment
Closed

Bug #1

kefahwambai opened this issue Nov 21, 2023 · 1 comment

Comments

@kefahwambai
Copy link

When using postman to make a #stkpush, I have encountered an error (as shown below), so I got into debug mode;

Processing by MpesasController#stkpush as /
  Parameters: {"phoneNumber"=>"2547
******", "amount"=>"1", "mpesa"=>{"phoneNumber"=>"2547********", "amount"=>"1"}}
Consumer Key:
Consumer Secret:
Encoded Userpass: Og==
Request Headers: {:Authorization=>"Bearer Og=="}
Completed 500 Internal Server Error in 15224ms (ActiveRecord: 1.9ms | Allocations: 5450)**

It's quite clear consumer key and consumer secret ,for lack of a better term, 'hazionekani'. Why? You have the following code in your config/application.rb;  
config.before_configuration do
env_file = File.join(Rails.root, 'config', 'local_env.yml')
YAML.load(File.open(env_file)).each do |key, value|
ENV[key.to_s] = value
end if File.exist?(env_file)
end

because of this line env_file = File.join(Rails.root, 'config', 'local_env.yml' consumer key and consumer secret hazionekani, you should move the local_env.yml from root and have it inside the config folder.

@Annastacia-dev
Copy link
Owner

@kefahwambai The local_env.yml file is already located inside the config folder. See this from the README.md Inside the config folder create a file called local_env.yml under Environment Variables

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

2 participants