paytmpayments_allinonesdk
Use this package as a library
- Depend on it
Add this to your package's pubspec.yaml file:
dependencies:
paytmpayments_allinonesdk: ^1.0.4
- 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_allinonesdk/paytmpayments_allinonesdk.dart';
- Call transaction method
try {
var response = PaytmPaymentsAllinonesdk().startTransaction(
mid, orderId, amount, txnToken, callbackUrl, isStaging, restrictAppInvoke);
response.then((value) {
print(value);
setState(() {
result = value.toString();
});
}).catchError((onError) {
if (onError is PlatformException) {
setState(() {
result = onError.message + " \n " + onError.details.toString();
});
} else {
setState(() {
result = onError.toString();
});
}
});
} catch (err) {
result = err.message;
}