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 ?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communityI'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 ?
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.
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