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.
🔗 Links
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.
Libraries
- common/api_config
- common/build_text_field
- common/custom_app_bar
- common/validators
- models/payment_model
- services/payment_service
- smatpay_payment_plugin
- util/crypto_util
- util/models/request/encrypt_card_request
- util/models/request/track_payment_request
- util/models/response/generic_response
- util/models/response/track_payment_response
- util/models/response/transaction_info_response
- view_models/payment_viewmodel
- views/payment_failed
- views/payment_form
- views/payment_form.form
- views/payment_success