Skip to content

Commit

Permalink
add taxable address sources to business entity and adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
amandamfielding committed May 31, 2024
1 parent 4b4df60 commit ddba6b3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions recurly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@ class BusinessEntity(Resource):
'name',
'invoice_display_address',
'tax_address',
'origin_tax_address_source',
'destination_tax_address_source',
'subscriber_location_countries',
'default_vat_number',
'default_registration_number',
Expand Down Expand Up @@ -1030,6 +1032,8 @@ class Adjustment(Resource):
'tax_type',
'tax_region',
'tax_rate',
'origin_tax_address_source',
'destination_tax_address_source',
'total_in_cents',
'currency',
'tax_exempt',
Expand Down
2 changes: 2 additions & 0 deletions tests/fixtures/adjustment/lookup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Content-Type: application/xml; charset=utf-8
<tax_type>usst</tax_type>
<tax_region>CA</tax_region>
<tax_rate type="float">0.0875</tax_rate>
<origin_tax_address_source>Business entity tax address</origin_tax_address_source>
<destination_tax_address_source>Customer tax address</destination_tax_address_source>
<unit_amount_in_cents type="integer">1000</unit_amount_in_cents>
<currency>USD</currency>
<tax_details type="array">
Expand Down
2 changes: 2 additions & 0 deletions tests/fixtures/business_entity/get.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Content-Type: application/xml; charset=utf-8
<country>US</country>
<phone>4344444222</phone>
</tax_address>
<origin_tax_address_source>Business entity tax address</origin_tax_address_source>
<destination_tax_address_source>Customer tax address</destination_tax_address_source>
<subscriber_location_countries type="array">
<subscriber_location_country>GB</subscriber_location_country>
<subscriber_location_country>CA</subscriber_location_country>
Expand Down
4 changes: 4 additions & 0 deletions tests/fixtures/business_entity/list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Content-Type: application/xml; charset=utf-8
<country>US</country>
<phone></phone>
</tax_address>
<origin_tax_address_source>Business entity tax address</origin_tax_address_source>
<destination_tax_address_source>Customer tax address</destination_tax_address_source>
<subscriber_location_countries type="array">
</subscriber_location_countries>
<default_vat_number></default_vat_number>
Expand Down Expand Up @@ -65,6 +67,8 @@ Content-Type: application/xml; charset=utf-8
<country>US</country>
<phone>3442565432</phone>
</tax_address>
<origin_tax_address_source>Business entity tax address</origin_tax_address_source>
<destination_tax_address_source>Customer tax address</destination_tax_address_source>
<subscriber_location_countries type="array">
</subscriber_location_countries>
<default_vat_number></default_vat_number>
Expand Down
2 changes: 2 additions & 0 deletions tests/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -3600,6 +3600,8 @@ def test_get_business_entity(self):
self.assertEqual(entity.default_registration_number, 'ab1')
self.assertEqual(entity.subscriber_location_countries, ['GB', 'CA'])
self.assertIsInstance(entity.tax_address, Address)
self.assertEqual(entity.origin_tax_address_source, 'Business entity tax address')
self.assertEqual(entity.destination_tax_address_source, 'Customer tax address')
self.assertIsInstance(entity.invoice_display_address, Address)
self.assertEqual(entity.created_at, datetime(2023, 5, 13, 17, 28, 47, tzinfo=entity.created_at.tzinfo))
self.assertEqual(entity.updated_at, datetime(2023, 10, 13, 17, 28, 48, tzinfo=entity.updated_at.tzinfo))
Expand Down

0 comments on commit ddba6b3

Please sign in to comment.