Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tsaohucn/onlinepay-api-ruby-client
This is a ruby wrapper about onlinepay
https://github.com/tsaohucn/onlinepay-api-ruby-client
api onlinepay wrapper
Last synced: about 2 months ago
JSON representation
This is a ruby wrapper about onlinepay
- Host: GitHub
- URL: https://github.com/tsaohucn/onlinepay-api-ruby-client
- Owner: tsaohucn
- License: mit
- Created: 2017-03-30T05:50:08.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-31T05:14:25.000Z (almost 8 years ago)
- Last Synced: 2024-10-18T03:09:04.394Z (3 months ago)
- Topics: api, onlinepay, wrapper
- Language: Ruby
- Homepage:
- Size: 10.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Onlinepay-Api-Ruby-Client
Welcome to visit the gem!
The gem is a ruby wrapper about [onlinepay API](https://business.onlinepay.com/docs/?python#introduction)
## InstallationAdd this line to your application's Gemfile:
```ruby
gem 'onlinepay-api-ruby-client', require: 'onlinepay'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install onlinepay-api-ruby-client
Then
`require "stripe"` in your ruby script file## Usage
The library needs to be configured with your account's secret key which is available in [Backoffice](https://core.onlinepay.com/office/auth/login)``` ruby
require "stripe"
Onlinepay.api_key = "api_key"# create a new payment and return a payment object
payment = Onlinepay::Payments.new("Car",50,"CNY")# show detail of the payment
payment.amount #=> 50
payment.currency #=> CNY
payment.processingUrl #=> https:\\...
payment.token #=> payment_token
payment.show #=> The payment detail Hash object {...}# show all payments with given params
Onlinepay::Payments.lists(date_from: "2017-01-01", date_to: "2017-03-01", page: 2, per_page: 50)
#=> All payments Hash object {...}```
## DevelopmentAfter checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/Tsao/onlinepay-api-ruby-client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).