Braintree Integration
Enable paid WiFi access by accepting credit cards, PayPal, Venmo, and digital wallets on your captive portal using Braintree's payment platform.
Overview
Braintree integration enables:
- Credit/debit card payments
- PayPal payments
- Venmo payments (US only)
- Apple Pay and Google Pay
- Subscription-based access plans
Prerequisites
- IronWifi account with captive portal configured
- Braintree account (sandbox or production)
- Braintree API credentials
Braintree Account Setup
Create Account
- Go to braintreepayments.com
- Sign up for a sandbox account (for testing)
- Apply for production account when ready
Get API Credentials
- Log in to Braintree Control Panel
- Go to Settings > API
- Copy:
- Merchant ID
- Public Key
- Private Key
- Tokenization Key (for client-side)
IronWifi Configuration
Step 1: Add Braintree Provider
- Log in to IronWifi Console
- Navigate to Networks > Captive Portals
- Select your captive portal
- Go to Authentication Providers
- Click Add Provider > Braintree
Step 2: Enter Credentials
Configure Braintree settings:
- Merchant ID: Your Braintree merchant ID
- Public Key: Your public key
- Private Key: Your private key
- Environment: Sandbox (testing) or Production
Step 3: Create Hotspot Plans
Set up purchasable access plans:
- Click Add Plan
- Configure each plan:
- Name: Display name (e.g., "Premium Day Pass")
- Description: Plan details
- Price: Amount (e.g., 9.99)
- Currency: USD, EUR, GBP, etc.
- Duration: Access duration in minutes
- Bandwidth: Optional speed limits
- Data Limit: Optional data cap
Step 4: Payment Methods
Enable desired payment methods in Braintree Control Panel:
- Credit/Debit Cards
- PayPal
- Venmo (requires approval)
- Apple Pay (requires verification)
- Google Pay
Payment Flow
Standard Flow
- Guest connects to WiFi
- Captive portal displays with plan options
- Guest selects plan and payment method
- Braintree handles secure payment
- On success, IronWifi grants access
- Guest receives confirmation
MAC-Based Reauthentication
Enable automatic reconnection for returning customers:
- In captive portal settings, enable MAC-Based Reauthentication
- Returning users within plan validity auto-connect
- No re-payment required until plan expires
Splash Page Integration
Plan Display
<div class="pricing-plans">
<div class="plan">
<h3>1 Hour</h3>
<p class="price">$1.99</p>
<button data-plan="1hour">Buy Now</button>
</div>
<div class="plan featured">
<h3>Day Pass</h3>
<p class="price">$4.99</p>
<button data-plan="daypass">Buy Now</button>
</div>
<div class="plan">
<h3>Week Pass</h3>
<p class="price">$14.99</p>
<button data-plan="weekpass">Buy Now</button>
</div>
</div>
Payment Form
Braintree Drop-in UI handles payment securely:
<div id="dropin-container"></div>
<button id="submit-button">Submit Payment</button>
<script src="https://js.braintreegateway.com/web/dropin/1.33.0/js/dropin.min.js"></script>
<script>
braintree.dropin.create({
authorization: '{{client_token}}',
container: '#dropin-container',
paypal: { flow: 'checkout' }
}, function (err, instance) {
document.getElementById('submit-button').addEventListener('click', function () {
instance.requestPaymentMethod(function (err, payload) {
// Send payload.nonce to server
submitPayment(payload.nonce);
});
});
});
</script>
Subscription Plans
Create Recurring Plans
In Braintree Control Panel:
- Go to Plans
- Create new plan:
- Plan ID: unique identifier
- Name: Display name
- Price: Recurring amount
- Billing Cycle: Monthly, yearly, etc.
Link to IronWifi
- In IronWifi, create plan with same duration as billing cycle
- Reference Braintree plan ID
- Users are billed automatically
Testing
Sandbox Testing
Use Braintree sandbox credentials and test cards:
Test Card Numbers:
- Visa: 4111 1111 1111 1111
- Mastercard: 5555 5555 5555 4444
- PayPal: Use sandbox PayPal account
Test Scenarios:
- Success: Use valid test cards
- Decline: 4000 1111 1111 1115
- Processor error: 4000 1111 1111 1123
Verify Transactions
In Braintree Control Panel:
- Go to Transactions
- View transaction details
- Check status and metadata
Troubleshooting
Payment Declined
- Check card details are correct
- Verify test vs. production credentials
- Review Braintree transaction logs
- Check for fraud prevention blocks
User Not Authorized After Payment
- Verify transaction succeeded in Braintree
- Check IronWifi authentication logs
- Verify plan configuration
- Check webhook/callback settings
Drop-in UI Not Loading
- Verify client token is valid
- Check browser console for errors
- Ensure Braintree SDK is loaded
- Check Content Security Policy headers
PayPal Configuration
Enable PayPal
- In Braintree, go to Processing > PayPal
- Link your PayPal business account
- Configure checkout flow settings
PayPal Checkout
Users see PayPal as payment option:
- Click PayPal button
- Log in to PayPal
- Confirm payment
- Return to captive portal with access granted
Reporting
Braintree Reports
Access in Control Panel:
- Transactions: All payments
- Settlements: Batch settlements
- Disputes: Chargebacks and inquiries
IronWifi Analytics
Track paid access:
- Revenue by plan
- Conversion rates
- User retention
Related Topics
- Stripe Integration - Alternative payment provider
- Captive Portals - Portal setup
- Authentication Providers - All auth methods