Get your API key from Coinbase Commerce
1
Sign in
Open your Coinbase Commerce account.
2
Create an API key
In Settings, create an API key and copy it.
Create the webhook in Coinbase Commerce
1
Open the webhook subscriptions
In Settings, open Webhook subscriptions and add an endpoint.
2
Enter the URL
Use the Webhook URL from the MagicPost Coinbase page:
3
Copy the shared secret
Select Show shared secret and copy it.
Add the key in MagicPost
1
Open the Coinbase card
Go to Admin → Finance → Payment Gateways and click Coinbase. The page is titled Coinbase Settings.
2
Enable it
Under General, turn on Status. The description reads “When enabled, users can use Coinbase for payments”.
3
Paste the API key
Under Keys, paste the key into Coinbase Commerce API Key.
4
Paste the shared secret
Under Webhooks, paste the secret into Webhook Shared Secret.
5
Save
Click Save. You see “Coinbase settings saved successfully.”
How payments work
MagicPost creates a fixed-price Coinbase charge for the plan price and redirects the customer to the hosted page Coinbase returns. When the customer comes back, MagicPost looks up the charge and checks the latest status in its timeline:COMPLETED,CONFIRMEDorRESOLVEDrecords the order. For Lifetime plans MagicPost also creates the subscription.PENDINGorNEWshows “Your crypto payment is being confirmed by the network. You will be notified once it settles.” and sends the customer to the Billing page.- Anything else shows “Payment was not completed.”
charge:confirmed and charge:resolved webhooks record the order when the charge settles. The webhook needs the user and plan details MagicPost attached to the charge, and an order is recorded only once.
If the customer returns without their session, for example in another browser, they see “Your crypto payment is being confirmed. You will be notified once the network confirms it.” and the webhook finishes the job.
Subscription plans
If a customer chooses Coinbase for a Monthly or Yearly plan, MagicPost does not start a payment. It shows “Coinbase Commerce does not support recurring subscriptions. Please choose a different payment method.” and returns to checkout. There is no per-plan setting to hide Coinbase on recurring plans.Currency
MagicPost sends the plan’s currency in uppercase and the price with two decimals as a fixed price. Coinbase works out the crypto amount.Test mode
MagicPost has no sandbox for Coinbase. The API key you enter is used for every charge, so test with a small plan before you announce it.Common errors
This payment method is not available right now.
This payment method is not available right now.
Status is off for Coinbase. Turn it on and save.
Coinbase Commerce could not start the payment. Please try again.
Coinbase Commerce could not start the payment. Please try again.
The request to Coinbase failed. The API key is missing or wrong, or the Commerce account can no longer create charges. The reply is in
storage/logs/laravel.log.Coinbase Commerce returned an unexpected response. / Coinbase Commerce did not return a hosted URL.
Coinbase Commerce returned an unexpected response. / Coinbase Commerce did not return a hosted URL.
Coinbase did not create a charge. Check the API key and the log.
Coinbase Commerce charge lookup failed.
Coinbase Commerce charge lookup failed.
MagicPost could not read the charge back from Coinbase after the customer returned.
Coinbase shows the webhook failing with status 400
Coinbase shows the webhook failing with status 400
The body is
invalid signature: Webhook Shared Secret does not match the secret of the endpoint that sent the event.
