Skip to main content

Stripe Integration

Enable paid WiFi access by accepting credit card payments directly on your captive portal using Stripe's secure payment platform.

Overview

The Stripe integration allows you to:

  • Accept one-time payments for WiFi access
  • Create subscription plans for recurring access
  • Process payments securely via Stripe's PCI-compliant platform
  • Offer multiple access tiers (time-based or data-based)

Prerequisites

  • IronWifi account with captive portal configured
  • Stripe account (free to create at stripe.com)
  • Stripe API keys (publishable and secret keys)

Stripe Account Setup

Create Stripe Account

  1. Go to stripe.com and sign up
  2. Complete account verification
  3. Enable live mode when ready for production

Get API Keys

  1. Log in to Stripe Dashboard
  2. Go to Developers > API keys
  3. Copy:
    • Publishable key: pk_live_... or pk_test_...
    • Secret key: sk_live_... or sk_test_...

Use test keys during development, live keys for production.

IronWifi Configuration

Step 1: Add Stripe 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 > Stripe

Step 2: Configure API Keys

Enter your Stripe credentials:

  • Publishable Key: Your Stripe publishable key
  • Secret Key: Your Stripe secret key
  • Webhook Secret: Generated after webhook setup

Step 3: Create Access Plans

Create plans that users can purchase:

  1. In the Stripe provider settings, click Add Plan
  2. Configure:
    • Name: Display name (e.g., "1 Hour Access")
    • Price: Amount in cents (e.g., 500 for $5.00)
    • Currency: USD, EUR, etc.
    • Duration: Access time (minutes)
    • Data Limit: Optional data cap (MB)

Example plans:

PlanPriceDurationData
1 Hour$2.0060 minUnlimited
Day Pass$5.001440 minUnlimited
Week Pass$15.0010080 min10 GB

Step 4: Configure Webhook

Set up webhook for payment confirmations:

  1. In Stripe Dashboard, go to Developers > Webhooks
  2. Click Add endpoint
  3. Enter webhook URL from IronWifi console
  4. Select events:
    • checkout.session.completed
    • payment_intent.succeeded
    • payment_intent.payment_failed
  5. Copy the Signing secret to IronWifi

Payment Flow

  1. User connects to WiFi and sees captive portal
  2. User selects a plan and clicks "Buy"
  3. Stripe Checkout opens (secure, hosted by Stripe)
  4. User enters payment details
  5. On success, IronWifi authorizes the user
  6. User receives confirmation and WiFi access

Customization

Splash Page Integration

Add Stripe payment buttons to your splash page:

<!-- Plan selection -->
<div class="plans">
<button onclick="selectPlan('1hour')">1 Hour - $2.00</button>
<button onclick="selectPlan('daypass')">Day Pass - $5.00</button>
</div>

<script>
function selectPlan(planId) {
// Redirect to Stripe checkout
window.location.href = '{{stripe_checkout_url}}?plan=' + planId;
}
</script>

Receipt Emails

Configure Stripe to send receipts:

  1. In Stripe Dashboard > Settings > Emails
  2. Enable Successful payments
  3. Customize receipt template

Testing

Test Mode

Use Stripe test keys and test card numbers:

  • Success: 4242 4242 4242 4242
  • Decline: 4000 0000 0000 0002
  • Requires Auth: 4000 0025 0000 3155

Test the complete flow:

  1. Connect to captive portal
  2. Select a plan
  3. Use test card
  4. Verify access is granted

Verify in Stripe Dashboard

Check payments in Payments section:

  • View transaction details
  • Check webhook events
  • Review logs for debugging

Troubleshooting

Payment Not Completing

  1. Check webhook is correctly configured
  2. Verify signing secret matches
  3. Review Stripe webhook logs for errors
  4. Check IronWifi authentication logs

User Not Getting Access

  1. Confirm payment succeeded in Stripe
  2. Check webhook delivery status
  3. Verify plan configuration in IronWifi
  4. Review user session in IronWifi console

Webhook Errors

  1. Verify endpoint URL is correct
  2. Check signing secret
  3. Ensure server can reach webhook URL
  4. Review error messages in Stripe logs

Security Best Practices

  1. Never expose secret key in client-side code
  2. Use HTTPS for all webhook endpoints
  3. Verify webhook signatures (handled by IronWifi)
  4. Enable 3D Secure for card authentication
  5. Monitor for fraud using Stripe Radar

Refunds

To refund a payment:

  1. Go to Stripe Dashboard > Payments
  2. Find the payment
  3. Click Refund
  4. User access will continue until expiration (not revoked)

For immediate access revocation:

  1. Refund in Stripe
  2. Manually disconnect user in IronWifi console