NOTE: PayPal requires a Premier or Business account to enable transactions and subscriptions through their API.
Get PayPal API Keys
- Sign into https://developer.paypal.com
- Create a new REST API App
- On the App page, the Sandbox and Live tabs will show your API Client ID and Secret. These are added under
/admin/site_settings/category/procourse_membershipson your Discourse site.
Set up the PayPal Gateway
Configure the following settings under
memberships go live— Check this box only if you are ready to take payments. Requires Live API Client ID and Secret when checked.
memberships gateway— Set to
memberships paypal api id— Enter the sandbox/live Client ID here.
memberships paypal api secret— Enter the sandbox/live Secret here.
Configure IPN (Subscriptions Only)
If you plan on using recurring levels (subscriptions), you must configure PayPal’s Instant Payment Notification (IPN) to send notifications to your site in order for customers to receive receipts upon recurring transaction success or failure.
- Log into your PayPal Business account
- Browse to Profile > Profile and Settings > My selling tools
- In the Instant payment notifications row, click Update
- Click Choose IPN Settings
- Enter in the following URL:
https://<your Discourse site>/memberships/webhook/paypal
- Click Receive IPN messages
Level creation under the PayPal gateway works as normal except in one instance.
When a level is set to recur, the plugin automatically creates a billing plan in PayPal. The first time the level is set to Enabled, the billing plan is activated via PayPal’s API.
At this time, PayPal does not allow changes to active billing plans, therefore, once a recurring level is enabled, no further changes are allowed by the plugin. A new level needs to be created with the new settings instead.