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
- Go to stripe.com and sign up
- Complete account verification
- Enable live mode when ready for production
Get API Keys
- Log in to Stripe Dashboard
- Go to Developers > API keys
- Copy:
- Publishable key:
pk_live_...orpk_test_... - Secret key:
sk_live_...orsk_test_...
- Publishable key:
Use test keys during development, live keys for production.
IronWifi Configuration
Step 1: Add Stripe Provider
- Log in to IronWifi Console
- Navigate to Networks > Captive Portals
- Select your captive portal
- Go to Authentication Providers
- 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:
- In the Stripe provider settings, click Add Plan
- 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:
| Plan | Price | Duration | Data |
|---|---|---|---|
| 1 Hour | $2.00 | 60 min | Unlimited |
| Day Pass | $5.00 | 1440 min | Unlimited |
| Week Pass | $15.00 | 10080 min | 10 GB |
Step 4: Configure Webhook
Set up webhook for payment confirmations:
- In Stripe Dashboard, go to Developers > Webhooks
- Click Add endpoint
- Enter webhook URL from IronWifi console
- Select events:
checkout.session.completedpayment_intent.succeededpayment_intent.payment_failed
- Copy the Signing secret to IronWifi
Payment Flow
- User connects to WiFi and sees captive portal
- User selects a plan and clicks "Buy"
- Stripe Checkout opens (secure, hosted by Stripe)
- User enters payment details
- On success, IronWifi authorizes the user
- 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:
- In Stripe Dashboard > Settings > Emails
- Enable Successful payments
- 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:
- Connect to captive portal
- Select a plan
- Use test card
- 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
- Check webhook is correctly configured
- Verify signing secret matches
- Review Stripe webhook logs for errors
- Check IronWifi authentication logs
User Not Getting Access
- Confirm payment succeeded in Stripe
- Check webhook delivery status
- Verify plan configuration in IronWifi
- Review user session in IronWifi console
Webhook Errors
- Verify endpoint URL is correct
- Check signing secret
- Ensure server can reach webhook URL
- Review error messages in Stripe logs
Security Best Practices
- Never expose secret key in client-side code
- Use HTTPS for all webhook endpoints
- Verify webhook signatures (handled by IronWifi)
- Enable 3D Secure for card authentication
- Monitor for fraud using Stripe Radar
Refunds
To refund a payment:
- Go to Stripe Dashboard > Payments
- Find the payment
- Click Refund
- User access will continue until expiration (not revoked)
For immediate access revocation:
- Refund in Stripe
- Manually disconnect user in IronWifi console
Related Topics
- Braintree Integration - Alternative payment provider
- Captive Portals - Portal configuration
- Vouchers - Prepaid access codes