Skip to content

Commit

Permalink
Add origin_tax_address_source & destination_tax_address_source to bus…
Browse files Browse the repository at this point in the history
…iness_entity and adjustment resource.
  • Loading branch information
paulorbpinho-fullstacklabs committed Jun 3, 2024
1 parent 351dc00 commit ea30c74
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Library/Adjustment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down Expand Up @@ -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;
Expand Down
9 changes: 9 additions & 0 deletions Library/BusinessEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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())
{
Expand Down
2 changes: 2 additions & 0 deletions Test/AdjustmentTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ public void AdjustmentGet()
var fromService = Adjustments.Get(adjustment.Uuid);

fromService.Uuid.Should().NotBeNull();
fromService.OriginTaxAddressSource.Should().Be("Business entity tax address");
fromService.DestinationTaxAddressSource.Should().Be("Customer tax address");
}

[RecurlyFact(TestEnvironment.Type.Integration)]
Expand Down
2 changes: 2 additions & 0 deletions Test/BusinessEntityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public void LookupBusinessEntity()
businessEntity.InvoiceDisplayAddress.Country.Should().Be("US");
businessEntity.TaxAddress.Country.Should().Be("US");
businessEntity.GetInvoices().Should().BeOfType<InvoiceList>();
businessEntity.OriginTaxAddressSource.Should().Be("Business entity tax address");
businessEntity.DestinationTaxAddressSource.Should().Be("Customer tax address");
}

[RecurlyFact(TestEnvironment.Type.Unit)]
Expand Down

0 comments on commit ea30c74

Please sign in to comment.