nusii 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e27c58fa2f7686ee0898301d85fcc283792beb181b7b85ed7c799b1553dd6b0
4
- data.tar.gz: b5733b901dc74343c5662a1774939d9ebe0c07fba058a59667b2892f7be332af
3
+ metadata.gz: caa46f462605b1812c7d9823d55ced6bcff859d0b7d035b165b5bb2e4cb56044
4
+ data.tar.gz: 9ff515f61336ef38e5657685e7fd0f1d93ef49f86142142d6df20197c9222360
5
5
  SHA512:
6
- metadata.gz: bf7eacdcce1980776e6cde17fd952dc792e3ec0815750f2cba4dc007e4696cf03b294493bd891a37fd8618e3c5137b6658d7be04e875acf398827332d5cc4706
7
- data.tar.gz: 46ed8b38afcc198eb07f64ac7c1c6487ccc415ddcc904d0330cf2fa868739dcde94a816ef184675aafa899d9a86b357deac5b5ecd27e2468662435e79b6d3785
6
+ metadata.gz: f1693346aaa73313914ae77b35abf00c1ae492a4cd32dc77ff90ec62a230fb1e6472167d4d979ce22e56c0335a5265dec87bdfb1bed22eafb4f268f7960d26a0
7
+ data.tar.gz: 30836da2f8eb13bc74b8a128ea091b6b083e7d3c8278979588967286b3b293ceb63d39fb2fc1fd694a2eb646b5f7fa8e4bc5ba73334f379c8c6eca6c24d501c9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.3
4
+
5
+ - Add `maximum_amount`, `maximum_amount_in_cents` and `maximum_amount_formatted` to `LineItem` for the `range` cost type
6
+ - Add `maximum_total_in_cents` and `maximum_total_formatted` to `Section`
7
+
8
+ ## 0.2.2
9
+
10
+ - Add `PaymentRequiredError` for HTTP 402 responses
11
+ - Add `UnprocessableEntityError` for HTTP 422 responses
12
+
3
13
  ## 0.2.1
4
14
 
5
15
  - Add `Accept: application/json` header to API requests
@@ -7,7 +7,8 @@ module Nusii
7
7
  attr_accessor :id, :section_id, :name, :position, :cost_type,
8
8
  :recurring_type, :per_type, :quantity, :currency,
9
9
  :amount_in_cents, :amount_formatted, :total_in_cents,
10
- :total_formatted, :updated_at, :created_at, :amount
10
+ :total_formatted, :updated_at, :created_at, :amount,
11
+ :maximum_amount, :maximum_amount_in_cents, :maximum_amount_formatted
11
12
 
12
13
  def self.list_by_section section_id, options={}
13
14
  requester = Nusii::Request.new
@@ -30,7 +31,7 @@ module Nusii
30
31
 
31
32
  def editable_attributes
32
33
  [ :name, :cost_type, :recurring_type, :per_type,
33
- :position, :quantity, :amount ]
34
+ :position, :quantity, :amount, :maximum_amount ]
34
35
  end
35
36
 
36
37
  end
@@ -21,11 +21,13 @@ module Nusii
21
21
  case status
22
22
  when 400 then BadRequestError
23
23
  when 401 then UnauthorizedError
24
+ when 402 then PaymentRequiredError
24
25
  when 403 then ForbiddenError
25
26
  when 404 then NotFoundError
26
27
  when 405 then MethodNotAllowedError
27
28
  when 406 then NotAcceptableError
28
29
  when 410 then GoneError
30
+ when 422 then UnprocessableEntityError
29
31
  when 429 then TooManyRequestsError
30
32
  when 500 then IntervalServerError
31
33
  when 503 then ServiceUnavailableError
@@ -36,11 +38,13 @@ module Nusii
36
38
 
37
39
  class BadRequestError < NusiiError; end
38
40
  class UnauthorizedError < NusiiError; end
41
+ class PaymentRequiredError < NusiiError; end
39
42
  class ForbiddenError < NusiiError; end
40
43
  class NotFoundError < NusiiError; end
41
44
  class MethodNotAllowedError < NusiiError; end
42
45
  class NotAcceptableError < NusiiError; end
43
46
  class GoneError < NusiiError; end
47
+ class UnprocessableEntityError < NusiiError; end
44
48
  class TooManyRequestsError < NusiiError; end
45
49
  class IntervalServerError < NusiiError; end
46
50
  class ServiceUnavailableError < NusiiError; end
data/lib/nusii/section.rb CHANGED
@@ -11,7 +11,8 @@ module Nusii
11
11
  :template_id, :title, :name, :body, :position,
12
12
  :reusable, :section_type, :created_at, :updated_at,
13
13
  :page_break, :optional, :selected, :include_total,
14
- :total_in_cents, :total_formatted, :line_items
14
+ :total_in_cents, :total_formatted, :line_items,
15
+ :maximum_total_in_cents, :maximum_total_formatted
15
16
 
16
17
  private
17
18
 
data/lib/nusii/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nusii
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nusii
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Víctor Martín