Smart Pay

Unified payments for Flutter with a single API. Configure Stripe today, more gateways soon, and present a unified checkout experience.


Platform Pub Package License: MIT Pub Points Popularity Pub Likes Dart SDK >= 3.8


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 options
  • SmartPay.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

Need Help?

What's Next?

  1. Choose your payment method from the table above
  2. Follow the setup guide for your chosen method
  3. Add more methods as needed - they all work the same way!

Made with ❀️ for Flutter developers

Libraries

smart_pay