예제 #1
0
        /// <summary>
        /// Returns a number indicating how Card compares to the card in the previous
        /// auth request for this transaction.
        /// 0 - No saved value or card number doesn't match
        /// 1 - Card number matches
        /// 3 - Card and CC_CV match
        /// 5 - Card and Expiration date match
        /// 7 - Exact match.
        /// This information is sent to the stored procedure Check_ReAuth, which uses it in
        /// conjunction with data from the database to determine if auth or reauth is OK, or
        /// to return the appropriate exception.
        /// </summary>
        /// <param name="Payment">The payment to be checked.</param>
        /// <returns></returns>
        public static int CheckCard(Payment Payment)
        {
            SavedCard S = (SavedCard)Cards[Reference(Payment)];

            if (S == null)
            {
                return(0);
            }
            CardInfo c      = S.Card;
            int      result = 0;

            if (c == null || c.CCNumber != Payment.Card.CCNumber)
            {
                return(result);
            }
            result++;
            if (c.CCCVNumber == Payment.Card.CCCVNumber)
            {
                result += 2;
            }
            if (c.CCExpMonth == Payment.Card.CCExpMonth && c.CCExpYear == Payment.Card.CCExpYear)
            {
                result += 4;
            }
            return(result);
        }
예제 #2
0
 /// <summary>
 /// Adds an entry in the dicationary.
 /// </summary>
 /// <param name="Payment">The payment to add.</param>
 internal static void Add(Payment Payment)
 {
     lock (Cards) {
         string Ref = Reference(Payment);
         if (Cards[Ref] == null)
         {
             Cards.Add(Ref, new SavedCard(Payment));
         }
         else
         {
             Cards[Ref] = new SavedCard(Payment);
         }
     }
 }
예제 #3
0
 /// <summary>
 /// Adds the item to the list.
 /// </summary>
 /// <param name="item">The card to add.</param>
 public void Add(SavedCard item)
 {
     InnerList.Add(item);
 }