Пример #1
0
        public void when_creating_an_order_transaction()
        {
            var stubHttp = HttpMockRepository.At("http://localhost:9191");

            stubHttp.Stub(x => x.Post("/v2/transactions/orders"))
            .Return(TaxjarFixture.GetJSON("orders/show.json"))
            .WithStatus(HttpStatusCode.Created);

            var order = client.CreateOrder(new {
                transaction_id   = "123",
                transaction_date = "2015/05/04",
                to_country       = "US",
                to_zip           = "90002",
                to_city          = "Los Angeles",
                to_street        = "123 Palm Grove Ln",
                amount           = 17.95,
                shipping         = 2,
                sales_tax        = 0.95,
                line_items       = new[] {
                    new {
                        quantity           = 1,
                        product_identifier = "12-34243-0",
                        description        = "Heavy Widget",
                        product_tax_code   = "20010",
                        unit_price         = 15,
                        sales_tax          = 0.95
                    }
                }
            });

            this.AssertOrder(order);
        }