Empowering you to understand your world

How To Accept Bitcoin Payments

Written by Nicholas Brown.

You can accept Bitcoin payments easily, and you can do it without a middleman. There are two simple steps to accepting Bitcoin as a payment method without a centralized payment processor or bank:

  1. Create a Bitcoin wallet.
  2. Copy your wallet address and paste it on your donation or payment page. Usually, it is in the form of a ‘copy address’ button or some form of copy icon that looks like two sheets of paper. If not, then select the address and right click copy yourself.

A Bitcoin wallet address looks something like this: bc1qajv8up0208m2pf9tkkmx3ule7vqaffzkfeppxy.

You can use any of the following three options to make it easier for users to pay you with BTC:

  1. Copy and paste the address where it is needed.
  2. Create a QR code and place that where it is needed. Your wallet app may already create a QR code for you, and will let you copy it. Thankfully, Bitcoin Core wallet does all this for you and even provides a ‘Save Image’ option to save your QR code to an image file that you can upload to your website. Alternatively, screenshot the QR code from your wallet app, crop it, and upload it to your website or app.
  3. Create a payment link that will load the user’s wallet app and fill out your address and amount to be paid automatically.

Example payment link: Pay With Bitcoin

The XDG link above is structured as follows:

bitcoin:address to pay to

The demo link above uses the following code:

<a href="bitcoin:bc1qajv8up0208m2pf9tkkmx3ule7vqaffzkfeppxy">Pay With Bitcoin</a>

That link will load a Bitcoin wallet and fill out the address only. The user can then fill out the amount they want to send in the wallet themselves. Now, let us try creating a payment link that fills out your wallet address and the amount automatically. This is useful if the user chooses to click a donation link such as ‘Donate 0.001 BTC’ so they don’t have to fill out anything themselves, or if they are buying something and that is the exact amount due:

Pay 0.001 BTC

The structure of the link above is as follows:
bitcoin:address?amount=quantity

‘amount’ is the parameter for the amount of BTC you want to send (not the dollar amount). Here is the code used above:

<a href="bitcoin:bc1qajv8up0208m2pf9tkkmx3ule7vqaffzkfeppxy?amount=0.001">Pay 0.001 BTC</a>

You can also add a label to the transaction if the user uses Bitcoin Core or other wallets that support that parameter. Just add the following to the end of the link:

&label=description of payment

Example usage for a Bitcoin donation link:

<a href="bitcoin:bc1qajv8up0208m2pf9tkkmx3ule7vqaffzkfeppxy?amount=0.001&label=Donation to charity name">Pay 0.001 BTC</a>

You’ll see the label show up in the description or label field of your wallet if you click it: Donate

Create a Bitcoin Payment Button

If you want to create a Bitcoin donate button, or Bitcoin payment button, you can use the standard HTML button code, but using the same URL structure above.

Here’s an example of a Bitcoin payment button that will fill out the address the user would pay to:

Code:

<form action="bitcoin:bc1qajv8up0208m2pf9tkkmx3ule7vqaffzkfeppxy"><button>Donate</button></form>

You can also use JavaScript to calculate the BTC amount due using a dollar exchange rate to make it easier for users. That way your users can click ‘Pay $5 USD with Bitcoin’ for example, and it will calculate/fill out the BTC amount automatically. This requires an exchange API. Feel free to contact me, as I can set this up for you.

If you want to use a payment processor that converts BTC to dollars automatically, you can use a centralized payment processor such as BitPay that will deposit the money to your bank account. If you’d like to use a payment processor that doesn’t involve a middleman, there is BTCPay.

Leave a Reply

Subscribe to our newsletter
Get notified when new content is published