bajratech / khalti-ruby Goto Github PK
View Code? Open in Web Editor NEWWelcome to the khalti ruby gem. It is an API wrapper for Khalti payment gateway.
Home Page: https://docs.khalti.com
License: MIT License
Welcome to the khalti ruby gem. It is an API wrapper for Khalti payment gateway.
Home Page: https://docs.khalti.com
License: MIT License
The token should not be nil or empty.
The amount should be an integer greater than 0.
https://www.reddit.com/r/ruby/comments/88jvt9/my_first_contribution_to_the_open_source_ruby_gem/
Most importantly: don't copy code unless you understand what is does.
Read the documentation for Net::HTTP. You're not closing your file descriptors. A long running process may runout of them and error.
JSON.parse(request.body) || {}. Under what circumstances will {} be returned?
Check HTTP response content type before parsing is as JSON. What if HTML is returned?
You should move the request/response lines into get(path), post(path, params) methods.
Create an exception class (or several), catch the various exceptions that can be raised by your HTTP and JSON code, and raise a meaningful exception using your class.
No need to use interpolation when the variable is already a String.
The Travis badge in README.md
refers to https://travis-ci.org/degendra/khalti-ruby (repository https://github.com/degendra/khalti-ruby) and not the proper repository here https://github.com/bajratech/khalti-ruby
Update readme to answer the following questions.
Create an exception class (or several), catch the various exceptions that can be raised by your HTTP and JSON code, and raise a meaningful exception using your class.
Instead of exporting KHALTI_SECRET_KEY
, maybe we can create a class to instantiate a khalti object using a KHALTI_SECRET_KEY
as a constructor to support multiple khalti accounts.
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.