4

I'm new to the field, I usually work with Stripe on Rails to get traditional payments. Do you have some advice to get paid with Ether crypto coins on Rails ?

Which online merchant services or Ruby libraries can you suggest ?

2 Answers 2

3

There are a number of payment gateways that work with cryptocoins, bitpay and gocoin being examples I'm aware of. Just googled 'ether payment gateway' and found coinpayments as well.

If you build it yourself you have to run a node, tie your business transaction to an expectation on the blockchain, wait for that expectation to be validated by the number of nodes you feel comfortable with, and then complete the transaction in your ruby app.

1
  • Why would you have to run a full node? Your app just has to be able to generate addresses to get paid.
    – Maros
    Dec 24, 2017 at 19:26
0

You can use a Ruby library in Rails that allows you to manage accounts and query balances. I have recently published the eth gem.

To create an account and get an address:

user_key = Eth::Key.new
# < make your persistent, redundant backup here >
user_key.address.to_s

To check the balance, you can connect to a client:

endpoint = Eth::Client.create "https://example.com:8545"
endpoint.get_balance user_key.address

If you prefer to manage the accounts externally or offline (recommended), you can also just handle the user's payment addresses without any private key information, e.g.:

user_address = Eth::Address.new "0x0c53ffa57ec554451315c2568d22477db8e71356"
endpoint.get_balance user_address

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.