pay_unit_sdk 0.0.9 pay_unit_sdk: ^0.0.9 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()
}
}
And the classpath 'com.android.tools.build:gradle:3.5.0' to dependencies part
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
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(
text: "<Your Text>",
apiKey: "<Your apiKey>",
transactionCallBackUrl: "<Your transactionCallBackUrl url>",
notiFyUrl: "<Your notification url>",
transonAmount: "<Your transaction amount>",
color: <Custum color of the button Exple: Colors.red>,
apiUser: "<Your apiuser>",
apiPassword: "<Your apiPassword>",
sandbox: '<Your usage mode>',
actionAfterProccess: (transactionId, transactionStatus) {
//here is the action who start after the end of the paiement , you can perfom some //operation here , like display a alerDialog 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
},
),
),
));
}
}