Commerce BitPay
Integrate Bitcoin as a payment option in Drupal Commerce using BitPay.
BitPay supports conversion and payouts to local currencies and generates a unique receiving address for each invoice.
Features
- Checkout using an embedded iframe or by redirecting to a hosted payment page on bitpay.com
- Payments by computer, tablet, and smartphone
- Identify the Bitcoin checkout method with iconic branding
- Rate limiting on invoice generation to keep a single invoice within BitPay's 15 minute expiration window
- Restrict completion of the checkout process until BitPay confirms payment was received
- Click-to-Pay URI
- Scan-to-Pay QR code
- Copy/paste payment
- No chargebacks
- Receive push notifications with payment and status updates
Requirements
-
BitPay php-client library as a separate download. Copy the php-client files to the libraries directory on the web server:
sites/all/libraries/php-client/bp_lib.php
orsites/{domain}/libraries/php-client/bp_lib.php
. - cURL for PHP - the Commerce BitPay module will check for proper cURL installation and report an error if corrective action is required. cURL is commonly available on standard LAMP-based server installations by default.
Recommended
- Commerce BTC adds Bitcoin as a currency option in Commerce on the currency settings page at admin/commerce/config/currency.
- Run cron at regular intervals. BitPay does not send IPN POSTs to inform Drupal Commerce about expired transactions. Cron is necessary to automatically query the BitPay API to get the status update for expired invoices. It also works as a fallback to update successful transactions in the event BitPay fails to contact your server with IPN information.
Getting setup
- Sign up for a merchant account with BitPay, at https://bitpay.com. Be sure to read all provided information thoroughly; BitPay is a for-profit company and you should understand their fee structure.
- On your BitPay merchant page, provide deposit information. This can be information for your bank account, or a forwarding Bitcoin address, or some mixture thereof (you can set the funds to be converted to different currencies in differing proportions.)
- Create an API key at https://bitpay.com by clicking My Account > API Access Keys > Add New API Key.
- Under Administration > Store Settings > Payment methods, verify that the BitPay module is enabled.
- Edit the actions in the BitPay reaction rule to add an API key and change other settings as desired. The main Drupal status report page on your installation will report a warning and link to the reaction rule configuration page if you fail to set an API key.
- Even though this module loads invoices from the bitpay.com domain, your site must still support HTTPS at https://yourdomain.com/bitpay/ipn for notifications of successful payment to be posted back to update completed carts. This is a requirement of the BitPay API to ensure all transaction information remains confidential.
Payment vs currency conversion
Commerce BitPay is a payment module. It uses the order total and the currency in which it is denominated for requesting an invoice through BitPay. BitPay, as part of displaying an invoice, will request the equivalent amount of BTC based on whatever supported currency type was submitted for the invoice (USD, EUR, BTC, CAD, etc.).
If your shopping cart has items denominated in multiple, different currencies, you should take additional measures, like through installing Commerce Multicurrency, to be sure all line items are converted to the currency of the final, total order price.
See also: #2103933: Support currency by item instead of by order
and #2109113: Support Commerce Multicurrency / BTC as a native currency