Exemple #1
0
        public static V2.CreditCardData GetCardData(V1.ICreditCardDataReader cardReader, String2DateConverterFunc expirationDateConverter = null)
        {
            Dictionary <string, string> cardData = new Dictionary <string, string>();

            cardReader.ReadData(cardData);
            var    v2CardData = new V2.CreditCardData();
            string value;

            if (cardData.TryGetValue(cardReader.Key_PMCCProcessingID, out value))
            {
                v2CardData.PaymentProfileID = value;
            }
            if (cardData.TryGetValue(cardReader.Key_CardNumber, out value))
            {
                v2CardData.CardNumber = value;
            }
            if (cardData.TryGetValue(cardReader.Key_CardCVV, out value))
            {
                v2CardData.CVV = value;
            }
            if (expirationDateConverter != null)
            {
                if (cardData.TryGetValue(cardReader.Key_CardExpiryDate, out value))
                {
                    v2CardData.CardExpirationDate = expirationDateConverter(value);
                }
            }
            else
            {
                v2CardData.CardExpirationDate = null;
            }

            return(v2CardData);
        }
 protected CardProcessingReadersProvider(CCProcessingContext context)
 {
     _context = context;
     _string2DateConverter = _context.expirationDateConverter;
 }
Exemple #3
0
 public CardProcessingReadersProvider(CCProcessingContext context)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
     _string2DateConverter = _context.expirationDateConverter;
 }