recurly 2.18.6 → 2.18.7

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
2
  SHA256:
3
- metadata.gz: 563a9d23c833485fee920156d0e90b15cc0362903dde2a031b82b12cfa90e786
4
- data.tar.gz: 3a1b2dc09ccb086265a6d5704b784351f589f13fb46cb27f69c859f00d293243
3
+ metadata.gz: bfc1b1631c0eff809f13744b592123e8f4e05b171ae9f8315532878ca54d693b
4
+ data.tar.gz: 36f192d5fc2a23529acd0aea8f734a8a5e3b9913a079423eb8e6e11a8c4bd001
5
5
  SHA512:
6
- metadata.gz: cbd240d3e3339a15d648d311297a0d97720a46ea502f24d19ce653e498e985f0a56daf1121fa08f2360f25febe9f1ac8db9255b7f5ae2a5cb1b48b0f4fc4ec03
7
- data.tar.gz: 49b7b8e22287d32f20164d0099e5e2c1a95a14aff590bdd6360d14be65dda8955013e1c1c1d38b21273e4526cbe42a2b78c6b8b599f715d604e894b7bc5819d0
6
+ metadata.gz: ab2406a05aa914d27d05638fc52956295da64aba4f1b3e065f06312d478aeec1d080a0741490f6f283ad7cd9f6e12be804312756ef693fde6d3ea25f46569474
7
+ data.tar.gz: 97916a77c38c1dbf1308971f1ef021e32266c8c6981945c4764cf09e90c2a6a11bf61d6361ca0df2332426acfc5b3305c2c73e1ae1c4bf9aeba5fb6904ee4875
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.18.6'
17
+ gem 'recurly', '~> 2.18.7'
18
18
  ```
19
19
 
20
20
  Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
@@ -37,6 +37,7 @@ module Recurly
37
37
  currency
38
38
  product_code
39
39
  item_code
40
+ external_sku
40
41
  start_date
41
42
  end_date
42
43
  created_at
data/lib/recurly/api.rb CHANGED
@@ -18,7 +18,7 @@ module Recurly
18
18
  @@base_uri = "https://api.recurly.com/v2/"
19
19
  @@valid_domains = [".recurly.com"]
20
20
 
21
- RECURLY_API_VERSION = '2.24'
21
+ RECURLY_API_VERSION = '2.25'
22
22
 
23
23
  FORMATS = Helper.hash_with_indifferent_read_access(
24
24
  'pdf' => 'application/pdf',
@@ -174,6 +174,35 @@ module Recurly
174
174
  sub.tap {|e| e.currency = currency} if sub.is_a? Subscription
175
175
  end
176
176
 
177
+ # Convert free trial to paid subscription when transaction_type is "moto"
178
+ # which stands for "Mail Order Telephone Order".
179
+ #
180
+ # @return true
181
+ def convert_trial_moto()
182
+ builder = XML.new("<subscription/>")
183
+ builder.add_element('transaction_type', "moto")
184
+ reload API.put("#{uri}/convert_trial", builder.to_s)
185
+ true
186
+ end
187
+
188
+ # Convert free trial to paid subscription. Optionally uses a 3ds token.
189
+ #
190
+ # @param three_d_secure_action_result_token_id [String] three_d_secure_action_result_token_id
191
+ # returned by Recurly.js referencing the result of the 3DS authentication for PSD2
192
+ # @return true when payment is accepted
193
+ def convert_trial(three_d_secure_action_result_token_id = nil)
194
+ body = if three_d_secure_action_result_token_id != nil
195
+ builder = Recurly::XML.new("<subscription/>")
196
+ account = builder.add_element('account')
197
+ billing_info = account.add_element('billing_info')
198
+ billing_info.add_element('three_d_secure_action_result_token_id', three_d_secure_action_result_token_id)
199
+ builder.to_s
200
+ end
201
+
202
+ reload API.put("#{uri}/convert_trial", body)
203
+ true
204
+ end
205
+
177
206
  # Cancel a subscription so that it will not renew.
178
207
  #
179
208
  # @param [String] optional timeframe. Choose one of "bill_date" or "term_end"
@@ -1,6 +1,6 @@
1
1
  module Recurly
2
2
  module Version
3
- VERSION = "2.18.6"
3
+ VERSION = "2.18.7"
4
4
 
5
5
  class << self
6
6
  def inspect
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.18.6
4
+ version: 2.18.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-18 00:00:00.000000000 Z
11
+ date: 2020-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri