initCreditCard method

Future<void> initCreditCard (
  1. CreditCardCreationRequest req,
  2. {bool silent: false}
)

Implementation

Future<void> initCreditCard(CreditCardCreationRequest req,
    {bool silent = false}) async {
  try {
    status = DataBackendStatus.LOADING;
    if (!silent) {
      notifyListeners();
    }
    await initCreditCardInDatabase(req);
    status = DataBackendStatus.OUTDATED;
    creditCardsDirty = true;
    if (!silent) {
      notifyListeners();
    }
  } catch (err) {
    print(err.toString());
    status = DataBackendStatus.ERROR;
    if (!silent) {
      notifyListeners();
    } else {
      throw err;
    }
  }
}