Skip to main content

PayPal Integration

Enable paid WiFi access by accepting PayPal and credit card payments on your captive portal using PayPal Checkout with support for multiple currencies.

Overview

The PayPal integration enables:

  • One-time payments for WiFi access
  • PayPal Checkout for seamless payments
  • Credit/Debit card acceptance via PayPal
  • Multiple currencies support

Prerequisites

  • IronWifi account with captive portal configured
  • PayPal Business account
  • PayPal REST API credentials

PayPal Setup

Create Business Account

  1. Go to paypal.com/business
  2. Sign up for a Business account
  3. Complete verification

Get API Credentials

  1. Log in to PayPal Developer Dashboard (developer.paypal.com)
  2. Go to My Apps & Credentials
  3. Create a new REST API app:
    • App Name: IronWifi WiFi Payments
    • Account: Your business account
  4. Copy credentials:
    • Client ID
    • Client Secret

Sandbox Testing

For development:

  1. Use Sandbox credentials
  2. Create sandbox buyer accounts
  3. Test payment flow before going live

IronWifi Configuration

Step 1: Add PayPal Provider

  1. Log in to IronWifi Console
  2. Navigate to Networks > Captive Portals
  3. Select your captive portal
  4. Go to Authentication Providers
  5. Click Add Provider > PayPal

Step 2: Configure API

Enter PayPal credentials:

  • Client ID: Your PayPal REST API Client ID
  • Client Secret: Your PayPal Client Secret
  • Environment: Sandbox (testing) or Live (production)

Step 3: Create Access Plans

Configure WiFi access plans:

  1. Click Add Plan
  2. Set up each plan:
    • Name: Display name (e.g., "1 Hour Access")
    • Price: Amount (e.g., 2.99)
    • Currency: USD, EUR, GBP, etc.
    • Duration: Access time in minutes
    • Data Limit: Optional data cap

Example Plans:

PlanPriceDurationData
1 Hour$1.9960 minUnlimited
Day Pass$4.991440 minUnlimited
Week$14.9910080 min20 GB

Payment Flow

Guest Experience

  1. Guest connects to WiFi
  2. Captive portal shows available plans
  3. Guest selects plan and clicks "Pay with PayPal"
  4. Redirected to PayPal Checkout
  5. Guest logs in to PayPal or pays with card
  6. Payment confirmed
  7. Redirected back, access granted

Technical Flow

Guest → Captive Portal → PayPal Checkout

Payment Approved

Access Granted ← IronWifi ← PayPal Webhook

Customization

Splash Page Integration

Add PayPal buttons to your splash page:

<div class="wifi-plans">
<div class="plan">
<h3>1 Hour Access</h3>
<p class="price">$1.99</p>
<button onclick="purchasePlan('1hour')">Buy Now</button>
</div>
<div class="plan">
<h3>Day Pass</h3>
<p class="price">$4.99</p>
<button onclick="purchasePlan('daypass')">Buy Now</button>
</div>
</div>

<script>
function purchasePlan(planId) {
window.location.href = '{{paypal_checkout_url}}?plan=' + planId;
}
</script>

Branding

PayPal Checkout can display:

  • Your logo
  • Business name
  • Custom colors (limited)

Configure in PayPal account settings.

Webhook Configuration

Set Up Webhooks

  1. In PayPal Developer Dashboard
  2. Go to your app > Webhooks
  3. Click Add Webhook
  4. Enter IronWifi webhook URL
  5. Select events:
    • PAYMENT.CAPTURE.COMPLETED
    • PAYMENT.CAPTURE.DENIED
    • CHECKOUT.ORDER.APPROVED

Webhook URL

Get webhook URL from IronWifi:

https://auth.ironwifi.com/webhook/paypal/your-org-id

Testing

Sandbox Testing

  1. Use sandbox API credentials
  2. Create sandbox buyer account
  3. Use sandbox buyer to test payments
  4. Verify access is granted after payment

Test Scenarios

Test these scenarios:

  • Successful payment → access granted
  • Cancelled payment → returns to portal
  • Failed payment → error message shown
  • Expired session → graceful handling

Receipts

PayPal Receipts

PayPal automatically sends receipts to buyers.

Custom Receipts

Configure additional email notifications:

  1. In IronWifi, enable payment confirmation emails
  2. Customize template with plan details
  3. Include WiFi credentials if applicable

Troubleshooting

Payment Not Completing

  1. Verify API credentials
  2. Check PayPal account status
  3. Review PayPal transaction logs
  4. Check webhook delivery

Access Not Granted After Payment

  1. Confirm payment in PayPal Dashboard
  2. Check webhook was received
  3. Review IronWifi logs
  4. Verify plan configuration

Webhook Errors

  1. Verify webhook URL is correct
  2. Check webhook signing verification
  3. Review PayPal webhook logs
  4. Ensure IronWifi can receive webhooks

Refunds

Process Refund

  1. Log in to PayPal Business Dashboard
  2. Go to Activity > All Transactions
  3. Find the transaction
  4. Click Refund
  5. Enter refund amount

Access After Refund

  • By default, WiFi access continues until expiration
  • For immediate revocation, manually disconnect user in IronWifi

Security

Best Practices

  1. Use HTTPS for all webhooks
  2. Verify webhook signatures (automatic in IronWifi)
  3. Monitor for fraud using PayPal tools
  4. Enable 2FA on PayPal account
  5. Limit API permissions to necessary scopes

PCI Compliance

PayPal handles card data:

  • No card numbers touch your systems
  • PayPal is PCI DSS Level 1 compliant
  • Reduces your compliance burden

Multi-Currency

Supported Currencies

PayPal supports many currencies:

  • USD, EUR, GBP, CAD, AUD
  • And many more

Configuration

Set currency per plan or globally:

  1. In plan settings, select currency
  2. Prices display in selected currency
  3. PayPal converts if buyer uses different currency

Best Practices

  1. Clear pricing - Display all fees upfront
  2. Multiple plans - Offer variety
  3. Test thoroughly - Use sandbox first
  4. Monitor transactions - Check daily
  5. Quick support - Have refund policy ready