As of the 7.x-1.0-alpha1 release, the Commerce Coinbase module completes the cart and marks the transaction as successful. Since I'm not aware of special handling for confirmations through automated callbacks, I'm thinking there needs to be additional handling.
I'm picturing a configuration option for the rule that maybe defaults to 0 confirmations. At 0, the transaction and the cart go to full success workflows.
Increasing the confirmations to more than 0 would require the site admin to run cron at regular intervals. In that case, a payment callback from Coinbase would complete the cart but leave the transaction in a pending state. The cron would query for coinbase transactions in the pending state and update them to successful when the confirmations threshold is met.
Comments
Comment #1
deekayen commentedI think I’ve got the pending transaction status figured out - just need to code it now. Coinbase differentiates between orders and transactions like Commerce does. The callback for an invoice sends the fact that an order is either completed or canceled, but that only represents the fact that it has seen an attempt from someone to pay from a node on the blockchain.
The order callback also includes a transaction, which I had been ignoring. The transactions in Coinbase from their merchant account management page can be listed by transaction, which show as pending for recent transactions. This matches the status options for the API using /api/v1/transactions, which show as either pending or complete.
Looks like closing this is just a matter of keeping parity between order and transaction for both Drupal and Coinbase.
Comment #2
deekayen commentedI think this is resolved in git.