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 +4 -4
- data/lib/recurly.rb +2 -0
- data/lib/recurly/api.rb +1 -1
- data/lib/recurly/purchase.rb +16 -1
- data/lib/recurly/shipping_fee.rb +17 -0
- data/lib/recurly/shipping_method.rb +13 -0
- data/lib/recurly/subscription.rb +2 -0
- data/lib/recurly/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d0e0ace96d322bc281a9222b3f8a5ad5a74934c9a932b3acf42dc9758125123
|
4
|
+
data.tar.gz: 2078d66436b7e833573186d07286c8aa1e2978b6fcc9b0b5be95483ea1a27b69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32dab96f508dd4d353bf9bc5f55e3a6fe3986c8080eaae3f0700923bc17448dfeab99c56dfb542f2b5e4472ea1c20aa70341d2b75b1f8bf62b5864698d67237f
|
7
|
+
data.tar.gz: b57ea7406d7188e572ac93e7c6e2e99f004a27108f1a8e79348447fd4b56a8203119a342cee0a23981276abfd3fb41dd4425c1edc49bb30cbdfffbd22f1e9cc3
|
data/lib/recurly.rb
CHANGED
@@ -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'
|
data/lib/recurly/api.rb
CHANGED
data/lib/recurly/purchase.rb
CHANGED
@@ -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
|
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
|
data/lib/recurly/subscription.rb
CHANGED
data/lib/recurly/version.rb
CHANGED
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.
|
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-
|
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
|