PayPal and Venmo
This page is for an owner who wants viewers to pay with PayPal. After it, viewers can tip you, buy points and, if you set a plan, take out the Supporter subscription with their PayPal account. In the United States the same button also offers Venmo. You use your own PayPal Business account, so the money goes into your PayPal balance and you move it to your bank from PayPal as usual. Black Branch never holds the money and takes no share of it.
PayPal is a module, off on a new install. Switch it on during setup (the Modules page) or later in Admin Panel β Payments β Connections, where PayPal and Venmo is the first row of the PayPal card. The website applies this switch at once. Its steps then appear on the setup pages, and in the Admin Panel's How to set up PayPal and Venmo guide on the same page.
What connecting PayPal gives you
- A PayPal button on the tip page (
/donate) and in the Donate window, next to the card form if you also use Stripe. Viewers pick PayPal or Venmo on the pay button. - Points bought with PayPal, if buying points is switched on for your site.
- The Supporter subscription through PayPal, once you set a billing plan (step 3). Subscribers can cancel on your site.
- Alerts, the support bar and payment history for each PayPal payment, as for card payments.
Gifted subscriptions are card payments only, through Stripe.
What the site sets:
- PayPal tips and points are charged in US dollars.
- A tip or points purchase is between $1 and $1,000.
- Venmo appears by itself when PayPal finds the buyer eligible, which in practice means a US business account, a US buyer and a payment in US dollars. Everyone else sees only PayPal. There is nothing to switch on for Venmo.
PayPal charges a fee on each payment, set by PayPal by country: see PayPal's merchant fees (choose your country there).
Before you start
- A PayPal Business account. Taking payments through an app is a business feature at PayPal. PayPal lets you upgrade a personal account to Business in its settings.
- Your site installed and reachable at its domain. The addresses below use
example.com; your setup page shows your own.
π΄ Protect your personal name and home address. PayPal can show buyers a business or legal name and contact details. Check what a paying viewer will see before you go live: Protect your personal name and home address.
Sandbox and live
PayPal keeps a separate practice world called the sandbox. A sandbox app takes only pretend money, paid from made-up buyer accounts that PayPal creates for you in the Developer Dashboard. A live app takes real money. Every app has two separate sets of credentials, one for each: a sandbox client id never works live, and the other way round. Webhooks and plans made in one do not exist in the other.
Recommended: connect a sandbox app first, tip yourself from a sandbox buyer account, check it arrived, then repeat the steps with the live app.
Step 1: your PayPal app
The site talks to PayPal through an app you register in PayPal's Developer Dashboard. The app is a name with a pair of credentials: a client id and a client secret, used only between your server and PayPal.
- Open the PayPal Developer Dashboard β Apps & Credentials and log in with your PayPal Business account.
- At the top, pick Sandbox or Live.
- Choose Create App. Give it a name you will recognise, such as "Community site", and choose the type Merchant.
- PayPal shows the app's Client ID and Secret. Copy both.
- On the setup page (or Admin Panel β Payments β Connections, card PayPal), set PayPal environment to
sandboxorliveto match, paste PayPal client id and PayPal client secret, and press Check.
πΌ Image: the PayPal Developer Dashboard showing a Merchant app with its Client ID and the Secret's Show button.
What each value is for:
| Value | What it lets the site do | Why it is needed |
|---|---|---|
PayPal environment (live or sandbox) |
Tells the site which PayPal to talk to | Sandbox credentials only work against PayPal's sandbox, and live ones only live. PayPal stays off until this and both credentials are set. |
| Client id | Identifies your app. The PayPal button in the viewer's browser loads with it. | Public by design; it cannot take money on its own. The site stores it with the secret it pairs with. |
| Client secret | With the client id, lets your server ask PayPal for a short-lived access token | Every call below needs that token. Stored encrypted; never sent to a browser. |
With that token, the site makes only these kinds of calls to PayPal:
| Call | What it does | Why |
|---|---|---|
| Create and capture an order | Starts a tip or points purchase, then takes the money the viewer approved | PayPal moves no money when the viewer clicks Pay; your server confirms it, so a failed payment is something you can see |
| Read a billing plan and a subscription | Reads your plan's price, and a subscriber's status and payments | Shows the subscription's price, and keeps the site's record of who is a Supporter in step with PayPal |
| Cancel a subscription | Cancels a viewer's subscription when they press cancel on your site | So subscribers can cancel without asking you |
| Verify a webhook signature | Asks PayPal whether a webhook really came from PayPal | Step 2 |
| Read your webhook | Looks up the webhook id you paste in step 2 | Only for the webhook's Check and the Doctor |
The site never reads your balance or your other transactions, and never sends money out. Viewers do not need a site account to tip; subscribing needs one.
Check asks PayPal for an access token with your credentials. If PayPal refuses, the id or secret is wrong, or they belong to the other environment.
Step 2: the webhook
A webhook is a message PayPal sends to your site when something happens to a payment or a subscription. When a tip completes, PayPal sends one, and that message, not the viewer's browser, is what makes it count. PayPal's explanation is in PayPal webhooks.
PayPal gives each webhook an id. Your site uses it to ask PayPal whether each message it receives is genuine, so a stranger cannot fake a payment.
- In the Developer Dashboard, open the app you made in step 1.
- Find Webhooks and choose Add webhook.
- Paste the webhook URL from your setup page:
https://example.com/api/billing/paypal/webhook(with your domain). - Tick the fourteen events in the table below. The setup page lists them on one line.
- Save. PayPal lists the new webhook with its Webhook ID. Copy it.
- Paste it into PayPal webhook id on the setup page and press Check.
The webhook belongs to one app in one mode: a sandbox app's webhook id does not work with live keys.
| Events | What the site does |
|---|---|
PAYMENT.CAPTURE.COMPLETED |
A tip or points purchase was paid: records it and fires the alert |
PAYMENT.CAPTURE.REFUNDED, PAYMENT.CAPTURE.REVERSED |
You refunded it, or PayPal took it back after a buyer's claim: noted in payment history, and what the payment gave is taken back |
CUSTOMER.DISPUTE.RESOLVED |
A buyer's dispute was settled: noted in payment history; if the buyer won, the payment's credit is taken back, once only |
BILLING.SUBSCRIPTION.CREATED, .ACTIVATED, .UPDATED, .EXPIRED, .CANCELLED, .SUSPENDED, .PAYMENT.FAILED |
A PayPal subscription started, changed, ended, was suspended or missed a payment: keeps the viewer's Supporter status in step |
PAYMENT.SALE.COMPLETED |
A subscription's monthly payment arrived: counts it on the support bar and in payment history |
PAYMENT.SALE.REFUNDED, PAYMENT.SALE.REVERSED |
A subscription payment was refunded or taken back: handled like a refunded tip |
(Each BILLING.SUBSCRIPTION event is written out in full on the setup page, for example BILLING.SUBSCRIPTION.ACTIVATED.) What exactly a refund or reversal takes back is on How money flows.
Check confirms that the webhook id exists at PayPal, points at your site's address, and sends every event the site handles. A new webhook id applies at once.
If your site is behind the Cloudflare tunnel, PayPal's webhooks pass through Cloudflare too. If PayPal's webhook page shows deliveries refused with 403, see Cloudflare; the path to let through is /api/billing/paypal/webhook.
Step 3: subscriptions through PayPal (optional)
To sell the Supporter subscription through PayPal, you make a billing plan in your PayPal account and give the site its id. Without a plan, PayPal takes tips and points only.
The plan must:
- bill monthly,
- at a fixed price,
- with a payment failure threshold of 3: the number of failed payments after which PayPal suspends the subscription.
A plan that does not bill monthly at a fixed price is refused: its payments are not credited, and they are flagged for you to check by hand. Without the failure threshold, PayPal keeps retrying a failed payment and the subscriber's perks run out a month after their last payment.
- In your PayPal Business account (live, or the sandbox to try it), create a subscription product and a plan with the settings above. PayPal's guide is PayPal subscriptions.
- Copy the plan's id. It starts with
P-. - Paste
{"supporter":"P-β¦"}, with your plan id in place ofP-β¦, into Subscription plans: on the setup page, the optional step Supporter subscriptions through PayPal; later, Admin Panel β Payments β Connections, card PayPal. The plan's price and currency are read from PayPal.
β To confirm: the exact menu names for creating a plan in PayPal's own dashboard.
Once a plan is set, signed-in viewers see a PayPal subscribe button in the Supporter part of the support window, next to the card subscription if Stripe has a price. On a site that sells the subscription through PayPal only, the Subscribe button under the player opens the support window on the PayPal subscription. A PayPal subscriber can cancel on your site; they stay a Supporter until the end of the month they paid for.
How to check it worked
- With a sandbox app, open your tip page (
https://example.com/donate), pick an amount and choose PayPal. - Log in with one of the sandbox personal accounts listed in the Developer Dashboard (under Testing Tools β Sandbox Accounts) and approve the payment.
- The tip appears in Admin Panel β Payments β Payment history, and as an alert on stream if your overlays are open.
- With a plan set, subscribe from a second sandbox account, then cancel from your site.
- Open the Doctor. The row PayPal: the webhook id exists and points at this site should be green.
Before you go live, go through Protect your personal name and home address. Then take the live client id and secret, make the webhook again on the live app (its id is different), make a live plan if you sell subscriptions, set PayPal environment to live, and paste the live values.
Switching PayPal off
With the module off there is no PayPal button, and PayPal's webhook address on your site answers "not found". PayPal keeps undelivered events and retries them for about three days, so switching back on within that time loses nothing.
π΄ PayPal subscribers lose their Supporter perks at once while PayPal keeps charging them. Before you switch PayPal off for good, cancel their subscriptions in PayPal, or switch the module back on.
When it goes wrong
| What you see | What it means | What to do |
|---|---|---|
| rejected on the credentials | Wrong id or secret, or they are for the other environment | Copy them again, and check PayPal environment matches the tab you copied them from. |
| The webhook check says not found at the provider | The id is mistyped, or the webhook belongs to the other environment or another app | Copy the id from the same app and mode as the credentials. |
| "the webhook points at another address, not this site" | The webhook's URL is not exactly your site's address | Edit the webhook in PayPal so the URL is https:// + your domain + /api/billing/paypal/webhook. |
| "the webhook does not send β¦ of the events" | Not every event is ticked | Edit the webhook and tick the missing ones. |
| The viewer paid, PayPal shows the money, but nothing appeared on the site | The webhook did not arrive or was refused | Check the webhook's delivery history in the Developer Dashboard. 404 means the PayPal module is off. 403 behind Cloudflare means bot protection blocked it. |
| A subscription payment is flagged instead of credited | The plan does not bill monthly at a fixed price | Make a plan that does, and put its id in Subscription plans. |
| No PayPal subscribe button | No plan is set, or the viewer is not signed in | Set Subscription plans; subscribing needs a site account. |
| No Venmo option | Expected outside the US, for non-US business accounts, or for non-US buyers | Nothing to fix. |
| No PayPal button at all | The module is off, or a value is missing | Check the PayPal and Venmo switch on Admin Panel β Payments β Connections, and that all three values from step 1 are set. |