recurly 2.18.2 → 2.18.3

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: 0ecbf1f0769f7a67b1c5f7f8b5ee0d25fdbea9c93a904b3dd8db5c8de4b2b71a
4
- data.tar.gz: 556898b14903f191423e71d67045cc36a957f85446e13d2cf82122d9b3c52806
3
+ metadata.gz: 1a3231398510bdfe53ef4dc1409033d1b526df8a5131bd3bdbf464e80ad3c112
4
+ data.tar.gz: ae663af432bea91f8b53da68236753e04ea1081ffd02f421bb32253df94fda5b
5
5
  SHA512:
6
- metadata.gz: 92c6947d405a13ab65c52380fe7cbc57c10ee0f7118dab82d024488ce3878df8ff822522e8826471b7747d5064ca184c6b4ce91e1b835da762b2216c7981dcd9
7
- data.tar.gz: 1e221b69ff31a5a07157683572956095d49ea9a893388aeebd98b8d3caada461d24e9bb3f4cc94490d28cce7c80d5925c56d52361f7dcead00449166667170c2
6
+ metadata.gz: c4a128e615bd56e65e7bab7be1e2d28ad0388f5f825e0bf934c659b41eab17cede3f232c5acb47801b0f53f633671add39ef30d6672843b2b2dc6acd32b7b6e9
7
+ data.tar.gz: 312dd60e5df037c75091641f0bc5f2cf80da097f2373a5336398ee1ab9fef7a46a8ca31327191718b2df04d796b46f488ddbafcecc566631b00bde75032243db
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.2'
17
+ gem 'recurly', '~> 2.18.3'
18
18
  ```
19
19
 
20
20
  Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
@@ -21,11 +21,9 @@ module Recurly
21
21
  # You can also pass in adjustments and invoicing data to be added to the invoice.
22
22
  #
23
23
  # There are multiple ways to set the shipping addresses:
24
- # 1. Use {Purchase#shipping_address_id} If you want to apply an existing shipping
24
+ # 1. Use {Purchase#shipping_address_id} if you want to apply an existing shipping
25
25
  # address to all subscriptions, adjustments, and shipping fees in this purchase.
26
- # 2. Add multiple shipping addresses to {Account#shipping_addresses}. The last
27
- # address in the list will apply to all subscriptions and adjustments
28
- # in this purchase.
26
+ # 2. Use {Purchase#shipping_address} if you want to add and apply a single shipping address.
29
27
  # 3. Use {Subscription#shipping_address_id} or {Subscription#shipping_address}
30
28
  # to set a shipping address for only the subscription.
31
29
  # 4. Use {Adjustment#shipping_address_id} or {Adjustment#shipping_address}
@@ -45,18 +43,6 @@ module Recurly
45
43
  # collection_method: :automatic,
46
44
  # account: {
47
45
  # account_code: SecureRandom.uuid,
48
- # shipping_addresses: [
49
- # {
50
- # first_name: 'Benjamin',
51
- # last_name: 'Du Monde',
52
- # address1: '400 Dolores St.',
53
- # city: 'San Francisco',
54
- # state: 'CA',
55
- # zip: '94110',
56
- # country: 'US',
57
- # nickname: 'Home'
58
- # }
59
- # ],
60
46
  # billing_info: {
61
47
  # first_name: 'Benjamin',
62
48
  # last_name: 'Du Monde',
@@ -84,6 +70,16 @@ module Recurly
84
70
  # revenue_schedule_type: :at_invoice
85
71
  # }
86
72
  # ],
73
+ # shipping_address: {
74
+ # first_name: 'Benjamin',
75
+ # last_name: 'Du Monde',
76
+ # address1: '400 Dolores St.',
77
+ # city: 'San Francisco',
78
+ # state: 'CA',
79
+ # zip: '94110',
80
+ # country: 'US',
81
+ # nickname: 'Home'
82
+ # },
87
83
  # shipping_fees: [
88
84
  # {
89
85
  # shipping_method_code: 'fast_fast_fast',
@@ -123,6 +119,9 @@ module Recurly
123
119
  # @return [GiftCard, nil]
124
120
  has_one :gift_card, class_name: :GiftCard, readonly: false
125
121
 
122
+ # @return [ShippingAddress, nil]
123
+ has_one :shipping_address, class_name: :ShippingAddress, readonly: false
124
+
126
125
  # @return [[Subscription], nil]
127
126
  has_many :subscriptions, class_name: :Subscription, readonly: false
128
127
 
@@ -176,15 +176,17 @@ module Recurly
176
176
 
177
177
  # Cancel a subscription so that it will not renew.
178
178
  #
179
+ # @param [String] optional timeframe. Choose one of "bill_date" or "term_end"
179
180
  # @return [true, false] +true+ when successful, +false+ when unable to
180
181
  # (e.g., the subscription is not active).
181
182
  # @example
182
183
  # account = Account.find account_code
183
184
  # subscription = account.subscriptions.first
184
185
  # subscription.cancel # => true
185
- def cancel
186
+ def cancel(timeframe = nil)
186
187
  return false unless link? :cancel
187
- reload follow_link :cancel
188
+ params = timeframe.nil? ? {} : { 'timeframe': timeframe }
189
+ reload follow_link :cancel, params: params
188
190
  true
189
191
  end
190
192
 
@@ -1,6 +1,6 @@
1
1
  module Recurly
2
2
  module Version
3
- VERSION = "2.18.2"
3
+ VERSION = "2.18.3"
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.2
4
+ version: 2.18.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-27 00:00:00.000000000 Z
11
+ date: 2019-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri