Square Integration
Process credit card payments for paid WiFi access on your captive portal using Square's payment platform with integrated transaction management and reporting.
Overview
The Square integration enables:
- Credit card payments for WiFi access
- In-person and online payment options
- Square Dashboard for transaction management
- Integrated reporting with existing Square setup
Prerequisites
- IronWifi account with captive portal configured
- Square account (squareup.com)
- Square Developer account
Square Setup
Create Developer Account
- Go to developer.squareup.com
- Sign up or link existing Square account
- Accept developer terms
Create Application
- In Square Developer Dashboard
- Click Applications > Create Application
- Name: "WiFi Payments"
- Copy credentials:
- Application ID
- Access Token (Sandbox and Production)
Get Location ID
- In Square Dashboard, go to Account & Settings
- Find Locations
- Note the Location ID for your business
IronWifi Configuration
Step 1: Add Square Provider
- Log in to IronWifi Console
- Navigate to Networks > Captive Portals
- Select your captive portal
- Go to Authentication Providers
- Click Add Provider > Square
Step 2: Configure API
Enter Square credentials:
- Application ID: Your Square Application ID
- Access Token: Your Square Access Token
- Location ID: Your Square Location ID
- Environment: Sandbox or Production
Step 3: Create Access Plans
Set up WiFi access tiers:
| Plan | Price | Duration | Features |
|---|---|---|---|
| Basic | $2.00 | 1 hour | Standard speed |
| Standard | $5.00 | Day pass | Full speed |
| Premium | $15.00 | Week | Priority + unlimited |
Payment Flow
Web Flow
- Guest connects and sees captive portal
- Selects access plan
- Square payment form appears
- Guest enters card details
- Payment processed
- Access granted
Implementation
Square Web Payments SDK integration:
<div id="card-container"></div>
<button id="pay-button">Pay {{amount}}</button>
<script>
const payments = Square.payments(applicationId, locationId);
const card = await payments.card();
await card.attach('#card-container');
document.getElementById('pay-button').addEventListener('click', async () => {
const result = await card.tokenize();
if (result.status === 'OK') {
// Send token to IronWifi for payment processing
submitPayment(result.token);
}
});
</script>
Integration Options
Online Payments
For captive portal payments:
- Square Web Payments SDK
- Embedded payment form
- PCI-compliant card handling
Point of Sale
For front desk payments:
- Use Square Terminal or Reader
- Process payment in Square POS
- Enter receipt number in IronWifi
- Access granted via manual voucher
Square Online Checkout
Redirect to Square-hosted checkout:
- Create checkout link
- Redirect guest to Square
- Receive webhook on completion
- Grant access
Webhook Configuration
Set Up Webhooks
- In Square Developer Dashboard
- Go to your application > Webhooks
- Click Add Endpoint
- Enter IronWifi webhook URL
- Select events:
payment.completedpayment.updated
Webhook Security
Configure webhook signature validation:
- Copy Signature Key from Square
- Add to IronWifi Square integration settings
Testing
Sandbox Environment
- Use Sandbox credentials
- Use Square test card numbers:
- Success:
4532 0000 0000 0000 - Decline:
4000 0000 0000 0002
- Success:
- Test complete payment flow
Test Scenarios
Verify:
- Successful payment → access granted
- Declined card → error message
- Cancelled payment → return to portal
- Webhook delivery → access automation
Transaction Management
Square Dashboard
View transactions in Square Dashboard:
- Payment history
- Refund processing
- Customer information
- Sales reports
IronWifi Logs
Track in IronWifi:
- Payment attempts
- Success/failure rates
- Plan popularity
- Revenue metrics
Receipts
Digital Receipts
Square can send receipts:
- In Square Dashboard > Receipts
- Configure email receipts
- Customize receipt content
Include WiFi Details
Add to receipt notes:
WiFi Access: {{plan_name}}
Duration: {{duration}}
Network: {{ssid}}
Refunds
Process Refund
- In Square Dashboard > Transactions
- Find the transaction
- Click Issue Refund
- Enter refund amount
Partial Refunds
Square supports partial refunds:
- Refund specific amount
- Keep remaining balance
- Access continues until manually revoked
Security
PCI Compliance
Square handles card security:
- Card data never touches your servers
- Square is PCI DSS Level 1 compliant
- Tokenization protects sensitive data
Fraud Prevention
Square includes:
- Risk assessment
- Velocity checks
- Address verification
- CVV verification
Reporting
Square Reports
Access in Square Dashboard:
- Sales summary
- Payment methods
- Time-based analysis
- Item sales (plans)
Custom Reports
Export data for:
- Revenue by plan
- Peak usage times
- Conversion rates
- Average transaction value
Multi-Location
Location-Based Pricing
Different pricing per location:
- Set up multiple Square locations
- Configure IronWifi per-location settings
- Map location to appropriate pricing
Consolidated Reporting
View all locations in Square Dashboard.
Troubleshooting
Payment Failing
- Verify credentials (Application ID, Access Token)
- Check Location ID is correct
- Review Square transaction logs
- Test card numbers
Access Not Granted
- Confirm payment in Square Dashboard
- Check webhook was received
- Verify IronWifi configuration
- Review error logs
Webhook Issues
- Verify webhook URL
- Check signature key
- Review Square webhook logs
- Test webhook delivery
Best Practices
- Test in sandbox before production
- Clear pricing on portal
- Quick checkout - minimize steps
- Receipt confirmation for customers
- Monitor daily for issues