This is a payment gateway module for for the new Coinbase Commerce.
On May 1st, 2018 Coinbase disabled all legacy API and merchant tools, but they released an even better tool to replace it, Coinbase Commerce.
Coinbase Commerce is a simple powerful interface to generate checkouts or charges for your customers without having to pay them any fees and while keeping full control of your private keys.
As of right now Coinbase Commerce is very new and their API is ready for payments but some features are missing. We go over this in the To Do section.
If someone sends a payment under or over what their invoice total is, then the payment will fail. You can still manually add the Payment in WHMCS but the CC API system sends it with the failed result and the user is notifed of this as well. Just like this screenshot. Ideally we wouldn't want this to happen and if anyone has some suggetsion around this please suggest it.
Contributions and requests are very welcome. Simply open an issue with as much detail as possible.
-
Visit https://commerce.coinbase.com/ and login or sign-up for a free account.
-
Generate an API key on the settings page . https://commerce.coinbase.com/dashboard/settings Keep these values super safe.
-
Get your Webhook shared secret from the Webhook subscriptions https://beta.commerce.coinbase.com/settings/notifications section on the same page as above. Keep these values super safe.
-
Clone or download this project to your local machine or to your webserver.
-
Copy the modules directory into your WHMCS root folder. This will place the files in the needed locations. Below is the complete file structure that should be uploaded. Make sure you don't upload any of the files like this readme into your WHMCS installation.
modules/gateways/
|- callback/coinbasecommerce.php
| coinbasecommerce.php
-
Activate the Payment Gateway. To do this visit your Payment Gateways in WHMCS. This is located at : Setup -> Payments -> Payment Gateways. This Module will be called Coinbase Commerce.
-
Customize your gateway settings with the information we gathered above.
-
Update your webhook URL to point to your callback file. Paste the full URI of where your callback file is something like:
https://www.yourwebsite.com/whmcs_root/modules/gateways/callback/coinbasecommerce.php
. So that your logs don't fill up super fast make sure you only selectcharge:confimed
,charge:created
,charge:delayed
,charge:failed
,charge:pending
,charge:resolved
. See the screenshot below for an example of how you should set up your webhook. You should now be set!
We have no additional requirements beyond what WHMCS already needs.
For the latest WHMCS minimum system requirements, please refer to https://docs.whmcs.com/System_Requirements
- Implement a Logo URL as soon as Coinbase gets around to letting us declare it for charge type transactions.
- Implement logic to tell if multiple payments have been made and act accordingly.
- Clean up this super sloppy code, ugh.
- 03.2023 Webhook http 200 ok responce to coinbase (this fix webhook error in coinbase)
- 03.2023 Add payment when
charge:resolved
- 03.2023 Update status of invoice when
charge:pending
- 03.2023 whmcs 8.6.1
- 02.2024 whmcs 8.8.0