Ejemplo n.º 1
0
        public void when_updating_a_refund_transaction()
        {
            var stubHttp = HttpMockRepository.At("http://localhost:9191");

            stubHttp.Stub(x => x.Put("/v2/transactions/refunds/321"))
            .Return(TaxjarFixture.GetJSON("refunds/show.json"))
            .OK();

            var refund = client.UpdateRefund(new
            {
                transaction_id = "321",
                amount         = 17.95,
                shipping       = 2,
                line_items     = new[] {
                    new {
                        quantity           = 1,
                        product_identifier = "12-34243-0",
                        description        = "Heavy Widget",
                        product_tax_code   = "20010",
                        unit_price         = 15,
                        discount           = 0,
                        sales_tax          = 0.95
                    }
                }
            });

            this.AssertRefund(refund);
        }