diff --git a/Library/Adjustment.cs b/Library/Adjustment.cs index fa63a954..04ddaf75 100644 --- a/Library/Adjustment.cs +++ b/Library/Adjustment.cs @@ -62,6 +62,8 @@ public enum RevenueSchedule : short public string TaxType { get; private set; } public decimal? TaxRate { get; private set; } public string TaxRegion { get; private set; } + public string OriginTaxAddressSource { get; set; } + public string DestinationTaxAddressSource { get; set; } public AdjustmentState State { get; protected set; } @@ -284,6 +286,14 @@ internal override void ReadXml(XmlTextReader reader) TaxRegion = reader.ReadElementContentAsString(); break; + case "origin_tax_address_source": + OriginTaxAddressSource = reader.ReadElementContentAsString(); + break; + + case "destination_tax_address_source": + DestinationTaxAddressSource = reader.ReadElementContentAsString(); + break; + case "credit_reason_code": CreditReasonCode = reader.ReadElementContentAsString(); break; @@ -396,6 +406,10 @@ internal void WriteXml(XmlTextWriter xmlWriter, bool embedded = false) xmlWriter.WriteElementString("end_date", EndDate.Value.ToString("s")); if (Origin != null) xmlWriter.WriteElementString("origin", Origin); + if (OriginTaxAddressSource != null) + xmlWriter.WriteElementString("origin_tax_address_source", OriginTaxAddressSource); + if (DestinationTaxAddressSource != null) + xmlWriter.WriteElementString("destination_tax_address_source", DestinationTaxAddressSource); xmlWriter.WriteEndElement(); // End: adjustment } diff --git a/Library/BusinessEntity.cs b/Library/BusinessEntity.cs index 20ce9983..66074ca0 100644 --- a/Library/BusinessEntity.cs +++ b/Library/BusinessEntity.cs @@ -15,6 +15,9 @@ public class BusinessEntity : RecurlyEntity public string Name { get; set; } public InvoiceDisplayAddress InvoiceDisplayAddress { get; set; } public TaxAddress TaxAddress { get; set; } + public string OriginTaxAddressSource { get; set; } + public string DestinationTaxAddressSource { get; set; } + public string DefaultVatNumber { get; set; } public string DefaultRegistrationNumber { get; set; } public string DefaultLiabilityGlAccountId { get; private set; } @@ -74,6 +77,12 @@ internal override void ReadXml(XmlTextReader reader) case "tax_address": TaxAddress = new TaxAddress(reader); break; + case "origin_tax_address_source": + OriginTaxAddressSource = reader.ReadElementContentAsString(); + break; + case "destination_tax_address_source": + DestinationTaxAddressSource = reader.ReadElementContentAsString(); + break; case "subscriber_location_countries": while (reader.Read()) { diff --git a/Test/AdjustmentTest.cs b/Test/AdjustmentTest.cs index fe0f1e71..48d7052b 100644 --- a/Test/AdjustmentTest.cs +++ b/Test/AdjustmentTest.cs @@ -48,6 +48,8 @@ public void CreateAdjustmentWithProperties() adjustment.Quantity = quantity; adjustment.AccountingCode = accountingCode; adjustment.UnitAmountInCents = unitAmountInCents; + adjustment.OriginTaxAddressSource = "origin"; + adjustment.DestinationTaxAddressSource = "destination"; adjustment.Create(); @@ -58,6 +60,8 @@ public void CreateAdjustmentWithProperties() Assert.Equal(quantity, adjustment.Quantity); Assert.Equal(accountingCode, adjustment.AccountingCode); Assert.Equal(unitAmountInCents, adjustment.UnitAmountInCents); + Assert.Equal("origin", adjustment.OriginTaxAddressSource); + Assert.Equal("destination", adjustment.DestinationTaxAddressSource); } [RecurlyFact(TestEnvironment.Type.Integration)] @@ -216,6 +220,8 @@ public void AdjustmentGet() var fromService = Adjustments.Get(adjustment.Uuid); fromService.Uuid.Should().NotBeNull(); + fromService.OriginTaxAddressSource.Should().Be("origin"); + fromService.DestinationTaxAddressSource.Should().Be("destination"); } [RecurlyFact(TestEnvironment.Type.Integration)] diff --git a/Test/BusinessEntityTest.cs b/Test/BusinessEntityTest.cs index 28880b94..28ea47a8 100644 --- a/Test/BusinessEntityTest.cs +++ b/Test/BusinessEntityTest.cs @@ -18,6 +18,8 @@ public void LookupBusinessEntity() businessEntity.InvoiceDisplayAddress.Country.Should().Be("US"); businessEntity.TaxAddress.Country.Should().Be("US"); businessEntity.GetInvoices().Should().BeOfType(); + businessEntity.OriginTaxAddressSource.Should().Be("origin"); + businessEntity.DestinationTaxAddressSource.Should().Be("destination"); } [RecurlyFact(TestEnvironment.Type.Unit)]