Skip to content

Latest commit

 

History

History
76 lines (49 loc) · 3.5 KB

README.md

File metadata and controls

76 lines (49 loc) · 3.5 KB

WHMCS Coinbase Commerce Gateway Module

Summary

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.

Note

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.

Installation

  1. Visit https://commerce.coinbase.com/ and login or sign-up for a free account.

  2. Generate an API key on the settings page . https://commerce.coinbase.com/dashboard/settings Keep these values super safe.

  3. 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.

  4. Clone or download this project to your local machine or to your webserver.

  5. 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
  1. 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.

  2. Customize your gateway settings with the information we gathered above.

  3. 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 select charge: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!

Minimum Requirements

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

To Do

  • 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.

Updates

  • 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

Tested on

  • 03.2023 whmcs 8.6.1
  • 02.2024 whmcs 8.8.0