paytm_customuisdk 1.0.0
paytm_customuisdk: ^1.0.0 copied to clipboard
Flutter plugin for Paytm custom ui sdk
paytm_customuisdk #
Use this package as a library #
- Depend on it
Add this to your package's pubspec.yaml file:
dependencies:
paytm_routersdk: ^1.0.0
- Install it
You can install packages from the command line:
with Flutter:
$ flutter pub get
Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.
- Import it
Now in your Dart code, you can use:
import 'package:paytm_customuisdk/paytm_customuisdk.dart';
- Call transaction method as sample below
void getUpiIntentList() {
PaytmCustomUiSDK().getUpiIntentList().then((value) {
print(value);
setState(() {
upiAppList = UpiAppList.fromJson(value);
});
}).catchError((onError) {
if (onError is PlatformException) {
Utils.showMessage(context,
"${onError.message.toString()} \n ${onError.details.toString()}");
} else {
Utils.showMessage(context, onError.toString());
}
});
}
void goForUpiIntentTransaction(String appName) {
PaytmCustomUiSDK().goForUpiIntentTransaction(appName, paymentFlow).then((value) {
print(value);
Utils.showMessage(context, value.toString(), true);
}).catchError((onError) {
if (onError is PlatformException) {
Utils.showMessage(context,
"${onError.message.toString()} \n ${onError.details.toString()}");
} else {
Utils.showMessage(context, onError.toString());
}
});
}