paytmpayments_customuisdk
Use this package as a library
- Depend on it
Add this to your package's pubspec.yaml file:
dependencies:
paytmpayments_customuisdk: ^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:paytmpayments_customuisdk/paytmpayments_customuisdk.dart';
- Call transaction method as sample below
void getUpiIntentList() {
PaytmPaymentsCustomUiSDK().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) {
PaytmPaymentsCustomUiSDK().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());
}
});
}