Example #1
0
 public Order(string invoiceNumber = null, string description = null, decimal? totalAmount = null, OrderItem[] orderItems = null)
 {
     InvoiceNumber = invoiceNumber;
     Description = description;
     TotalAmount = totalAmount;
     OrderItems = orderItems;
 }
Example #2
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);
        }