Payment Basics
ShipFlutter provides a flexible payment system that adapts to different platforms:
- Mobile: RevenueCat for App Store and Google Play
- Web: LemonSqueezy for web payments
Structure
The payment system is organized into client and server components:
Directoryapp/
Directorylib/core/account/payments/
Directorymobile/ // RevenueCat implementation
- …
Directoryweb/ // LemonSqueezy implementation
- …
Directorymodels/ // Shared payment models
- …
Directoryui/ // Payment UI components
- …
- payments_service.dart // Platform-agnostic interface
Directoryweb/payment/
- lemon_squeezy.js // LemonSqueezy SDK interop
Directoryfunctions/src/payment/
- revenue_cat.ts // Mobile webhooks
- lemon_squeezy.ts // Web webhooks
- payments_schema.ts // Shared types
Basic Usage
Payment Models
The system uses these core models:
Paywall and Trial UI
ShipFlutter includes responsive and ready-to-use payment UI components that are compliant with Apple App Store and Google Play store. The UI automatically adapts to the platform (mobile/web) and handles all payment flows.
Webhooks Integration
The payment system uses Firebase Functions to handle webhooks from both providers:
-
RevenueCat -
/api/v1/payment/event/rc
- Handles subscription events
- Updates entitlements
- Manages trial periods
-
LemonSqueezy -
/api/v1/payment/event/ls
- Processes web payments
- Manages subscription lifecycle
- Syncs product data
Next Steps
-
Set up payment providers:
- RevenueCat Setup for mobile
- LemonSqueezy Setup for web
-
Configure Entitlements to manage user access
-
Customize the payment UI to match your app’s design