Skip to main content

Payment Processing Guide

Learn how to integrate payment processing with Fanfare admission flows for secure, validated transactions.

Overview

When a consumer is admitted through Fanfare, they have a limited time window to complete their purchase. This guide covers integrating payment providers while validating admission status. What you’ll learn:
  • Validating admission before payment
  • Integrating with Stripe, PayPal, and other providers
  • Handling payment failures
  • Securing the payment flow
Complexity: Intermediate Time to complete: 35 minutes

Prerequisites

  • Checkout Overview guide completed
  • Payment provider account (Stripe, PayPal, etc.)
  • Backend server for secure payment processing

Payment Flow Architecture

Payment processing flow diagram showing admitted checkout, admission validation, payment completion, and retry on failure.

Stripe Integration

Fanfare-facing amounts should remain decimal strings such as "199.99". Convert to provider-specific minor units only when calling a payment provider, and use a currency-aware helper so zero-decimal currencies are handled correctly.

Step 1: Create Payment Intent with Admission Validation

Step 2: Frontend Payment Form

Step 3: Handle Stripe Webhooks

PayPal Integration

Step 1: Create PayPal Order

Step 2: PayPal Frontend

Error Handling

Payment Failures

Idempotency

Best Practices

1. Always Validate Before Payment

2. Don’t Invalidate on Payment Failure

3. Use Webhooks for Reliability

4. Monitor Payment + Admission Metrics

Troubleshooting

Payment Created But Admission Invalid

The admission may have expired between page load and payment submission:
  • Validate admission at payment creation time
  • Show clear expiration countdown to users
  • Handle gracefully with clear error messages

Double Charges

  • Use idempotency keys
  • Check for existing payments before creating new ones
  • Use webhooks as source of truth

What’s Next