pay_unit_sdk 0.0.15 pay_unit_sdk: ^0.0.15 copied to clipboard
A new Flutter package to pay bill with Pay unit system.
pay_unit_sdk #
A new Flutter package.
Getting Started #
This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
To use this package, all you need to do is apply the PayUnitButton button in your widget and enter the requested information as a parameter as in the example below. #
Add mavenCentral() to allprojects in gradle > build.gradle .
allprojects {
repositories {
google()
mavenCentral() <---
jcenter()
}
}
Simple to integrate in your Code .
void main() => runApp(App());
class App extends StatelessWidget {
@override
Widget build(BuildContext context) => MaterialApp(
home: Scaffold(
body: Home(),
),
);
}
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 1,
backgroundColor
: Colors.white,
title: Text(
"Pay unit demo ",
style: TextStyle(color: Colors.black),
),
centerTitle: true,
),
body: Center(
child: Padding(
padding: EdgeInsets.only(left: 30, right: 30),
child: PayUnitButton(
apiKey: "<Your apiKey>",
apiUser: "<Your apiuser>",
apiPassword: "<Your apiPassword>",
sandbox: '<Your usage mode>',
transactionCallBackUrl: "<Your transactionCallBackUrl url>",
notiFyUrl: "<Your notification url>",
transactionAmount: "<Your transaction amount>",
text: "<Your Button text>",
color: <Custom color of the button Example: Colors.red>,
actionAfterProccess: (transactionId, transactionStatus) {
//here is the action who start after the end of the paiement , you can perform //some operation here , like display a alertDialog after the end of the payment.
AwesomeDialog(
dismissOnBackKeyPress: false,
dismissOnTouchOutside: false,
context: context,
dialogType: DialogType.SUCCES,
animType: AnimType.BOTTOMSLIDE,
title: "Pay unit",
desc: "Your transaction : $transactionId was successful",
btnOkColor: Colors.green,
btnOkText: "Continue",
btnOkOnPress: () async {
})
..show();
//Here we use Awesome dialog package to display a success message of the paiment
},
),
),
));
}
}