Automatic Payment Notifications
Payment notification webhooks allow for automatic invoice payment updates from PayPal, Coinbase Commerce and Stripe.
Prerequisites
This guide is intended for advanced users only.
You will require:
- a server with full root access;
- be able to open ports on your server in order to allow external communication with the bots internal Rest API;
- a valid SSL certificate (or a service that provides you one, like Cloudflare).
WARNING
If you can't expose the webhook (for any of the reasons outlined above), you will still be able to create & manage invoices, however their status won't update automatically.
You can update their status manually using /invoice refresh
every once in a while.
If this solution is fine with you, you can skip this guide.
This guide assumes the basic installation & payment guides have been followed.
Terminology
Both PayPal and Coinbase Commerce send events (like updates to payments) to your bot's API via webhooks.
This means that the platform will send a POST request to your bot's URL, which will then update the invoice's status.
Read more about webhook-driven event updates 🡥
The bot's API must thus be enabled & open to the public and accessible from the internet. It must also run on HTTPS (SSL), as per PayPal's, Stripe's and Coinbase's requirements.
You can achieve this in multiple ways, for example by proxying the website through Cloudflare or providing your own key & certificate files.
Port Reference
By default, the bot exposes the API endpoint on port 2020
for HTTP and 2021
for HTTPS (using key.pem and cert.pem files). Ports can be configured in your config.yml
file, under the api
section.
We recommend setting up a reverse proxy using NGINX or Apache to proxy the bot's API to a subdomain.
Before configuring PayPal, Coinbase or Stripe webhooks make sure the API works by visiting the root endpoint (/) in your browser.
Set up
TIP
The endpoint for PayPal invoice updates is available at /ipn/paypal
.
The endpoint for Coinbase Commerce payment updates is available at /ipn/coinbase
.
The endpoint for Stripe payment updates is available at /ipn/stripe
.
Configuration on PayPal:
- Go to the PayPal Developer Dashboard, switch the mode over to Live and click on Apps & Credentials.
- Select your app from the list.
- Create a webhook with the URL of your bot's API, followed by the endpoint, as shown: When asked which events to track, select "All Events".
Configuration on Coinbase Commerce:
- Login to Coinbase Commerce.
- Navigate to Settings by clicking on your profile picture.
- Navigate the tab to "Notifications"
- Create a webhook with the URL of your bot's API, followed by the endpoint, as shown:
Configuration on Stripe:
- Go to the Stripe Dashboard and make sure the Test mode switch is Off.
- Navigate to the webhooks tab.
- Click "Add an endpoint".
- Insert the URL of your bot's API, followed by the endpoint, as shown: When asked which events to listen to, find and select "invoice.paid". Copy the webhook signing secret and insert it into your config.yml: