recurly 2.17.11 → 2.18.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 3519638097719d8a4391fa22280046e0e8b64190bfa32f9f777532f61a52e844
4
- data.tar.gz: 390d47a6397f9fc7042268fd2d0d3ba8fcd7408fee7a641a8f7dd3a2f06c5268
2
+ SHA1:
3
+ metadata.gz: fa3a6583aae99844185b0c2a98740596b4d5cf12
4
+ data.tar.gz: 3af828ab17994fa0ed0376c460bffa470b1eb2e0
5
5
  SHA512:
6
- metadata.gz: a7d8dec227598befb843b61b7906d5d1ee84d41b783c647ea506d99947c7770ba2623f61a13e295609e146dedb79e1f0bc050c5f559a34b1ac4750c68af71724
7
- data.tar.gz: 2f9077913faad819422e5a7b17fc5cb9f231b6d2db956926100e951e4700eac69bf67b54818c4ebb6baea59c75b7f96153e0704bbaa510699b4ae6d2ce2fa07c
6
+ metadata.gz: 11bf511f85233e0d498dc1debae2c3611fab6260c83b5e8d12d84053acaaecaea1a2eb7172dcafaf20d7ebfd353c07418a214ec635add505214e59b69e16ae78
7
+ data.tar.gz: 92da77b27aaccf4e5b942e6b457ddeb4ee5e71c1b98b0eb8240892e888fbbe5453c570c953f6ff4a72ce00f4fa4650524e439b3b34dc4c639d2192ebe4ca0d6b
data/README.md CHANGED
@@ -14,7 +14,7 @@ Recurly is packaged as a Ruby gem. We recommend you install it with
14
14
  [Bundler](http://gembundler.com/) by adding the following line to your Gemfile:
15
15
 
16
16
  ``` ruby
17
- gem 'recurly', '~> 2.17'
17
+ gem 'recurly', '~> 2.18'
18
18
  ```
19
19
 
20
20
  Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
@@ -94,6 +94,7 @@ module Recurly
94
94
  has_past_due_invoice
95
95
  has_paused_subscription
96
96
  preferred_locale
97
+ transaction_type
97
98
  )
98
99
  alias to_param account_code
99
100
 
@@ -54,6 +54,7 @@ module Recurly
54
54
  credit_reason_code
55
55
  original_adjustment_uuid
56
56
  shipping_address_id
57
+ surcharge_in_cents
57
58
  )
58
59
  alias to_param uuid
59
60
 
@@ -17,7 +17,7 @@ module Recurly
17
17
  @@base_uri = "https://api.recurly.com/v2/"
18
18
  @@valid_domains = [".recurly.com"]
19
19
 
20
- RECURLY_API_VERSION = '2.21'
20
+ RECURLY_API_VERSION = '2.22'
21
21
 
22
22
  FORMATS = Helper.hash_with_indifferent_read_access(
23
23
  'pdf' => 'application/pdf',
@@ -35,6 +35,7 @@ module Recurly
35
35
  gateway_code
36
36
  fraud_session_id
37
37
  three_d_secure_action_result_token_id
38
+ transaction_type
38
39
  ) | CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES | AMAZON_ATTRIBUTES | PAYPAL_ATTRIBUTES | ROKU_ATTRIBUTES
39
40
 
40
41
  # @return ["credit_card", "paypal", "amazon", "bank_account", "roku", nil] The type of billing info.
@@ -109,6 +109,7 @@ module Recurly
109
109
  dunning_events_count
110
110
  final_dunning_event
111
111
  gateway_code
112
+ surcharge_in_cents
112
113
  )
113
114
  alias to_param invoice_number_with_prefix
114
115
 
@@ -142,11 +143,20 @@ module Recurly
142
143
 
143
144
  # Initiate a collection attempt on an invoice.
144
145
  #
146
+ # @example
147
+ # # Optionally set transaction type
148
+ # invoice.force_collect(transaction_type: 'moto')
149
+ #
150
+ # @param options [Hash] Optional set of details to send to collect endpoint.
145
151
  # @return [true, false] +true+ when successful, +false+ when unable to
146
152
  # (e.g., the invoice is no longer open).
147
- def force_collect
153
+ def force_collect(options = {})
148
154
  return false unless link? :force_collect
149
- reload follow_link :force_collect
155
+ http_opts = {}
156
+ if options[:transaction_type]
157
+ http_opts[:body] = transaction_type_xml(options[:transaction_type])
158
+ end
159
+ reload follow_link(:force_collect, http_opts)
150
160
  true
151
161
  end
152
162
 
@@ -266,6 +276,12 @@ module Recurly
266
276
  builder.to_s
267
277
  end
268
278
 
279
+ def transaction_type_xml(transaction_type)
280
+ builder = XML.new("<invoice/>")
281
+ builder.add_element 'transaction_type', transaction_type.to_s
282
+ builder.to_s
283
+ end
284
+
269
285
  # Invoices are only writeable through {Account} instances.
270
286
  embedded! true
271
287
  undef destroy
@@ -7,6 +7,7 @@ module Recurly
7
7
  tax_in_cents
8
8
  sub_type
9
9
  jurisdiction_name
10
+ classification
10
11
  )
11
12
 
12
13
  embedded! true
@@ -140,6 +140,7 @@ module Recurly
140
140
  vat_reverse_charge_notes
141
141
  shipping_address_id
142
142
  gateway_code
143
+ transaction_type
143
144
  )
144
145
 
145
146
  class << self
@@ -97,6 +97,7 @@ module Recurly
97
97
  total_amount_in_cents
98
98
  resume_at
99
99
  gateway_code
100
+ transaction_type
100
101
  )
101
102
  alias to_param uuid
102
103
 
@@ -5,6 +5,7 @@ module Recurly
5
5
  tax_in_cents
6
6
  type
7
7
  juris_details
8
+ tax_classification
8
9
  )
9
10
 
10
11
  embedded! true
@@ -1,8 +1,8 @@
1
1
  module Recurly
2
2
  module Version
3
3
  MAJOR = 2
4
- MINOR = 17
5
- PATCH = 11
4
+ MINOR = 18
5
+ PATCH = 0
6
6
  PRE = nil
7
7
 
8
8
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join('.').freeze
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recurly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.17.11
4
+ version: 2.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-27 00:00:00.000000000 Z
11
+ date: 2019-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -328,7 +328,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
328
328
  version: '0'
329
329
  requirements: []
330
330
  rubyforge_project:
331
- rubygems_version: 2.7.7
331
+ rubygems_version: 2.6.14.4
332
332
  signing_key:
333
333
  specification_version: 4
334
334
  summary: Recurly API Client