1

Currently, I'm looking for a way to start accepting Ethereums on a website.

The following topic encourages usage of smart contracts for keeping a track of all transactions coming to a specific ETH address, with possibility to add a custom order ID for identifying an order in my database: Accepting Ethereum on a website

However, I'm really wondering how should a SmartContract-enabled payment page look like. Is there any way to include the SmartContract code mentioned above in Ethereum payment URL and QR code in the way understandeable by major desktop & mobile clients, or I should take another approach?

1

The most commonly understood way to accept ETH is the standard one in crypto-currency: Publish an address, which can by copy-pasted, plus a QR code which can be scanned with a mobile device. See this question for how to generate a QR code: How do I make a QR code for an ethereum address?

If you want to track payments per order, you have a few options, but unfortunately it's not as easy as it could be. First, you can use the data field of the transaction as a data parameter:

  • If the user has MetaMask installed in their browser, you can write a little bit of JavaScript to prompt MetaMask to throw up a window asking them to confirm a transaction, which will include the appropriate amount and the data you request. However, many users won't have this installed.

  • You can ask users to supply the data manually in the data section of their transaction. But this is inconvenient for them, and they may not know how to do it. There's an Ethereum Improvement Proposal to make a URL that can encode some data, but it's still under discussion and hasn't yet been adopted.

For wider support, you may want to fall back on creating a lot of addresses:

  • Generate the addresses in advance with whatever software you normally use and keep a database of which have been assigned to which orders.

  • Generate the addresses using a Hierarchical Deterministic wallet, where there is one root private key but it is combined with your order ID to create many addresses. See this answer for information on tools to do this in Ethereum: Is there any API for sending and receiving Ethers? Alternatively, if you already have a working system using deterministic addresses for Bitcoin or another crypto-currency, you could use one of those tools to generate private keys then derive Ethereum addresses from them.

  • Finally, if you're comfortable using a third-party service with an API, you should be able to generate Ethereum addresses for payment with them in the same way that you would with Bitcoin etc.

  • How can I make geth generating additional addresses (not accounts) - so that I could still withdraw my funds with a single command, just as in Bitcoin? – vdudouyt Sep 14 '17 at 10:13

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.