Commerce BTC

Categories

Component ID

2097929

Component name

Commerce BTC

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

505

Component created

Component changed

Component body

Add Bitcoin as a currency option for Drupal Commerce allowing products, orders, and transactions to be priced in terms of Satoshi.

The entire module is a single function, which hooks the Bitcoin currency characteristics into the Commerce currency options.


function commerce_btc_commerce_currency_info() {
  return array(
    'BTC' => array(
      'code' => 'BTC', // BitPay and Coinbase expect BTC, not XBT for Bitcoin
      'symbol' => 'Ƀ', // the symbol is hardly "standardized" yet
      'name' => t('Bitcoin'),
      'decimals' => 8,
      'major_unit' => t('Bitcoin'),
      'minor_unit' => t('Satoshi'),
      'code_placement' => 'after',
      'symbol_placement' => 'before',
    ),
  );
}