Coinbase integration experiment

When we designed Kill Bill, we always thought of it as a billing platform, rather than simply a subscription billing system. We wanted to make it flexible enough to support much more than simple monthly credit cards payments. We see Kill Bill as your company’s financial toolbox. The ultimate test to validate our architecture was to experiment with a Bitcoin integration. Digital currencies offer a completely different environment compared to traditional payment gateways: the vast majority of concepts don’t apply anymore (e.g. chargebacks) and due to the push nature of transactions, recurring payments are still an open problem. As a proof of concept Kill Bill, we prototyped an integration with Coinbase, allowing customers to pay their subscriptions automatically using their Coinbase wallet (the merchant account being in Coinbase or not). Note that we are simply using Coinbase as a payment gateway, we do not use Coinbase’s recurring payments offering (invoices and payments are driven by Kill Bill). The integration mainly consisted in writing a payment plugin. Similar to, for example, the Stripe or the PayPal plugins, the Coinbase one registers itself at startup. Accounts can then have Coinbase payment methods. When an invoice is generated, an event is posted on the event bus. The payment subsystem will react to it, fetch the default payment method associated with the account, and, if it is of type killbill-coinbase, Kill Bill will delegate the actual payment call to it. A nice feature of the Coinbase API is that it handles currency conversions automatically. Regardless of the default currency on the account (USD, EUR, BTC, …), Kill Bill can simply pass the original amount to Coinbase...