showTransactionCancellationDialog static method
dynamic
showTransactionCancellationDialog({})
Implementation
static showTransactionCancellationDialog({
required int merchantId,
required String transactionId,
required String amount,
required int currency,
Function(String, Map<String, dynamic>)? log,
}) {
AmwalSdkNavigator.amwalNavigatorObserver.navigator!.pop();
Logar.info(
'Navigator popped from transaction util dialog',
tag: 'NAVIGATION',
);
AmwalSdkNavigator.amwalNavigatorObserver.navigator!.pop();
Logar.info(
'Navigator popped from transaction util dialog',
tag: 'NAVIGATION',
);
if (AmwalSdkNavigator.amwalNavigatorObserver.navigator != null) {
final context =
AmwalSdkNavigator.amwalNavigatorObserver.navigator!.context;
log?.call('payment_abandoned', {
"user_id": merchantId,
"transaction_id": transactionId,
"payment_amount": amount,
"payment_method": 'Pay by Card',
"currency": currency,
});
return showDialog(
context: context.mounted ? context : context,
builder: (_) => Localizations(
locale: AmwalSdkSettingContainer.locale,
delegates: const [...AppLocalizationsSetup.localizationsDelegates],
child: ErrorDialog(
locale: AmwalSdkSettingContainer.locale,
title: "err".translate(context),
message: "transaction_cancel".translate(context),
resetState: () {
AmwalSdkNavigator.amwalNavigatorObserver.navigator!.pop();
Logar.info(
'Navigator popped from transaction util dialog',
tag: 'NAVIGATION',
);
},
),
),
);
}
}