toCardOptionScreen method
Future<void>
toCardOptionScreen(
- RouteSettings settings,
- BuildContext context,
- Locale locale,
- OnPayCallback onPay,
- EventCallback? log,
Navigates to the manual card entry screen.
This method presents a screen where users can manually enter their card information, including card number, expiry date, and CVV.
Parameters:
settings
- Route settings containing payment argumentscontext
- The current build context for navigationlocale
- Locale setting for internationalizationonPay
- Callback function executed when payment is completedlog
- Optional callback for logging events and analytics
Payment Arguments
Extracts the following information from route settings:
- Currency and currency ID
- Terminal and merchant IDs
- Payment amount
- Transaction identifier
Example
await AmwalSdkNavigator.instance.toCardOptionScreen(
settings,
context,
const Locale('en'),
(result) => print('Manual card payment completed: $result'),
(event, params) => logEvent(event, params),
);
Navigates to the manual card entry screen.
Implementation
Future<void> toCardOptionScreen(
RouteSettings settings,
BuildContext context,
Locale locale,
OnPayCallback onPay,
EventCallback? log,
) async {
final arguments = settings.arguments as PaymentArguments;
await Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => SaleByCardManualScreen(
onPay: onPay,
locale: locale,
currency: arguments.currencyData!.name,
currencyId: arguments.currencyData!.idN,
terminalId: arguments.terminalId,
amount: arguments.amount,
merchantId: arguments.merchantId,
transactionId: arguments.transactionId,
log: log,
),
settings: settings,
),
);
}