encryptCard static method

Future<EncryptedCard> encryptCard(
  1. UnencryptedCard card,
  2. String publicKey
)

Implementation

static Future<EncryptedCard> encryptCard(UnencryptedCard card, String publicKey) async {
  final cardDetails = {
    'number': card.number,
    'expiryMonth': card.expiryMonth,
    'expiryYear': card.expiryYear,
    'cvc': card.cvc,
    'cardHolderName': card.cardHolderName,
    'publicKey': publicKey,
  };

  final encryptDetails = await AdyenClientSideEncryptionPlatform.instance.encryptCard(cardDetails);

  return EncryptedCard(
    number: encryptDetails['number'],
    expiryMonth: encryptDetails['expiryMonth'],
    expiryYear: encryptDetails['expiryYear'],
    cvc: encryptDetails['cvc'],
    cardHolderName: encryptDetails['cardHolderName'],
  );
}