smart_pay 0.1.2 copy "smart_pay: ^0.1.2" to clipboard
smart_pay: ^0.1.2 copied to clipboard

Unified Flutter payments toolkit supporting Stripe Payment Sheets and Payment Links with automatic URL generation, manual handling, and provider-driven configuration.

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

1
likes
160
points
279
downloads

Publisher

verified publishermwaqas.mobvers.com

Weekly Downloads

Unified Flutter payments toolkit supporting Stripe Payment Sheets and Payment Links with automatic URL generation, manual handling, and provider-driven configuration.

Repository (GitHub)
View/report issues
Contributing

Topics

#payments #stripe #flutter #payment-processing #payment-gateway

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

flutter, flutter_stripe, http, url_launcher

More

Packages that depend on smart_pay