Smart Pay
Unified payments for Flutter with a single API. Configure Stripe today, more gateways soon, and present a unified checkout experience.
What is Smart Pay?
Smart Pay gives you one simple API to accept payments from multiple providers. Add Stripe today, PayPal tomorrow - your code stays the same.
// Same code works for Stripe, PayPal, Razorpay, etc.
final result = await SmartPay.checkout(PayRequest(
amountMinorUnits: 1999, // $19.99
currency: 'USD',
));
Quick Start
1. Install
dependencies:
smart_pay: ^1.0.0
2. Choose Your Payment Methods
Payment Method | Status | Documentation |
---|---|---|
Stripe | ✅ Available | → Stripe Setup Guide |
PayPal | 🔄 Coming Soon | - |
Razorpay | 🔄 Coming Soon | - |
Apple Pay | 🔄 Coming Soon | - |
Google Pay | 🔄 Coming Soon | - |
3. Basic Setup
import 'package:smart_pay/smart_pay.dart';
void main() {
// Configure your payment methods
SmartPay.configure(SmartPayConfig(
providers: [
// Add your payment methods here
// See method-specific guides above ↗️
],
));
runApp(MyApp());
}
4. Show Payment Methods
// Shows available payment methods to user
SmartPayMethods(
store: SmartPay.store,
onMethodSelected: (method) {
print('User selected: ${method.displayName}');
},
)
5. Process Payment
// Process payment with selected method
final result = await SmartPay.checkout(PayRequest(
amountMinorUnits: 1999, // $19.99
currency: 'USD',
description: 'Your Order #1234',
));
if (result.success) {
print('Payment successful!');
} else {
print('Payment failed: ${result.message}');
}
How It Works
🎯 Smart Platform Detection
- Mobile (iOS/Android): Uses in-app payment UI when possible
- Web/Desktop: Uses secure payment pages
- Override: Force specific payment method if needed
🔧 Simple Configuration
- Add payment methods in
SmartPay.configure()
- Each method auto-detects the best mode for your platform
- Customize names, settings per method
🎨 Easy UI Integration
SmartPayMethods()
- Shows payment optionsSmartPay.checkout()
- Processes payments- Works with your existing UI/UX
Platform Support
Platform | SDK Mode | URL Mode | Notes |
---|---|---|---|
iOS | ✅ | ✅ | SDK preferred |
Android | ✅ | ✅ | SDK preferred |
Web | ❌ | ✅ | URL only |
macOS | ❌ | ✅ | URL only |
Windows | ❌ | ✅ | URL only |
Linux | ❌ | ✅ | URL only |
Examples
- Basic Example - Simple payment setup
- Stripe Guide - Complete Stripe integration
- Platform Detection - How auto-detection works
Need Help?
- 📖 Setup Guides - Step-by-step instructions
- ❓ FAQ - Common questions
- 🐛 Issues - Report bugs
- 💬 Discussions - Get help
What's Next?
- Choose your payment method from the table above
- Follow the setup guide for your chosen method
- Add more methods as needed - they all work the same way!
Made with ❤️ for Flutter developers