Skip to main content

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

  1. Go to braintreepayments.com
  2. Sign up for a sandbox account (for testing)
  3. Apply for production account when ready

Get API Credentials

  1. Log in to Braintree Control Panel
  2. Go to Settings > API
  3. Copy:
    • Merchant ID
    • Public Key
    • Private Key
    • Tokenization Key (for client-side)

IronWifi Configuration

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

  1. Click Add Plan
  2. 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

  1. Guest connects to WiFi
  2. Captive portal displays with plan options
  3. Guest selects plan and payment method
  4. Braintree handles secure payment
  5. On success, IronWifi grants access
  6. Guest receives confirmation

MAC-Based Reauthentication

Enable automatic reconnection for returning customers:

  1. In captive portal settings, enable MAC-Based Reauthentication
  2. Returning users within plan validity auto-connect
  3. 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:

  1. Go to Plans
  2. Create new plan:
    • Plan ID: unique identifier
    • Name: Display name
    • Price: Recurring amount
    • Billing Cycle: Monthly, yearly, etc.
  1. In IronWifi, create plan with same duration as billing cycle
  2. Reference Braintree plan ID
  3. 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:

  1. Go to Transactions
  2. View transaction details
  3. Check status and metadata

Troubleshooting

Payment Declined

  1. Check card details are correct
  2. Verify test vs. production credentials
  3. Review Braintree transaction logs
  4. Check for fraud prevention blocks

User Not Authorized After Payment

  1. Verify transaction succeeded in Braintree
  2. Check IronWifi authentication logs
  3. Verify plan configuration
  4. Check webhook/callback settings

Drop-in UI Not Loading

  1. Verify client token is valid
  2. Check browser console for errors
  3. Ensure Braintree SDK is loaded
  4. Check Content Security Policy headers

PayPal Configuration

Enable PayPal

  1. In Braintree, go to Processing > PayPal
  2. Link your PayPal business account
  3. Configure checkout flow settings

PayPal Checkout

Users see PayPal as payment option:

  1. Click PayPal button
  2. Log in to PayPal
  3. Confirm payment
  4. 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