Payment Gateway Setup (CoinBase Commerce)

Overview
CoinBase Commerce is a payment gateway for blockchain payments. According to their website "It is the easiest and most trusted place to buy, sell, and manage your digital currency". To use this gateway please see below.
Live/Sandbox
At the time of these docs, CoinBase Commerce did not have a sandbox system. Instead they recommend testing the integration with a small amount of cryptocurrency. Each cryptocurrency network typically requires a transaction fee but these are normally negligible.

Live Account:
https://commerce.coinbase.com.
API Setup
1 Log into your CoinBase Commerce account.

2 From the left hand menu click "Settings".

3 Scroll down to "API keys" to generate new API key.

4 Scroll down to "Webhook subscriptions", click to "Add an endpoint" and enter full url to your 'control/callback.php file.

https://www.example.com/coin/control/callback.php

5 Also in the ""Webhook subscriptions" area click "Show shared secret" to reveal WebHook Secret Key.

6 Log in to your Maian Coin control panel and navigate to "Settings > Payment/Currency".

7 On the "General" tab, select "CoinBase Commerce" as the "BitCoin/Blockchain Gateway".

8 On the parameters tab, create parameters with the names of "coinbase-api-key" & "coinbase-webhook-secret" respectively and enter your CoinBase Commerce API key & WebHook Secret Key.


Setup completed. You are now ready to receive/test payments using CoinBase Commerce.
Accepted Statuses
Maian Coin will only update a sale as completed when it receives a response of "charge:confirmed" from CoinBase Commerce. In some cases, there could be a delay before this response is received. If you would like the system to update a sale as completed for other statuses, add them to the 'accepted-statuses' array in the following file:

control/classes/gateways/class.coinbase.php

You should be cautious about this. Only the "charge:confirmed" status confirms the sale on the blockchain and the merchant.

For a list of available statuses see the CoinBase Commerce website.

If you wish to allow sales that are pending (if supported by gateway), see the "Process Pending Payments as Completed" option in the payment settings.
Allowed IP Addresses
Maian Coin will only accept callbacks from valid gateway IP addresses. At the time of these docs, the allowed IP(s) for this gateway are:

54.175.255.192/27

If the IP(s) are updated/changed, update IP addresses in the following file:

control/classes/gateways/class.coinbase.php