Example #1
0
        public CustomerInfo(string email, string customerId, BillingAddress billingAddress, ShippingAddress shippingAddress, string customerIP = null)
        {
            if (string.IsNullOrWhiteSpace(email))
            {
                throw new ArgumentNullException(email);
            }
            if (string.IsNullOrWhiteSpace(customerId))
            {
                throw new ArgumentNullException(customerId);
            }
            if (billingAddress == null)
            {
                throw new ArgumentNullException("billingAddress");
            }
            if (shippingAddress == null)
            {
                throw new ArgumentNullException("shippingAddress");
            }

            Email           = email;
            CustomerId      = customerId;
            BillingAddress  = billingAddress;
            ShippingAddress = shippingAddress;
            CustomerIP      = customerIP;
        }
        public CustomerInfo(string email, string customerId, BillingAddress billingAddress, ShippingAddress shippingAddress, string customerIP = null)
        {
            if (string.IsNullOrWhiteSpace(email))
                throw new ArgumentNullException(email);
            if (string.IsNullOrWhiteSpace(customerId))
                throw new ArgumentNullException(customerId);
            if (billingAddress == null)
                throw new ArgumentNullException("billingAddress");
            if (shippingAddress == null)
                throw new ArgumentNullException("shippingAddress");

            Email = email;
            CustomerId = customerId;
            BillingAddress = billingAddress;
            ShippingAddress = shippingAddress;
            CustomerIP = customerIP;
        }
Example #3
0
        public void TestMethod_Auth()
        {
            var credentials = _configuration.GetConfigurationSettings();

            var card = new CreditCard("Visa", "4111000000111111", 10, 2014, "123");
            var transaction = new Transaction(80.25M, "USD", merchantRefId: Guid.NewGuid().ToString("N"));
            var billigAddress = new BillingAddress("FirstName", "LastName", "123 Elm Street", "Beverly Hills", "CA", "90210", "US");
            var shippingAddress = new ShippingAddress("FirstName", "LastName", "123 Elm Street", "Beverly Hills", "CA", "90210", "US");
            var customer = new CustomerInfo("*****@*****.**", "hpcitest1", billigAddress, shippingAddress, "173.32.21.248");
            var orderItem1 = new OrderItem("Item1", "ItemName1", "Item Description 1", "1", 2.00M, false);
            var orderItem2 = new OrderItem("Item2", "ItemName2", "Item Description 2", "1", 1.25M, false);
            var orderItems = new[] {orderItem1, orderItem2};
            var order = new Order("Order:", "Test Order", 4.25M, orderItems);

            var request = new AuthRequest(card, transaction, customer, order);
            var response = _service.Send(_converter, credentials, request);

            Assert.AreEqual(Status.Success, response.Status);
        }