protected void CreateGatewayDialog_OkButtonClicked(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            GatewayInfo gateway = new GatewayInfo();

            try
            {
                gateway.GatewayTypeId   = new Guid(((DropDownList)CreateGatewayDialog.FindControl("ddlType")).SelectedValue);
                gateway.Name = GatewayNameTextBox.Text;
                gateway.TransactionFee = decimal.Parse(TransactionFeeTextBox.Text);
                gateway.ChargebackFee = decimal.Parse(ChargeBackFeeTextBox.Text);
                gateway.TransactionKey = TransactionKeyTextBox.Text;
                gateway.LoginId = LoginIDTextBox.Text;
                gateway.Password = PasswordTextBox.Text;
                gateway.MaxAmount = decimal.Parse(MaxAmountTextBox.Text);   
                BillingController.CreateGateway(ref gateway);
                OnGatewayCreated(EventArgs.Empty);

            }
            catch (Exception ex)
            {

            }
        }
        else
        {
            ValidationHelper.SetFocusToFirstError(this.Page, "create_gateway");
        }
    }
Exemplo n.º 2
0
        public static GatewayInfo ToGateway(this DataRow row)
        {
            GatewayInfo entity = new GatewayInfo();

            if (row["Id"] != System.DBNull.Value)
                entity.Id = (Guid)row["Id"];
            if (row["GatewayTypeId"] != System.DBNull.Value)
                entity.GatewayTypeId = (Guid)row["GatewayTypeId"];
            if (row["TransactionFee"] != System.DBNull.Value)
                entity.TransactionFee = (decimal)row["TransactionFee"];
            if (row["ChargebackFee"] != System.DBNull.Value)
                entity.ChargebackFee = (decimal)row["ChargebackFee"];

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

            if (row["LoginId"] != System.DBNull.Value)
                entity.LoginId = (string)row["LoginId"];
            if (row["TransactionKey"] != System.DBNull.Value)
                entity.TransactionKey = (string)row["TransactionKey"];
            if (row["MaxAmount"] != System.DBNull.Value)
                entity.MaxAmount = (decimal)row["MaxAmount"];




            return entity;
        }
Exemplo n.º 3
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.º 4
0
 public void TransactionKeyTest()
 {
     GatewayInfo target = new GatewayInfo(); // TODO: Initialize to an appropriate value
     string expected = string.Empty; // TODO: Initialize to an appropriate value
     string actual;
     target.TransactionKey = expected;
     actual = target.TransactionKey;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Exemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (GatewayID == null)
            Response.Redirect("Default.aspx");

        _gateway = BillingController.GetGateway((Guid)GatewayID);

        if (!IsPostBack)
            DataBind();
    }
Exemplo n.º 6
0
 public void TransactionFeeTest()
 {
     GatewayInfo target = new GatewayInfo(); // TODO: Initialize to an appropriate value
     Decimal expected = new Decimal(); // TODO: Initialize to an appropriate value
     Decimal actual;
     target.TransactionFee = expected;
     actual = target.TransactionFee;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Exemplo n.º 7
0
 public void GatewayInfoConstructorTest()
 {
     GatewayInfo target = new GatewayInfo();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Exemplo n.º 8
0
 public void GatewayTypeIdTest()
 {
     GatewayInfo target = new GatewayInfo(); // TODO: Initialize to an appropriate value
     Guid expected = new Guid(); // TODO: Initialize to an appropriate value
     Guid actual;
     target.GatewayTypeId = expected;
     actual = target.GatewayTypeId;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Exemplo n.º 9
0
 public static void DeleteGateway(GatewayInfo entity)
 {
     DbCommand cmd = SqlHelpers.CreateCommand(ConnectionString);
     cmd.CommandText = @"bill_Gateway_Delete";
     cmd.AddInputParam("@Id", DbType.Guid, entity.Id);
     int affectedRows = SqlHelpers.ExecuteNonQuery(cmd);
 }
Exemplo n.º 10
0
        public static void CreateGateway(ref GatewayInfo entity)
        {
            DbCommand cmd = SqlHelpers.CreateCommand(ConnectionString);
            cmd.CommandText = @"bill_Gateway_Insert";
            cmd.AddInputParam("@Id", DbType.Guid, entity.Id);
            //cmd.AddInputParam("@ApplicationId", DbType.Guid, new Guid(ApplicationId));
            cmd.AddInputParam("@ApplicationName", DbType.String, System.Web.Security.Membership.Provider.ApplicationName);
            cmd.AddInputParam("@GatewayTypeId", DbType.Guid, entity.GatewayTypeId);
            cmd.AddInputParam("@Name", DbType.String, entity.Name);
            cmd.AddInputParam("@TransactionFee", DbType.Currency, entity.TransactionFee);
            cmd.AddInputParam("@ChargebackFee", DbType.Currency, entity.ChargebackFee);
            cmd.AddInputParam("@Password", DbType.String, entity.Password);
            cmd.AddInputParam("@LoginId", DbType.String, entity.LoginId);
            cmd.AddInputParam("@TransactionKey", DbType.String, entity.TransactionKey);
            cmd.AddInputParam("@MaxAmount", DbType.Currency, entity.MaxAmount );
            int affectedRows = SqlHelpers.ExecuteNonQuery(cmd);

        }
Exemplo n.º 11
0
        public static void UpdateGateway(GatewayInfo entity)
        {
            DbCommand cmd = SqlHelpers.CreateCommand(ConnectionString);
            cmd.CommandText = @"bill_Gateway_Update";
            cmd.AddInputParam("@Id", DbType.Guid, entity.Id);
            cmd.AddInputParam("@GatewayTypeId", DbType.Guid, entity.GatewayTypeId);
            cmd.AddInputParam("@Name", DbType.String, entity.Name);
            cmd.AddInputParam("@TransactionFee", DbType.Currency, entity.TransactionFee);
            cmd.AddInputParam("@ChargebackFee", DbType.Currency, entity.ChargebackFee);
            cmd.AddInputParam("@Password", DbType.String, entity.Password);
            cmd.AddInputParam("@LoginId", DbType.String, entity.LoginId);
            cmd.AddInputParam("@TransactionKey", DbType.String, entity.TransactionKey);
            cmd.AddInputParam("@MaxAmount", DbType.Currency, entity.MaxAmount);
            int affectedRows = SqlHelpers.ExecuteNonQuery(cmd);

        }
Exemplo n.º 12
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.º 13
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.º 14
0
 public abstract void Refund(GatewayInfo gateway, GatewayTypeInfo gatewayType, Guid orderId, ICustomer customer, CreditCardInfo card, string refID, TransactionInfo transaction, bool testTransaction);
Exemplo n.º 15
0
 public abstract TransactionInfo PreAuthorize(GatewayInfo gateway, GatewayTypeInfo gatewayType, Guid orderId, ICustomer customer, CreditCardInfo card, decimal amount, bool testTransaction);
Exemplo n.º 16
0
 public abstract TransactionInfo ProcessSubscription(ref SubscriptionInfo sub, GatewayInfo gateway, GatewayTypeInfo gatewayType, ICustomer customer, CreditCardInfo card, bool isTrial, bool testTransaction);