PayPal (Payments)
Set up PayPal as an alternative or additional payment method alongside Stripe.
Prerequisites
- A PayPal Business account
- Access to the PayPal Developer Dashboard
How it works
tripplan.ing uses the PayPal REST API v2 with OAuth2 authentication. When an attendee selects PayPal at checkout, an order is created via the API and the attendee is redirected to PayPal to approve payment. After approval, a webhook triggers order capture and updates the payment record.
Create a developer app
- Sign in at developer.paypal.com
- Navigate to Apps & Credentials
- Click Create App
- Enter an app name (e.g., "tripplan.ing") and select Merchant as the app type
- Click Create App
- Copy the Client ID and Secret
TIP
Toggle between Sandbox and Live at the top of the page to get credentials for each environment.
Create a webhook
- In the developer app detail page, scroll to Webhooks
- Click Add Webhook
- Set the webhook URL to
https://<your-domain>/api/paypal/webhook - Subscribe to these events:
CHECKOUT.ORDER.APPROVEDPAYMENT.CAPTURE.COMPLETED
- Click Save
- Copy the Webhook ID from the webhook list
Configure tripplan.ing
PayPal credentials are typically set per-event in /admin/settings, but global environment variables are available as a fallback.
Per-event settings (primary)
Set these in the event's admin settings page (/admin/settings):
| Setting | Example | Description |
|---|---|---|
paypalClientId | AaBb... | PayPal app Client ID |
paypalClientSecret | EeFf... | PayPal app Secret |
paypalWebhookId | 1AB23... | Webhook ID from developer dashboard |
paypalSandbox | true / false | Use sandbox environment |
Global environment variables (fallback)
If you want a default PayPal account for all events, set these as environment variables:
| Environment variable | Description |
|---|---|
PAYPAL_CLIENT_ID | Default PayPal Client ID |
PAYPAL_CLIENT_SECRET | Default PayPal Secret |
PAYPAL_WEBHOOK_ID | Default Webhook ID |
PAYPAL_SANDBOX | Default sandbox mode (true / false) |
Per-event settings take priority over global environment variables.
For local development with global fallback, add to .dev.vars:
PAYPAL_CLIENT_ID=AaBb...
PAYPAL_CLIENT_SECRET=EeFf...
PAYPAL_WEBHOOK_ID=1AB23...
PAYPAL_SANDBOX=trueEnable PayPal for an event
PayPal must be explicitly enabled in the event's payment method configuration. In /admin/settings, update the paymentMethods field:
| Configuration | Effect |
|---|---|
["stripe"] | Stripe only (default) |
["stripe", "paypal"] | Both methods available |
["paypal"] | PayPal only |
Attendees see a payment method selector on /pay when multiple methods are enabled.
Sandbox vs live
| Sandbox | Live | |
|---|---|---|
| Dashboard toggle | Sandbox mode | Live mode |
| Real charges | No | Yes |
| Test accounts | Sandbox buyer/seller accounts | Real PayPal accounts |
| Setting | paypalSandbox: true | paypalSandbox: false |
| Use for | Development, staging | Production |
Creating sandbox test accounts
- In the PayPal Developer Dashboard, navigate to Testing Tools → Sandbox Accounts
- Create a Personal account (simulates a buyer)
- Note the email and password for test checkouts
Verify it works
- Set
paypalSandboxtotruein event settings - Configure the sandbox Client ID, Secret, and Webhook ID
- Enable PayPal in
paymentMethods - Visit
/payon the event subdomain - Select an item and choose PayPal as the payment method
- Log in with your sandbox buyer account on the PayPal page
- Approve the payment
- Check
/admin/payments— the payment should show ascompleted
Troubleshooting
| Symptom | Fix |
|---|---|
PayPal option not shown on /pay | Confirm paymentMethods includes "paypal" in event settings |
| "PayPal not configured" error | Verify paypalClientId, paypalClientSecret, and paypalWebhookId are set |
| Redirect to PayPal fails | Check server logs for API errors; confirm Client ID and Secret match the correct mode (sandbox/live) |
Payment approved but stays pending | Webhook not delivered — verify webhook URL and subscribed events in developer dashboard |
| Webhook signature verification fails | Confirm paypalWebhookId matches the webhook in the developer dashboard; global credentials are used for verification |
| Sandbox login fails | Use the sandbox buyer email/password from Testing Tools → Sandbox Accounts |
Related pages
- Payments — organizer guide for managing payments
- Environment & Secrets — full environment variable inventory
- Stripe (Payments) — primary payment method setup