Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        GatewayTypeInfo gti = new GatewayTypeInfo();

        gti.TestLoginId = "7wYB5c6R";
        gti.LiveUrl = "https://test.authorize.net/gateway/transact.dll";
        gti.TestUrl = "https://test.authorize.net/gateway/transact.dll";
        gti.TestTransactionKey = "4px54kx6ZZ7489Gq";
        gti.Id = Guid.NewGuid();
        gti.ProviderName = "ANetBillingProvider";

        GatewayInfo gi = new GatewayInfo();

        gi.Id = Guid.NewGuid();
        gi.GatewayTypeId = gti.Id;
        gi.ChargebackFee = 1;
        gi.TransactionFee = 10;
        gi.TransactionKey = "4px54kx6ZZ7489Gq";
        gi.Password = "******";
        gi.LoginId = "7wYB5c6R";
        gi.Name = "ANetBillingProvider";
      
        Customer cust = new Customer();

        CreditCardInfo cci = new CreditCardInfo(Guid.NewGuid(), Guid.NewGuid(), "6011000000000012", 3, 2009, "0421", "Visa");
        cci.ChangeDecryptionStatus(true);
        BillingController.ProcessPayment(gi, gti, Guid.NewGuid(), cust, cci, 7, true);    
    }
Exemplo n.º 2
0
 public void TestUrlTest()
 {
     GatewayTypeInfo target = new GatewayTypeInfo(); // TODO: Initialize to an appropriate value
     string expected = string.Empty; // TODO: Initialize to an appropriate value
     string actual;
     target.TestUrl = expected;
     actual = target.TestUrl;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Exemplo n.º 3
0
        private static GatewayTypeInfo GetGatewayType(DataRow row)
        {
            GatewayTypeInfo entity = new GatewayTypeInfo();

            if (row["Id"] != System.DBNull.Value)
                entity.Id = (Guid)row["Id"];
            if (row["Name"] != System.DBNull.Value)
                entity.Name = (string)row["Name"];
            if (row["ProviderName"] != System.DBNull.Value)
                entity.ProviderName = (string)row["ProviderName"];

            if (row["LiveUrl"] != System.DBNull.Value)
                entity.LiveUrl = (string)row["LiveUrl"];
            if (row["TestUrl"] != System.DBNull.Value)
                entity.TestUrl = (string)row["TestUrl"];
            if (row["TestLoginId"] != System.DBNull.Value)
                entity.TestLoginId = (string)row["TestLoginId"];
            if (row["TestTransactionKey"] != System.DBNull.Value)
                entity.TestTransactionKey = (string)row["TestTransactionKey"];

            return entity;
        }
Exemplo n.º 4
0
 public static void DeleteGatewayType(GatewayTypeInfo info)
 {
     DbCommand cmd = SqlHelpers.CreateCommand(ConnectionString);
     cmd.CommandText = @"bill_GatewayType_Delete";
     cmd.AddInputParam("@Id", DbType.Guid, info.Id);
     int affectedRows = SqlHelpers.ExecuteNonQuery(cmd);
 }
Exemplo n.º 5
0
 public static void CreateGatewayType(ref GatewayTypeInfo entity)
 {
     DbCommand cmd = SqlHelpers.CreateCommand(ConnectionString);
     cmd.CommandText = @"bill_GatewayType_Insert";
     cmd.AddInputParam("@Id", DbType.Guid, entity.Id);
     cmd.AddInputParam("@Name", DbType.String, entity.Name);
     cmd.AddInputParam("@ProviderName", DbType.String, entity.ProviderName);
     cmd.AddInputParam("@LiveUrl", DbType.String, entity.LiveUrl);
     cmd.AddInputParam("@TestUrl", DbType.String, entity.TestUrl);
     cmd.AddInputParam("@TestLoginId", DbType.String, entity.TestLoginId);
     cmd.AddInputParam("@TestTransactionKey", DbType.String, entity.TestTransactionKey);
     int affectedRows = SqlHelpers.ExecuteNonQuery(cmd);
 }
Exemplo 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);
 }
Exemplo 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;
 }
Exemplo n.º 8
0
 public void GatewayTypeInfoConstructorTest()
 {
     GatewayTypeInfo target = new GatewayTypeInfo();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Exemplo n.º 9
0
 public void IdTest()
 {
     GatewayTypeInfo target = new GatewayTypeInfo(); // TODO: Initialize to an appropriate value
     Guid expected = new Guid(); // TODO: Initialize to an appropriate value
     Guid actual;
     target.Id = expected;
     actual = target.Id;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Exemplo n.º 10
0
 public abstract void Refund(GatewayInfo gateway, GatewayTypeInfo gatewayType, Guid orderId, ICustomer customer, CreditCardInfo card, string refID, TransactionInfo transaction, bool testTransaction);
Exemplo n.º 11
0
 public abstract TransactionInfo PreAuthorize(GatewayInfo gateway, GatewayTypeInfo gatewayType, Guid orderId, ICustomer customer, CreditCardInfo card, decimal amount, bool testTransaction);
Exemplo n.º 12
0
 public abstract TransactionInfo ProcessSubscription(ref SubscriptionInfo sub, GatewayInfo gateway, GatewayTypeInfo gatewayType, ICustomer customer, CreditCardInfo card, bool isTrial, bool testTransaction);