Skip to content

Commit

Permalink
Add 'tax_type', 'tax_region', 'tax_rate' to Adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
cbarton committed Feb 21, 2015
1 parent 76f1bc4 commit 65b770e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<a name="unreleased"></a>
## Unreleased
* Fix paged resource loading when the uuid needs to be escaped, fixes [174](https://github.com/recurly/recurly-client-ruby/issues/174), [PR](https://github.com/recurly/recurly-client-ruby/pull/177)
* Add `tax_type`, `tax_rate`, `tax_region` to `Adjustment` [PR](https://github.com/recurly/recurly-client-ruby/pull/180)

<a name="v2.4.1"></a>
## v2.4.1 (2015-1-23)
Expand Down
12 changes: 8 additions & 4 deletions lib/recurly/adjustment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,21 @@ class Adjustment < Resource
unit_amount_in_cents
quantity
discount_in_cents
tax_in_cents
total_in_cents
currency
tax_exempt
tax_code
tax_details
product_code
start_date
end_date
created_at
quantity_remaining

tax_in_cents
tax_type
tax_region
tax_rate
tax_exempt
tax_code
tax_details
)
alias to_param uuid

Expand Down
3 changes: 3 additions & 0 deletions spec/fixtures/adjustments/show-200.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Content-Type: application/xml; charset=utf-8
<quantity type="integer">1</quantity>
<discount_in_cents type="integer">0</discount_in_cents>
<tax_in_cents type="integer">5000</tax_in_cents>
<tax_type>usst</tax_type>
<tax_region>CA</tax_region>
<tax_rate type="float">0.0875</tax_rate>
<total_in_cents type="integer">1200</total_in_cents>
<currency>USD</currency>
<product_code>basic</product_code>
Expand Down
2 changes: 2 additions & 0 deletions spec/fixtures/invoices/show-200-taxed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Content-Type: application/xml; charset=utf-8
<currency>USD</currency>
<created_at type="datetime">2011-04-30T08:00:00Z</created_at>
<tax_type>usst</tax_type>
<tax_region>CA</tax_region>
<tax_rate type="float">0.0875</tax_rate>
<line_items>
<adjustment href="https://api.recurly.com/v2/adjustments/charge" type="charge">
<account href="https://api.recurly.com/v2/accounts/abcdef1234567890"/>
Expand Down
3 changes: 3 additions & 0 deletions spec/recurly/adjustment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
adjustment.start_date.must_be_kind_of DateTime
adjustment.end_date.must_be_kind_of DateTime
adjustment.created_at.must_be_kind_of DateTime
adjustment.tax_type.must_equal 'usst'
adjustment.tax_region.must_equal 'CA'
adjustment.tax_rate.must_equal 0.0875

tax_details = adjustment.tax_details
tax_details.length.must_equal 2
Expand Down

0 comments on commit 65b770e

Please sign in to comment.