initCreditCardWithTemplateInDatabase method

  1. @override
Future<void> initCreditCardWithTemplateInDatabase (
  1. CreditCardCreationRequest req
)
override

Implementation

@override
Future<void> initCreditCardWithTemplateInDatabase(
    CreditCardCreationRequest req) async {
  await Future.delayed(Duration(milliseconds: 200));
  if (cardDatabase.containsKey(req.cardData.id)) {
    throw Exception('The credit card has already existed');
  } else {
    cardDatabase[req.cardData.id] = req.cardData;
  }
}