Accepting Bitcoin — Do you need a payment gateway ?
So you created a bitcoin wallet, did a few transactions and are loving the cryptocurrency memes and financial freedom. Surely its time now…
So you created a bitcoin wallet, did a few transactions and are loving the cryptocurrency memes and financial freedom. Surely its time now to accept bitcoin payments on your online store!
Do you really need a bitcoin payment gateway? How about a bitcoin payment processor? Isn’t having a bitcoin address enough? Why use a custodial payment gateway for a currency meant to regain monetary control?
While we at Blockonomics offer our own bitcoin payment gateway, it’s not always necessary. Let’s try to build bitcoin payment processing capability step by step from scratch.
Show a bitcoin address with QR Code
This is the simple and the most effective way to receive donations. Users can pay to the given bitcoin address, whatever amount they like.
This looks easy, however the scenario is a bit different for merchants that get orders on online shop. The below question is asked a lot:
Why not just always show my bitcoin address on cart checkout?
The problem is bitcoin transactions can publicly be seen on any blockexplorer. So any customer can claim that he sent bitcoin to you just by quoting a publicly known txid matching the cart value. Also there is a privacy problem - All of your shop payment history is now known to the whole world.
Create unique bitcoin address for each order
To create multiple bitcoin addresses, you don’t need to keep opening your wallet each time. Bitcoin provides HD wallets; so you can create receive payment addresses easily using wallet xpub. Here are the recommended tools for doing this:
- PyCoin Library — Python
- BitWasp / HD-Wallet-Derive — PHP
There is a common concern of creating too many addresses
Would my wallet be able to handle so many addresses, should I recycle them?
Recycling addresses is generally a bad idea. Bitcoin clients are able to handle millions of addresses . Unless you have order volumes of the scale of Amazon, no need to worry about this.
When crypto order volume start picking you would cannot manually verify each order in your wallet / blockexplorer. More automation is required:
- Show exact BTC amount to pay depending on current BTC price
- Auto detect payment and show order confirmation in real time
- Update order status when BTC transactions confirms
For this, you can choose from various open source tools. Some of these require a bit of setup including running a bitcoin node to avoid calls to third party APIs:
- Cashier BTC — Self-hosted Node.js Bitcoin payment gateway. Depends on Nodejs v8+, Bitcoin Core, Couchdb for storage.
- BTCPay Server — Built in C# and conforms to the invoice API of BitPay. Pulls transaction information from its own bitcoin node
- Electrum Merchant — Uses electrum daemon as a watch only wallet to enable merchants to accept bitcoins
If you are using e-commerce platforms like Wordpress / Prestashop, there are plugins available   that integrate easily with your order / checkout flow.
Conversion to Fiat
I need to immediately convert received BTC to fiat
No! Please skip this step!
Be aware that you are virtually contributing nothing to the bitcoin ecosystem if you instantly convert BTC to fiat. However, merchants do need to pay bills and cannot risk holding BTC in bear market. You can convert to fiat/stablecoin by sending funds to your local exchange regularly. For this you can also use a bitcoin payment forwarding service
To summarize, it is not necessary to depend on a payment processor to accept bitcoin. Various open source tools / projects are available according to the complexity of merchant workflow. Cheers to bitcoin adoption!