createDeposit method

Future<void> createDeposit(
  1. OperationDepositMethod method,
  2. CountryCode country,
  3. Price nominal,
  4. Price? pricing,
)

Creates an OperationDeposit using the provided method, country, nominal and pricing.

Implementation

Future<void> createDeposit(
  OperationDepositMethod method,
  CountryCode country,
  Price nominal,
  Price? pricing,
) async {
  try {
    switch (method.kind) {
      case OperationDepositKind.paypal:
        await PayPalDepositView.show(
          router.context!,
          method: method,
          country: country,
          nominal: nominal,
        );
        break;

      case OperationDepositKind.artemisUnknown:
        throw Exception('Unsupported');
    }
  } catch (e) {
    MessagePopup.error(e);
    rethrow;
  }
}