Skip to content

Easily accept Cryptocurrency payments in your Ruby app today!

License

Notifications You must be signed in to change notification settings

beneggett/coin_payments

Repository files navigation

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:

  1. Utilizing the API to manage payments & accounts
  2. 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.

About

Easily accept Cryptocurrency payments in your Ruby app today!

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published