Skip to content

Commit

Permalink
Merge pull request #672 from recurly/add-revrec-for-business-entities
Browse files Browse the repository at this point in the history
Adding RevRec Support for Business Entities
  • Loading branch information
tilley-kyle authored Feb 1, 2024
2 parents 184b9f5 + 86bffe4 commit 24d77f6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion recurly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,9 @@ class BusinessEntity(Resource):
'default_vat_number',
'default_registration_number',
'created_at',
'updated_at'
'updated_at',
'default_revenue_gl_account_id',
'default_liability_gl_account_id',
)

_classes_for_nodename = {
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 @@ -40,4 +40,6 @@ Content-Type: application/xml; charset=utf-8
<default_registration_number>ab1</default_registration_number>
<created_at type="datetime">2023-05-13T17:28:47Z</created_at>
<updated_at type="datetime">2023-10-13T17:28:48Z</updated_at>
<default_liability_gl_account_id>t5ejtge1xw0x</default_liability_gl_account_id>
<default_revenue_gl_account_id>t5ejtgf1vxh1</default_revenue_gl_account_id>
</business_entity>
4 changes: 4 additions & 0 deletions tests/fixtures/business_entity/list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Content-Type: application/xml; charset=utf-8
<default_registration_number></default_registration_number>
<created_at type="datetime">2023-05-25T15:56:47Z</created_at>
<updated_at type="datetime">2023-05-25T15:56:47Z</updated_at>
<default_liability_gl_account_id nil="nil"></default_liability_gl_account_id>
<default_revenue_gl_account_id nil="nil"></default_revenue_gl_account_id>
</business_entity>
<business_entity href="https://pcc.recurly.dev:3000/v2/business_entities/sppvjs6eripk">
<invoices href="https://pcc.recurly.dev:3000/v2/business_entities/sppvjs6eripk/invoices"/>
Expand Down Expand Up @@ -69,5 +71,7 @@ Content-Type: application/xml; charset=utf-8
<default_registration_number></default_registration_number>
<created_at type="datetime">2023-04-12T15:11:58Z</created_at>
<updated_at type="datetime">2023-05-15T15:34:01Z</updated_at>
<default_liability_gl_account_id>t5ejtge1xw0x</default_liability_gl_account_id>
<default_revenue_gl_account_id>t5ejtgf1vxh1</default_revenue_gl_account_id>
</business_entity>
</business_entities>
2 changes: 2 additions & 0 deletions tests/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -3210,6 +3210,8 @@ def test_get_business_entity(self):
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))
self.assertEqual(entity.default_liability_gl_account_id, 't5ejtge1xw0x')
self.assertEqual(entity.default_revenue_gl_account_id, 't5ejtgf1vxh1')

def test_list_business_entities(self):
with self.mock_request('business_entity/list.xml'):
Expand Down

0 comments on commit 24d77f6

Please sign in to comment.