CoinPayments
Fully Implements the CoinPayments API in Ruby.
CoinPayments is an integrated payment gateway for cryptocurrencies such as Bitcoin and Litecoin. There are Over 1040 Supported Coins available. You can accept all 1040 supported coins or just one.
This gem will make it dead simple to work with CoinPayments API set & integrate it into any Ruby Project.
Installation
Add this line to your application's Gemfile:
gem 'coin_payments'
And then execute:
$ bundle
Or install it yourself as:
$ gem install coin_payments
Usage
You'll first need to create a CoinPayments.net account to get started. If you don't have one, please consider creating one through my affiliate link: https://www.coinpayments.net/index.php?ref=1bf1c996fd6781bd4aabec78dda6250c
Or if you don't want to sign up through my link, feel free to sign up at https://www.coinpayments.net
There are many tools for Merchants available. We are going to focus on the API integrations.
There are two sides we'll need to concern ourselves:
- Utilizing the API to manage payments & accounts
- Creating a webhook or Instant Payment Notification (IPN)
Utilizing the API
The only setup needed is to go to the API Keys page and generate an API key. You will be given a private and public key used to authenticate your API calls. Make sure you don't share your private key with any 3rd parties!
Note: You must click 'Edit Permissions' to enable most commands
You will need to set the following environment variables in your app, and the rest will work automatically
COIN_PAYMENTS_PUBLIC_KEY: "your-public-api-key"
COIN_PAYMENTS_PRIVATE_KEY: "your-private-api-key"
Once those are set, you are now ready to utilize the API.
Available features have been implemented per the Features chart below
Features
Implemented APIs from CoinPayments API Docs
API | Docs | Implemented? | Priority |
---|
Informational Commands | | | |
Get Basic Account Info | π | β
| π |
Get Exchange Rates / Supported Coins | π | β
| π |
Get Coin Balances | π | β
| π |
Get Deposit Address | π | β
| π |
Receiving Payments | | | |
Create Transaction | π | β
| π |
Callback Addresses | π | β
| π |
Get TX Info | π | β
| π |
Get TX List | π | β
| π |
Withdrawals/Transfers | | | |
Create Transfer | π | β | π |
Create Withdrawal / Mass Withdrawal | π | β | π |
Convert Coins | π | β | π |
Conversion Limits | π | β | π |
Get Withdrawal History | π | β | π |
Get Withdrawal Info | π | β | π |
Get Conversion Info | π | β | π |
$PayByName | | | |
Get Profile Information | π | β | π |
Get Tag List | π | β | π |
Update Tag Profile | π | β | π |
Claim Tag | π | β | π |
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. 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.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/beneggett/coin_payments. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the CoinPayments projectβs codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.