GuidesCustomerApple Pay

Apple Pay

Staccato supports Apple Pay for contactless payment at checkout.

Requirements

  • iOS device with Apple Pay support
  • At least one card added to Apple Wallet
  • Merchant ID: merchant.com.staccato.coffee

Supported Networks

  • Visa
  • Mastercard
  • American Express
  • Discover

How It Works

  1. At checkout, customer selects Apple Pay as payment method
  2. ApplePayService.createPaymentRequest() builds the payment request with:
    • Itemized summary (subtotal, tax, tip)
    • Merchant identifier
    • Currency: USD, Country: US
  3. System presents the Apple Pay sheet
  4. Customer authenticates with Face ID or Touch ID
  5. Payment token is sent to SquarePaymentService.processApplePayPayment()
  6. Token is base64-encoded and sent to the process-payment Edge Function
  7. Square processes the payment
  8. Order is created on success

Device Check

var isApplePayAvailable: Bool {
    // Checks PKPaymentAuthorizationController.canMakePayments()
    return true
}

Debug Mode

When Square is not configured (sandbox mode), Apple Pay simulates a successful payment with a 500ms delay and returns a debug payment ID. This allows testing the full checkout flow without real payment processing.

Setup for Developers

See the Apple Pay Setup guide for:

  • Creating the merchant ID in Apple Developer Portal
  • Generating payment processing certificates
  • Uploading certificates to Square Dashboard
  • Configuring the Xcode entitlement