annastacia-dev / daraja-test Goto Github PK
View Code? Open in Web Editor NEWImplementing m-pesa stk push and query
Implementing m-pesa stk push and query
set up github workflow
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.
Integrate more endpoints offered by daraja API
Add views (where applicable for these)
Current Integrations
Refactor code - readability, structure (DRY code, have concerns)
set up rubocop for linting and fix the errors
Develop a UI view to make stk push, should have an input for phone number and amount and button that will send the request.
Show alert for request status
Get a shortcode from Mpesa
Set up web hooks
Write a going live tutorial & add it to the README.md
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.