Skip to content

Commit

Permalink
add net_terms_type to invoices, purchases, and subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
btruncali1 committed Mar 27, 2024
1 parent 14baeec commit b61067f
Show file tree
Hide file tree
Showing 7 changed files with 516 additions and 2 deletions.
3 changes: 3 additions & 0 deletions recurly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,7 @@ class Invoice(Resource):
'closed_at',
'collection_method',
'net_terms',
'net_terms_type',
'attempt_next_collection_at',
'recovery_reason',
'balance_in_cents',
Expand Down Expand Up @@ -1362,6 +1363,7 @@ class Purchase(Resource):
'currency',
'po_number',
'net_terms',
'net_terms_type',
'gift_card',
'coupon_codes',
'subscriptions',
Expand Down Expand Up @@ -1686,6 +1688,7 @@ class Subscription(Resource):
'account',
'pending_subscription',
'net_terms',
'net_terms_type',
'collection_method',
'po_number',
'first_renewal_date',
Expand Down
41 changes: 41 additions & 0 deletions tests/fixtures/invoice/invoiced-with-eom-net-terms.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
POST https://api.recurly.com/v2/accounts/invoicemock/invoices HTTP/1.1
X-Api-Version: {api-version}
Accept: application/xml
Authorization: Basic YXBpa2V5Og==
User-Agent: {user-agent}
Content-Type: application/xml; charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>
<invoice>
<terms_and_conditions>Some Terms and Conditions</terms_and_conditions>
<customer_notes>Some Customer Notes</customer_notes>
<collection_method>manual</collection_method>
<net_terms type="integer">30</net_terms>
<net_terms_type>eom</net_terms_type>
</invoice>

HTTP/1.1 201 Created
Content-Type: application/xml; charset=utf-8
Location: https://api.recurly.com/v2/invoices/4ba1531325014b4f969cd13676f514d8

<?xml version="1.0" encoding="UTF-8"?>
<invoice_collection>
<charge_invoice href="https://api.recurly.com/v2/invoices/4ba1531325014b4f969cd13676f514d8">
<uuid>4ba1531325014b4f969cd13676f514d8</uuid>
<account_code>invoicemock</account_code>
<invoice_number type="integer">1001</invoice_number>
<invoice_number_prefix></invoice_number_prefix>
<amount_in_cents>
<USD type="integer">1000</USD>
</amount_in_cents>
<terms_and_conditions>Some Terms and Conditions</terms_and_conditions>
<customer_notes>Some Customer Notes</customer_notes>
<collection_method>manual</collection_method>
<net_terms type="integer">30</net_terms>
<net_terms_type>eom</net_terms_type>
<start_date type="datetime">2009-11-03T23:27:46-08:00</start_date>
<end_date type="datetime"></end_date>
<description>test charge</description>
<created_at type="datetime">2009-11-03T23:27:46-08:00</created_at>
</charge_invoice>
</invoice_collection>
2 changes: 2 additions & 0 deletions tests/fixtures/invoice/invoiced-with-optionals.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Content-Type: application/xml; charset=utf-8
<customer_notes>Some Customer Notes</customer_notes>
<collection_method>manual</collection_method>
<net_terms type="integer">30</net_terms>
<net_terms_type>net</net_terms_type>
</invoice>

HTTP/1.1 201 Created
Expand All @@ -31,6 +32,7 @@ Location: https://api.recurly.com/v2/invoices/4ba1531325014b4f969cd13676f514d8
<customer_notes>Some Customer Notes</customer_notes>
<collection_method>manual</collection_method>
<net_terms type="integer">30</net_terms>
<net_terms_type>net</net_terms_type>
<start_date type="datetime">2009-11-03T23:27:46-08:00</start_date>
<end_date type="datetime"></end_date>
<description>test charge</description>
Expand Down
Loading

0 comments on commit b61067f

Please sign in to comment.