maishapay_payment_plugin_v1_0 1.0.1-dev.1 copy "maishapay_payment_plugin_v1_0: ^1.0.1-dev.1" to clipboard
maishapay_payment_plugin_v1_0: ^1.0.1-dev.1 copied to clipboard

Est un plugin Flutter simple et sécurisé qui fournit une interface unifiée pour intégrer les passerelles de paiement populaires (Mobile monney, Visa, Mastercard, Stripe, PayPal, etc.) dans votre appli [...]

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:maishapay_payment_plugin_v1_0/payment_plugin.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(home: HomePage());
  }
}

class HomePage extends StatelessWidget {
  final String apiKey =
      r"MP-LIVEPK-kK6yCY09V1j/3X4UTIWYWc092Wrf.7XqX/02APnoJQXRl$cs$V0X$Umlc3qshIULdX$1I5O8mz5jhZ$mmTTGyCnOtSRkOLS5AWwkFus0Cpeic.rCPcg1b2$H";
  final String secreteKey =
      r"MP-LIVEPK-TpJWW05QUG$$qsjh7bcyye2Lu..zUF$O19NmSnTA3y$oGC$yuYZ4q7A7Hx2yA1Q0rzBw5/b8Z0tgGVG1FiaUb17yVNweyrkX04O9DSELs7k$tO1yHBXwFOgH";
  final double amount = 100.0;
  final String orderId = 'CMD-${DateTime.now().millisecondsSinceEpoch}';
  final String callbackUrl = "https://your_domaine.com/mobile_calback";

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Plugin Paiement Demo')),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
              onPressed: () => _launchPayment(context),
              child: Text('Lancer le Paiement'),
            ),
          ],
        ),
      ),
    );
  }

  void _launchPayment(BuildContext context) async {
    try {
      final result = await PaymentPlugin.launchQuickPayment(
        context: context,
        apiKey: apiKey,
        amount: amount,
        orderId: orderId,
        customerEmail: '[email protected]',
        customerPhone: '+221771234567',
        currency: "CDF",
        customerName: "Grace Divine",
        apisecretekey: secreteKey,
        callbackUrl: callbackUrl,
        gatwaymode: "1",
        customerFirstname: "Grace",
        customerLastname: "Divine",
        customerAddress: "306 av de la gombe",
        customerCity: "Kinshasa",
      );

      // Afficher le résultat
      showDialog(
        context: context,
        builder: (context) => AlertDialog(
          title: Text('Résultat du Paiement'),
          content: Text(
            'Status: ${result?.transactionStatus}\n'
            'Transaction ID: ${result?.transactionId}\n'
            'Amount: ${result?.order.cost.amount} ${result?.order.cost.currency}\n'
            'Message: ${result?.transactionStatus}',
          ),
          actions: [
            TextButton(
              onPressed: () => Navigator.of(context).pop(),
              child: Text('OK'),
            ),
          ],
        ),
      );
    } catch (e) {
      print('Erreur: $e');
    }
  }
}
1
likes
120
points
37
downloads

Publisher

unverified uploader

Weekly Downloads

Est un plugin Flutter simple et sécurisé qui fournit une interface unifiée pour intégrer les passerelles de paiement populaires (Mobile monney, Visa, Mastercard, Stripe, PayPal, etc.) dans votre application mobile.

Homepage

Documentation

API reference

License

unknown (license)

Dependencies

clipboard, dartdoc, dio, flutter, http, internet_connection_checker, plugin_platform_interface, shared_preferences, url_launcher, webview_flutter

More

Packages that depend on maishapay_payment_plugin_v1_0

Packages that implement maishapay_payment_plugin_v1_0