Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'tax_type', 'tax_region', 'tax_rate' to Adjustments #180

Merged
merged 1 commit into from
Mar 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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