navigateToCard method

Future<void> navigateToCard(
  1. Locale locale,
  2. String transactionId,
  3. OnPayCallback onPay,
  4. EventCallback? log,
)

Navigate to the card payment screen.

This method launches the card payment interface where users can enter their card details and complete the payment process.

Parameters

  • locale - Locale for the payment screen UI
  • transactionId - Unique identifier for this transaction
  • onPay - Callback function called when payment is completed
  • log - Optional callback for logging payment events

Usage

await cardSdk.navigateToCard(
  Locale('en'),
  'txn_12345',
  (result) {
    if (result.isSuccess) {
      print('Payment successful: ${result.transactionId}');
    } else {
      print('Payment failed: ${result.error}');
    }
  },
  (event) =&gt; print('Payment event: $event'),
);

Implementation

Future<void> navigateToCard(
  Locale locale,
  String transactionId,
  OnPayCallback onPay,
  EventCallback? log,
) async {
  await AmwalSdkNavigator.instance.toCardScreen(
    locale: locale,
    transactionId: transactionId,
    onPay: onPay,
    log: log,
  );
}