recurly 2.17.9 → 2.17.10

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: 8e908456f0d7bd5a9f67bc9aee4327743109912e7a5da81fc3f45ac7cd2de981
4
- data.tar.gz: 1a0dc145c934b29115b85bf3b1ce0c0370f413bc15e7f850730f3e29f829e6a8
3
+ metadata.gz: 7d0e0ace96d322bc281a9222b3f8a5ad5a74934c9a932b3acf42dc9758125123
4
+ data.tar.gz: 2078d66436b7e833573186d07286c8aa1e2978b6fcc9b0b5be95483ea1a27b69
5
5
  SHA512:
6
- metadata.gz: e2eb1869442a263dfff55d613eacec010adefa4c1ab9dde0dbddece5bedbd9d4b4928d9cd98b406e80aac724ee33de49bf7d75d151c60da1819ec02cd59fefcc
7
- data.tar.gz: 36c77a4eddc520484e901b0aa9e715ff4fd644ace30c4415451c8f53fde15606d68c998ae6c77d4e698271c525ae6c0556f2f8fb76a56c3f396c7051889c3fcc
6
+ metadata.gz: 32dab96f508dd4d353bf9bc5f55e3a6fe3986c8080eaae3f0700923bc17448dfeab99c56dfb542f2b5e4472ea1c20aa70341d2b75b1f8bf62b5864698d67237f
7
+ data.tar.gz: b57ea7406d7188e572ac93e7c6e2e99f004a27108f1a8e79348447fd4b56a8203119a342cee0a23981276abfd3fb41dd4425c1edc49bb30cbdfffbd22f1e9cc3
@@ -27,6 +27,8 @@ module Recurly
27
27
  require 'recurly/note'
28
28
  require 'recurly/plan'
29
29
  require 'recurly/redemption'
30
+ require 'recurly/shipping_fee'
31
+ require 'recurly/shipping_method'
30
32
  require 'recurly/subscription'
31
33
  require 'recurly/subscription_add_on'
32
34
  require 'recurly/transaction'
@@ -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.19'
20
+ RECURLY_API_VERSION = '2.20'
21
21
 
22
22
  FORMATS = Helper.hash_with_indifferent_read_access(
23
23
  'pdf' => 'application/pdf',
@@ -22,7 +22,7 @@ module Recurly
22
22
  #
23
23
  # There are multiple ways to set the shipping addresses:
24
24
  # 1. Use {Purchase#shipping_address_id} If you want to apply an existing shipping
25
- # address to all subscriptions and adjustments in this purchase.
25
+ # address to all subscriptions, adjustments, and shipping fees in this purchase.
26
26
  # 2. Add multiple shipping addresses to {Account#shipping_addresses}. The last
27
27
  # address in the list will apply to all subscriptions and adjustments
28
28
  # in this purchase.
@@ -30,6 +30,12 @@ module Recurly
30
30
  # to set a shipping address for only the subscription.
31
31
  # 4. Use {Adjustment#shipping_address_id} or {Adjustment#shipping_address}
32
32
  # to set a shipping address for only the adjustment.
33
+ # 5. Use {ShippingFee#shipping_address_id} or {ShippingFee#shipping_address}
34
+ # to set a shipping address for only the shipping fee. If there are multiple
35
+ # shipping fees on a single purchase, each can have its own shipping address.
36
+ # This way, if you ship different adjustments to multiple addresses, the
37
+ # shipping fees on the purchase can be associated with the same address
38
+ # as the adjustment.
33
39
  #
34
40
  # @example
35
41
  # require 'securerandom'
@@ -77,6 +83,12 @@ module Recurly
77
83
  # quantity: 5,
78
84
  # revenue_schedule_type: :at_invoice
79
85
  # }
86
+ # ],
87
+ # shipping_fees: [
88
+ # {
89
+ # shipping_method_code: 'fast_fast_fast',
90
+ # shipping_amount_in_cents: '999'
91
+ # }
80
92
  # ]
81
93
  # )
82
94
  #
@@ -114,6 +126,9 @@ module Recurly
114
126
  # @return [[Subscription], nil]
115
127
  has_many :subscriptions, class_name: :Subscription, readonly: false
116
128
 
129
+ # @return [[ShippingFee], nil]
130
+ has_many :shipping_fees, class_name: :ShippingFee, readonly: false
131
+
117
132
  define_attribute_methods %w(
118
133
  currency
119
134
  collection_method
@@ -0,0 +1,17 @@
1
+ module Recurly
2
+ class ShippingFee < Resource
3
+ # @return [ShippingAddress, nil]
4
+ has_one :shipping_address, class_name: :ShippingAddress, readonly: false
5
+
6
+ define_attribute_methods %w(
7
+ shipping_method_code
8
+ shipping_amount_in_cents,
9
+ shipping_address_id
10
+ )
11
+
12
+ # shipping_amount_in_cents should just be a number rather than a currency
13
+ # See https://github.com/recurly/recurly-client-ruby/blob/3726114fdf584ba50982e0ee28fd219136043fbc/lib/recurly/resource.rb#L751-L753
14
+ def currency
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,13 @@
1
+ module Recurly
2
+ class ShippingMethod < Resource
3
+ define_attribute_methods %w(
4
+ code
5
+ name
6
+ accounting_code
7
+ tax_code
8
+ created_at
9
+ updated_at
10
+ )
11
+ alias to_param code
12
+ end
13
+ end
@@ -77,6 +77,8 @@ module Recurly
77
77
  address
78
78
  revenue_schedule_type
79
79
  shipping_address_id
80
+ shipping_method_code
81
+ shipping_amount_in_cents
80
82
  timeframe
81
83
  started_with_gift
82
84
  converted_at
@@ -2,7 +2,7 @@ module Recurly
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 17
5
- PATCH = 9
5
+ PATCH = 10
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.9
4
+ version: 2.17.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-14 00:00:00.000000000 Z
11
+ date: 2019-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -241,6 +241,8 @@ files:
241
241
  - lib/recurly/resource/errors.rb
242
242
  - lib/recurly/resource/pager.rb
243
243
  - lib/recurly/shipping_address.rb
244
+ - lib/recurly/shipping_fee.rb
245
+ - lib/recurly/shipping_method.rb
244
246
  - lib/recurly/subscription.rb
245
247
  - lib/recurly/subscription/add_ons.rb
246
248
  - lib/recurly/subscription_add_on.rb