Payment Integration Overview
Gully Sports supports two enterprise-grade payment providers with seamless switching via feature flags. Choose the provider that best fits your business needs.
Supported Providersโ
Intuit QuickBooks Paymentsโ
Best For: Businesses already using QuickBooks for accounting
Key Features:
- ๐ณ Cards (Visa, Mastercard, Amex, Discover)
- ๐ Apple Pay
- ๐ฆ ACH Bank Transfers
- ๐ฐ PayPal & Venmo
- ๐ Direct QuickBooks integration
- ๐งพ Automatic invoice generation
- ๐ OAuth 2.0 authentication
Payment Methods Supported:
- Credit/Debit Cards
- Apple Pay
- ACH (Bank Transfer)
- PayPal
- Venmo
Squareโ
Best For: Modern businesses wanting flexible payment options
Key Features:
- ๐ณ Cards (Visa, Mastercard, Amex, Discover)
- ๐ Apple Pay
- ๐ต Google Pay
- ๐ Square Gift Cards
- ๐ฑ Mobile-optimized
- โก Fast integration
- ๐ Real-time processing
Payment Methods Supported:
- Credit/Debit Cards
- Apple Pay
- Google Pay
- Square Gift Cards
Quick Comparisonโ
| Feature | Intuit QuickBooks | Square |
|---|---|---|
| Cards | โ | โ |
| Apple Pay | โ | โ |
| Google Pay | โ | โ |
| ACH/Bank Transfer | โ | โ |
| PayPal | โ | โ |
| Venmo | โ | โ |
| Gift Cards | โ | โ (Square only) |
| QuickBooks Integration | โ Native | โ |
| Setup Complexity | Medium (OAuth) | Easy |
| Best For | Accounting users | General commerce |
Switching Providersโ
Change payment providers instantly with a single environment variable:
# Use Intuit QuickBooks
NEXT_PUBLIC_PAYMENT_PROVIDER=intuit
# Use Square
NEXT_PUBLIC_PAYMENT_PROVIDER=square
The application automatically:
- โ Loads the correct SDK
- โ Renders appropriate payment forms
- โ Handles provider-specific logic
- โ Stores payment method correctly
- โ Updates checkout UI
Switch providers without modifying code - just update the environment variable!
Setup Overviewโ
Option 1: Intuit QuickBooksโ
- Create Intuit Developer Account
- Set Up OAuth - Configure QuickBooks connection
- Get SDK Token - Obtain embedded payment token
- Configure Environment Variables
NEXT_PUBLIC_PAYMENT_PROVIDER=intuit
NEXT_PUBLIC_INTUIT_SDK_TOKEN="your-sdk-token"
NEXT_PUBLIC_INTUIT_COMPANY_ID="your-company-id"
NEXT_PUBLIC_COMPANY_NAME="Your Business Name"
INTUIT_CLIENT_ID="your-client-id"
INTUIT_CLIENT_SECRET="your-client-secret"
INTUIT_REDIRECT_URI="http://localhost:3000/api/admin/intuit/callback"
INTUIT_ENCRYPTION_KEY="your-32-character-encryption-key"
- Complete OAuth Flow - Authorize via admin dashboard
Complete Intuit Setup Guide โ
Option 2: Squareโ
- Create Square Developer Account
- Get Application ID - Create Square application
- Configure Environment Variables
NEXT_PUBLIC_PAYMENT_PROVIDER=square
NEXT_PUBLIC_SQUARE_APPLICATION_ID="your-application-id"
NEXT_PUBLIC_SQUARE_LOCATION_ID="your-location-id"
NEXT_PUBLIC_SQUARE_ENVIRONMENT="sandbox" # or "production"
SQUARE_ACCESS_TOKEN="your-access-token"
- Test Payment Flow - Use Square test cards
Complete Square Setup Guide โ
Architectureโ
Payment Flowโ
User โ Checkout Form
โ
Payment Provider SDK (Client-Side)
โ
Tokenization
โ
API Route (/api/payments/submit)
โ
Payment Provider API (Server-Side)
โ
Database (Store Transaction)
โ
Success Page
Securityโ
- PCI Compliance: Payment data never touches your server
- Tokenization: Card details tokenized by provider SDKs
- HTTPS Only: All payment requests use SSL/TLS
- Idempotency: Prevent duplicate charges
- Server Validation: All payments verified server-side
File Structureโ
src/
โโโ app/
โ โโโ checkout/
โ โ โโโ CheckoutForm.tsx # Provider router
โ โ โโโ IntuitCheckoutForm.tsx # Intuit implementation
โ โ โโโ SquareCheckoutForm.tsx # Square implementation
โ โโโ api/
โ โโโ payments/
โ โโโ submit/
โ โโโ route.ts # Unified payment endpoint
โโโ utils/
โ โโโ featureFlags.ts # Provider selection
โ โโโ intuitPayments.ts # Intuit logic
โ โโโ squarePayments.ts # Square logic
Testingโ
Intuit Test Cardsโ
Card Number: 4111111111111111
Expiry: Any future date
CVV: 123
ZIP: Any 5 digits
Square Test Cardsโ
Success: 4111 1111 1111 1111
Decline: 4000 0000 0000 0002
CVV Required: 4002 0000 0000 0000
View Complete Testing Guide โ
Common Issuesโ
Payment Not Processingโ
Check:
- SDK loaded correctly (check browser console)
- API keys are valid and not expired
- Environment matches (sandbox vs production)
- Network requests not blocked
OAuth Failures (Intuit Only)โ
Check:
- Redirect URI matches exactly
- Client ID and secret are correct
- Token not expired (refresh if needed)
- Scopes include payment permissions
Google Pay Not Showing (Square)โ
Check:
- Using Chrome browser
- HTTPS enabled (localhost works)
- Amount is valid
- Location ID is correct
View Troubleshooting Guide โ
Migration Between Providersโ
Switching from one provider to another? Follow our migration guide:
Next Stepsโ
Choose your payment provider and follow the setup guide:
Need help deciding? Contact support or check our Payment Provider Selection Guide.