Ejemplo n.º 1
0
 public void CreditCardInfoConstructorTest()
 {
     Guid id = new Guid(); // TODO: Initialize to an appropriate value
     Guid customerId = new Guid(); // TODO: Initialize to an appropriate value
     string newCardNumber = string.Empty; // TODO: Initialize to an appropriate value
     int expiryMonth = 0; // TODO: Initialize to an appropriate value
     int expiryYear = 0; // TODO: Initialize to an appropriate value
     string newSecurityCode = string.Empty; // TODO: Initialize to an appropriate value
     string newCardType = string.Empty; // TODO: Initialize to an appropriate value
     CreditCardInfo target = new CreditCardInfo(id, customerId, newCardNumber, expiryMonth, expiryYear, newSecurityCode, newCardType);
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Ejemplo n.º 2
0
        public static CreditCardInfo ToCreditCard(this DataRow row)
        {
            CreditCardInfo card = new CreditCardInfo(row.GetString("CreditCardInfo"));
            card.Id = row.GetGuid("Id");
            card.CustomerId = row.GetGuid("CustomerId");
            return card;

            //CreditCardInfo entity = null;
            //if (row["CreditCardInfo"] != System.DBNull.Value)
            //    entity = new CreditCardInfo((string)row["CreditCardInfo"]);
            //if (row["Id"] != System.DBNull.Value)
            //    entity.Id = (Guid)row["Id"];
            //if (row["CustomerId"] != System.DBNull.Value)
            //    entity.CustomerId = (Guid)row["CustomerId"];
            //return entity;
        }
Ejemplo n.º 3
0
 public void CreditCardInfoConstructorTest1()
 {
     string newEncryptedData = string.Empty; // TODO: Initialize to an appropriate value
     CreditCardInfo target = new CreditCardInfo(newEncryptedData);
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Ejemplo n.º 4
0
 public static bool CheckForDuplicationCardInfo(ref CreditCardInfo entity)
 {
     if (entity.CustomerId != Guid.Empty)
     {
         entity.ChangeDecryptionStatus(true);
         List<CreditCardInfo> creditCardInfoList = GetCreditCardsByCustomer(entity.CustomerId);
         foreach (CreditCardInfo objCreditCardInfo in creditCardInfoList)
         {
             if (entity.CustomerId   == objCreditCardInfo.CustomerId &
                 entity.CardNumber   == objCreditCardInfo.CardNumber &
                 entity.SecurityCode == objCreditCardInfo.SecurityCode)
                 return true;
         }
         entity.ChangeDecryptionStatus(false);
     }
     return false;
 }
Ejemplo n.º 5
0
 public static void CreateCreditCard(ref CreditCardInfo entity)
 {
     DbCommand cmd = SqlHelpers.CreateCommand(ConnectionString);
     //cmd.CommandText = @"bill_CreditCard_Insert";
     cmd.CommandText = @"bill_CreditCard_InsertOrUpdate";
     cmd.AddInputParam("@Id", DbType.Guid, entity.Id);
     cmd.AddInputParam("@CustomerId", DbType.Guid, entity.CustomerId);
     cmd.AddInputParam("@CardInfo", DbType.String, entity.EncryptedData);
     int affectedRows = SqlHelpers.ExecuteNonQuery(cmd);
 }
Ejemplo n.º 6
0
 public static void Refund(GatewayInfo gateway, GatewayTypeInfo gatewayType, Guid orderId, ICustomer customer, CreditCardInfo card, string refID, TransactionInfo transaction, bool testTransaction)
 {
     Instance.Refund(gateway, gatewayType, orderId, customer, card, refID, transaction, testTransaction);
 }
Ejemplo n.º 7
0
 public static TransactionInfo PreAuthorize(GatewayInfo gateway, GatewayTypeInfo gatewayType, Guid orderId, ICustomer customer, CreditCardInfo card, decimal amount, bool testTransaction)
 {
     TransactionInfo transactionInfo = null;
     LoadProviders();
     transactionInfo = _providers[gatewayType.ProviderName].PreAuthorize(gateway, gatewayType, orderId, customer, card, amount, testTransaction);
     return transactionInfo;
 }
Ejemplo n.º 8
0
 public abstract void Refund(GatewayInfo gateway, GatewayTypeInfo gatewayType, Guid orderId, ICustomer customer, CreditCardInfo card, string refID, TransactionInfo transaction, bool testTransaction);
Ejemplo n.º 9
0
 public abstract TransactionInfo PreAuthorize(GatewayInfo gateway, GatewayTypeInfo gatewayType, Guid orderId, ICustomer customer, CreditCardInfo card, decimal amount, bool testTransaction);
Ejemplo n.º 10
0
 public abstract TransactionInfo ProcessSubscription(ref SubscriptionInfo sub, GatewayInfo gateway, GatewayTypeInfo gatewayType, ICustomer customer, CreditCardInfo card, bool isTrial, bool testTransaction);