Smart Pay
One simple API for all payment methods in Flutter
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