https://github.com/fastruby/bitpagos
Ruby wrapper for the Bitpagos payment processing API
https://github.com/fastruby/bitpagos
Last synced: 10 months ago
JSON representation
Ruby wrapper for the Bitpagos payment processing API
- Host: GitHub
- URL: https://github.com/fastruby/bitpagos
- Owner: fastruby
- License: mit
- Created: 2015-12-24T12:45:53.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-22T20:29:27.000Z (almost 10 years ago)
- Last Synced: 2025-02-01T07:42:52.687Z (11 months ago)
- Language: Ruby
- Size: 45.9 KB
- Stars: 3
- Watchers: 13
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bitpagos API
Ruby wrapper for the [Bitpagos](https://www.bitpagos.com) Payments API
[](http://badge.fury.io/rb/bitpagos)
[](https://travis-ci.org/ombulabs/bitpagos)
[](https://codeclimate.com/github/ombulabs/bitpagos)
## Getting Started
For command line usage:
```bash
$ gem install bitpagos
```
If you intend to use it within an application, add `gem "bitpagos"` to your
`Gemfile`.
## Usage
After installing the gem, you need to obtain your Bitpagos API key from their
website, in your control panel, [here](https://www.bitpagos.com/api/settings).
Initialize a Bitpagos client by running:
```ruby
your_api_key = "ABCDEFG123456789"
client = Bitpagos::Client.new(your_api_key)
```
To get a transaction by its id:
```ruby
client.get_transaction("12345")
```
To get only the completed or waiting transactions:
```ruby
result = client.completed_transactions
result = client.waiting_transactions
```
You can also use the `#transactions` method like this:
```ruby
result = client.transactions(status: :completed)
result = client.transactions(status: :waiting)
```
Pagination is available by providing limit and offset:
```ruby
result = client.transactions(status: :completed, limit: 20, offset: 60)
```
## Contributing & Development
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Write your feature (and tests)
4. Run tests (`bundle exec rake`)
5. Commit your changes (`git commit -am 'Added some feature'`)
6. Push to the branch (`git push origin my-new-feature`)
7. Create new Pull Request
## Release the Gem
```bash
$ bundle exec rake release
```