smat_pay_payment_plugin 1.0.6 copy "smat_pay_payment_plugin: ^1.0.6" to clipboard
smat_pay_payment_plugin: ^1.0.6 copied to clipboard

A payment plugin form for Smatpay users.

smat_pay_payment_plugin #

A Flutter payment plugin form for Smatpay users.


🚀 Getting Started #

Add this package to your pubspec.yaml:

dependencies:
  smat_pay_payment_plugin: ^<latest_version>

Then run:

flutter pub get

⚠️ Prerequisites #

Before using this plugin, ensure you have:

  • A valid payment code from Smatpay.
  • Your base URL and endpoint mode configured.

💡 Example Usage #

Use it anywhere in your app.

⚠️ Important: Setup locator before runApp. #

Sandbox

import 'package:flutter/material.dart';
import 'package:smat_pay_payment_plugin/app/app.locator.dart';
import 'package:smat_pay_payment_plugin/common/api_config.dart';
import 'package:smat_pay_payment_plugin/views/payment_form.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: PaymentForm(
        paymentCode: "dd59bd5a-175d-4832-b9ea-8de01494c742",
        baseUrl: 'https://dev.smatpay.africa:8443',
        endpointMode: EndpointMode.test,
      ),
    );
  }
}

Production

import 'package:flutter/material.dart';
import 'package:smat_pay_payment_plugin/app/app.locator.dart';
import 'package:smat_pay_payment_plugin/common/api_config.dart';
import 'package:smat_pay_payment_plugin/views/payment_form.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: PaymentForm(
        paymentCode: "dd59bd5a-175d-4832-b9ea-8de01494c742",
        baseUrl: 'https://live.smatpay.africa:8443',
        endpointMode: EndpointMode.live,
      ),
    );
  }
}

📄 License #

MIT © 2024 Udean Mbano


🙌 Contributing #

Contributions are welcome. Please fork the repository and submit a pull request for review.


💬 Support #

For any issues or feature requests, please open an issue on GitHub.



Replace:

  • <latest_version> with your current published version (e.g. 0.0.1)
  • GitHub links if using your organization’s repository.

Let me know if you need an **example **`` for your package publishing pipeline today.