Skip to content

PteroCA-Org/pteroca-plugin-paypal-provider

Repository files navigation

PayPal Payment Provider Plugin

Official PayPal payment integration for PteroCA Panel.

Features

  • PayPal Orders API v2 integration
  • Support for 25+ currencies
  • Sandbox and Production modes
  • Secure credential management
  • Real-time payment status tracking
  • Automatic order capture
  • Automatic dependency installation

Installation

Method 1: Upload via Panel (Recommended)

  1. Navigate to Settings → Plugins in PteroCA admin panel
  2. Click "Upload Plugin" button
  3. Upload the plugin ZIP file
  4. Plugin will be automatically installed with all dependencies
  5. Enable the plugin in the plugins list
  6. Configure plugin settings

Method 2: Manual Installation

  1. Upload plugin to plugins/paypal-payment/ directory
  2. Install dependencies: docker exec pteroca_web_dev php bin/console pteroca:plugin:install-deps paypal-payment
  3. Enable plugin in PteroCA admin panel
  4. Configure plugin settings in admin panel

Configuration

PayPal Developer Setup

  1. Create PayPal Developer account at https://developer.paypal.com
  2. Go to Dashboard → My Apps & Credentials
  3. Click "Create App" under REST API apps
  4. Enter app name and click "Create App"
  5. Copy the following credentials:
    • Client ID (visible immediately)
    • Client Secret (click "Show" to reveal)
  6. Note: You'll see both Sandbox and Live credentials - use appropriate ones for your mode

PteroCA Panel Configuration

  1. Navigate to Settings → Plugins in admin panel
  2. Find "PayPal Payment Provider" plugin
  3. Click "Configure" or settings icon
  4. Fill in the configuration:
    • Enable PayPal: Toggle to Yes
    • PayPal Client ID: Your Client ID from PayPal Developer Dashboard
    • PayPal Client Secret: Your Client Secret (keep this secure)
    • PayPal Mode:
      • Select "sandbox" for testing with test accounts
      • Select "live" for production with real payments
  5. Save settings

How It Works

  1. Payment Initiation: When a user selects PayPal and initiates payment, the plugin creates a PayPal order using the Orders API v2
  2. Redirect to PayPal: User is redirected to PayPal's secure checkout page to approve the payment
  3. Payment Approval: User logs in to PayPal and approves the payment
  4. Automatic Capture: Upon return, the plugin automatically captures the approved order
  5. Balance Update: User's balance is updated in PteroCA Panel

The plugin uses redirect-based payment flow with automatic order capture for a seamless user experience.

Testing

Use PayPal Sandbox for testing:

  1. Set PayPal Mode to "Sandbox"
  2. Use sandbox credentials from PayPal Developer Dashboard
  3. Test with PayPal sandbox accounts (create them in Developer Dashboard)
  4. All transactions in sandbox mode are simulated and use test money

Troubleshooting

Plugin not appearing as payment option

  • Ensure plugin is enabled in Settings → Plugins
  • Verify "Enable PayPal" is set to Yes in plugin configuration
  • Check that Client ID and Client Secret are configured

Payment fails or shows error

  • Verify you're using the correct credentials for your selected mode (Sandbox vs Live)
  • Check that your PayPal app credentials are active
  • Review logs in var/log/ directory for detailed error messages
  • Ensure your currency is supported by PayPal

"Not configured" error

  • Both Client ID and Client Secret must be filled in
  • Credentials must not contain extra spaces or characters
  • Make sure you've saved the configuration after entering credentials

Supported Currencies

USD, EUR, GBP, CAD, AUD, JPY, PLN, CHF, CZK, DKK, SEK, NOK, HUF, ILS, MXN, BRL, INR, SGD, HKD, NZD, PHP, THB, ZAR, MYR, TWD, TRY, RUB

Requirements

  • PteroCA Panel 0.6.0+
  • PHP 8.2+
  • PayPal REST API credentials
  • Composer (automatically handled by PteroCA when using panel upload)

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages