startRavenPay method

  1. @override
Future<void> startRavenPay(
  1. BuildContext context, {
  2. double? amount,
  3. BankBoxLaunchPoint launchPoint = BankBoxLaunchPoint.home,
})
override

Implementation

@override
Future<void> startRavenPay(BuildContext context,
    {double? amount,
    BankBoxLaunchPoint launchPoint = BankBoxLaunchPoint.home}) async {
  initMethodChannel();

  paymentAmount = amount;

  if (launchPoint == BankBoxLaunchPoint.cardPayment) {
    await _launchBankBoxPage(
        context, const PurchaseAmount(title: "Enter Amount"));
    return;
  }

  if (launchPoint == BankBoxLaunchPoint.cardBalance) {
    showBankBoxLoader(context, message: 'loading, please wait...');
    var value = await processCardBalanceLaunchDirection(context);
    Navigator.pop(context);
    if (!value) {
      await _launchBankBoxPage(
          context,
          const ConnectBluetooth(
            paymentType: PaymentType.checkBalance,
            amount: 10.0,
          ));
      return;
    }
    await _launchBankBoxPage(
        context,
        InsertCard(
          paymentType: PaymentType.checkBalance,
          deviceName: pluginConfig.appInfo.deviceName ?? "",
          amount: 10,
        ));

    return;
  }
  if (launchPoint == BankBoxLaunchPoint.terminals) {
    await _launchBankBoxPage(context, const ViewAllTerminalIndex());
    return;
  }
  if (launchPoint == BankBoxLaunchPoint.paycode) {
    await _launchBankBoxPage(context, const PayWithCode());
    return;
  }
  if (launchPoint == BankBoxLaunchPoint.moneyCode) {
    await _launchBankBoxPage(context, const MoneyCodeScreen());
    return;
  }
  await _launchBankBoxPage(context, const RavenPayApp());
  return;
}