PayPal Gateway
PayPal payment gateway integration for SaaS subscriptions. This module enables accepting payments via PayPal for tenant subscription billing.
Features
- PayPal Payments: Accept one-time payments via PayPal Checkout
- Sandbox and Production Modes: Switch between sandbox and live environments
- Order Capture: Server-side payment capture after user approval
- Webhook Handling: Automatic payment status processing via PayPal webhooks
Requirements
- Open Core Business Suite (Base System)
- MultiTenancyCore module (required)
- PayPal Business account
- PayPal API credentials (Client ID and Client Secret)
Installation
Enable via Admin Panel
- Log in as administrator
- Navigate to Settings > Addons
- Find PayPal Gateway and click Enable
- Run migrations if prompted
Enable via Command Line
php artisan module:enable PayPalGateway
php artisan migrate
The Multi-Tenancy module must be installed and enabled before enabling this module.
Configuration
Enabling the Gateway
- Navigate to SaaS Management > SaaS Settings
- Toggle PayPal gateway to enabled
- Click the PayPal settings to configure API credentials
PayPal Settings
The PayPal settings are accessible from the SaaS Settings page. Configure the following:
| Setting | Description |
|---|---|
| Client ID | Your PayPal application Client ID |
| Client Secret | Your PayPal application Client Secret |
| Mode | Sandbox (testing) or Production (live) |
| Webhook ID | Your PayPal webhook ID for signature verification |
Webhook Setup
Configure webhooks in your PayPal Developer Dashboard:
- Go to your PayPal Developer account
- Navigate to your application settings
- Add webhook URL:
https://yourdomain.com/paypalgateway/webhook - Select events to listen for:
PAYMENT.CAPTURE.COMPLETEDCHECKOUT.ORDER.APPROVEDPAYMENT.CAPTURE.DENIEDPAYMENT.CAPTURE.DECLINED
Usage
This module is a payment gateway addon for the Multi-Tenancy module. Once enabled and configured, PayPal appears as a payment option when tenants subscribe to or renew a plan. There is no separate admin interface for this module -- configuration is done through SaaS Settings.
Setup Steps
- Enable the module (see Installation above)
- Navigate to SaaS Management > SaaS Settings
- Toggle PayPal gateway to enabled
- Enter your PayPal Client ID and Client Secret
- Select sandbox or production mode
- Set up webhooks in your PayPal Developer Dashboard (see Webhook Setup below)
Tenant Payment Flow
When a tenant selects PayPal at checkout, they are redirected to PayPal's approval page. After approving the payment, they return to the application where the payment is captured server-side and the subscription is activated automatically.
How It Works
- A tenant selects a plan and chooses PayPal as the payment method
- The system creates a PayPal order via the Orders API
- The tenant is redirected to PayPal's approval page
- After the tenant approves, they are redirected back and the payment is captured server-side
- On successful capture, the subscription is automatically activated
- PayPal webhooks provide backup confirmation for payment status
Troubleshooting
Payment Not Processing
- Verify the PayPal Client ID and Client Secret are correct
- Check that the gateway is enabled in SaaS Settings
- Ensure the correct mode (sandbox vs production) is selected
- Review application logs for PayPal API errors
Redirect Issues
- Verify return and cancel URLs are accessible from PayPal's servers
- Check that the application URL configuration is correct
Webhook Not Receiving Events
- Verify the webhook URL is correctly set in PayPal Developer Dashboard
- Check that the webhook secret is correct
- Ensure the server is accessible from PayPal's servers
- Review PayPal Developer Dashboard webhook logs for delivery failures
Changelog: View version history