Coinbase Commerce component installation and settings

Requirements:

  • Joomla 3+
  • Ecommerce component: Virtuemart ou Hikashop
  • Coinbase Commerce account


If you need a Free Coinbase account you can get one from
https://www.coinbase.com/join/52811c7cf16a66a0a3000255 
(this referral link will reward both of us with $10 worth of Bitcoin or Ethereum as soon as your account gets loaded with $100 of crypto)

I. Setting up your Coinbase Commerce account

https://commerce.coinbase.com/dashboard/settings

SETTINGS -> Active cryptocurrencies
Set here what cryptocurrencies you want customers to be able to use to pay you.




SETTINGS -> Whitelisted domains
Add your domain, we added: https://www.nordmograph.com

SETTINGS -> API keys
Create at least one API key, you'll need it in the component options



SETTINGS -> Webhook Subscriptions
- Add an End Point: this is required for Coinbase to let our component know if a payment is failed (expired) or complete: add:
https://www.YOURDOMAIN.COM/index.php?option=com_crypto2points&task=webhook (make sure you set YOUR domain. The exact URL can be found in the component settings)
- Get the Shared Secret and add it to the corresponding field in the component settings.

II. Component installation

  • Download the component from the extension page
  • Install it via the regular Joomla extension installer ( Extensions -> Manage -> Install ). The component installation/update script will detect what e-commerce component is installed and will install relative payment plugin automatically: plg_vmpayment_coinbasecommerce for Virtuemart, plg_hikashoppayment_coinbasecommerce for Hikashop etc...


III. Component options



Coinbase Commerce API Key: This is required, get one from https://commerce.coinbase.com/dashboard/settings

API Version: Leave it as it is, it may evolve in the future following Coinbase commerce API

Webhook URL: You can not edit this, this is just a required information when setting up your Coinbase Commerce account. Copy/Paste it to your Coinbase Commerce account when creating a webhook endpoint. This setting is required to let Coinbase API know where to send payment status confirmations to our application.

V. Create a front-end menu item to the component view: CHARGES to let users access their past or current charges (payments).

In Joomla administration, go to your menu manager, add a new menu Item to the component 'Charges' view. It provides a page to your customers where they can browse their current or past cryptocurrencies payments.


 
VI. Understanding the transaction workflow
After an order gets confirmed by the customer:
1. Coinbase creates a 'charge' object, with the order pricing info. It has, at this point, no payment information.
2. This charge object is stored in the Joomla DB with the 'charge:created' status.
3. The customer is redirected to the Coinbase page where he will have to choose one between the active cryptocurrencies. Payment has to be made within the next 15 minutes.
After these 15minutes, a payment will be detected and if the amount matches, the API will wait for the network transactions confirmations to finally confirm the payment.
4a. The customer makes the transaction successfully, he is redirected to the site, and Coinbase sends a webhook payload to the component that updates the charge status to 'charge:confirmed' which confirms the order.
4b. Payment is not processed. After 15 minutes, Coinbase sends a webhook payload to the component that updates the charge status to 'charge:failed'. Every failed transaction for a user is deleted from the Joomla DB except for the latest one.

Note: if a payment has the insufficient amount or occurs too late, it will still be credited to the shop account, but without confirming the order. It's the show owner to manually decide if the late transaction amount still matches the required amount or if it has to be refunded.

 

VII. Installation and setup of your e-commerce component payment plugin

If your Ecommerce component uses payment plugins they will be installed and updated during Coinbase Commerce component installation or update. They also will be enabled by our script. All you still have to do is to create the Payment method within your E-commerce component (Virtuemart, Hikashop etc...).  You are supposed to know how to create a payment method in your component, but we'll mention here the main points.

- Virtuemart: plg_vmpayment_coinbasecommerce.zip has been installed automatically in the VMPAYMENT plugins folder and published.
All you have to do now is to create a new payment method based on this plugin

- Hikashop: plg_hikashoppayment_coinbasecommerce.zip has been installed automatically in the HIKASHOPPAYMENT plugins folder and published.
All you have to do now is to create a new payment method based on this plugin

  • Created on .
  • Last updated on .
Disclaimer: Nordmograph is not affiliated with or endorsed by The Joomla! Project™. Any products and services provided through this site are not supported or warrantied by The Joomla! Project or Open Source Matters, Inc. Use of the Joomla!® name, symbol, logo and related trademarks is permitted under a limited license granted by Open Source Matters, Inc.
Copyright © 2020 Nordmograph - Joomla extensions. All Rights Reserved.
Joomla! is Free Software released under the GNU General Public License.
Browser of the future