Skip to main content

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

  1. Log in as administrator
  2. Navigate to Settings > Addons
  3. Find PayPal Gateway and click Enable
  4. Run migrations if prompted

Enable via Command Line

php artisan module:enable PayPalGateway
php artisan migrate
note

The Multi-Tenancy module must be installed and enabled before enabling this module.

Configuration

Enabling the Gateway

  1. Navigate to SaaS Management > SaaS Settings
  2. Toggle PayPal gateway to enabled
  3. Click the PayPal settings to configure API credentials

PayPal Settings

The PayPal settings are accessible from the SaaS Settings page. Configure the following:

SettingDescription
Client IDYour PayPal application Client ID
Client SecretYour PayPal application Client Secret
ModeSandbox (testing) or Production (live)
Webhook IDYour PayPal webhook ID for signature verification

Webhook Setup

Configure webhooks in your PayPal Developer Dashboard:

  1. Go to your PayPal Developer account
  2. Navigate to your application settings
  3. Add webhook URL: https://yourdomain.com/paypalgateway/webhook
  4. Select events to listen for:
    • PAYMENT.CAPTURE.COMPLETED
    • CHECKOUT.ORDER.APPROVED
    • PAYMENT.CAPTURE.DENIED
    • PAYMENT.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

  1. Enable the module (see Installation above)
  2. Navigate to SaaS Management > SaaS Settings
  3. Toggle PayPal gateway to enabled
  4. Enter your PayPal Client ID and Client Secret
  5. Select sandbox or production mode
  6. 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

  1. A tenant selects a plan and chooses PayPal as the payment method
  2. The system creates a PayPal order via the Orders API
  3. The tenant is redirected to PayPal's approval page
  4. After the tenant approves, they are redirected back and the payment is captured server-side
  5. On successful capture, the subscription is automatically activated
  6. 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