Skip to main content

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

View Intuit Setup Guide โ†’

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

View Square Setup Guide โ†’

Quick Comparisonโ€‹

FeatureIntuit QuickBooksSquare
Cardsโœ…โœ…
Apple Payโœ…โœ…
Google PayโŒโœ…
ACH/Bank Transferโœ…โŒ
PayPalโœ…โŒ
Venmoโœ…โŒ
Gift CardsโŒโœ… (Square only)
QuickBooks Integrationโœ… NativeโŒ
Setup ComplexityMedium (OAuth)Easy
Best ForAccounting usersGeneral 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
Zero Code Changes

Switch providers without modifying code - just update the environment variable!

Setup Overviewโ€‹

Option 1: Intuit QuickBooksโ€‹

  1. Create Intuit Developer Account
  2. Set Up OAuth - Configure QuickBooks connection
  3. Get SDK Token - Obtain embedded payment token
  4. 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"
  1. Complete OAuth Flow - Authorize via admin dashboard

Complete Intuit Setup Guide โ†’

Option 2: Squareโ€‹

  1. Create Square Developer Account
  2. Get Application ID - Create Square application
  3. 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"
  1. 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:

View 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.