recurly 2.18.9 → 2.18.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/recurly/add_on.rb +3 -0
- data/lib/recurly/adjustment.rb +2 -0
- data/lib/recurly/api.rb +1 -1
- data/lib/recurly/billing_info.rb +22 -11
- data/lib/recurly/invoice.rb +1 -0
- data/lib/recurly/item.rb +2 -0
- data/lib/recurly/plan.rb +3 -0
- data/lib/recurly/resource.rb +2 -2
- data/lib/recurly/subscription/add_ons.rb +6 -1
- data/lib/recurly/subscription_add_on.rb +8 -0
- data/lib/recurly/tax_detail.rb +2 -0
- data/lib/recurly/tier.rb +1 -0
- data/lib/recurly/transaction.rb +2 -0
- data/lib/recurly/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0aef5f4769bbf0800eb110b5d687c5a942022a371c92c87edb8cc4bf23bc7503
|
4
|
+
data.tar.gz: 0d45adbbc2f0250aebcefa96b5f43b7f4d314443f648c84caa030b7327b5d074
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3aab3d7166e2cff5ea25905294539df647c2cece2770756d844899551807b55599b77ec9a419018a02fe9a90bb0f25f514d8e1d089ac0f94dc55346fb439cc6c
|
7
|
+
data.tar.gz: 2310d1a1f729a351d96a95de146fa219f56fc39d1eb1b7dbb90959226b7ee592500bfc2b76ae68c879b172b62b3479c46aacdf57dd42be0489762159f4ba61f8
|
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.
|
17
|
+
gem 'recurly', '~> 2.18.14'
|
18
18
|
```
|
19
19
|
|
20
20
|
Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
|
data/lib/recurly/add_on.rb
CHANGED
@@ -2,6 +2,7 @@ module Recurly
|
|
2
2
|
class AddOn < Resource
|
3
3
|
# @return [Plan]
|
4
4
|
belongs_to :plan
|
5
|
+
# @return [[Tier], []]
|
5
6
|
has_many :tiers, class_name: :Tier, readonly: false
|
6
7
|
|
7
8
|
define_attribute_methods %w(
|
@@ -22,6 +23,8 @@ module Recurly
|
|
22
23
|
created_at
|
23
24
|
updated_at
|
24
25
|
tier_type
|
26
|
+
avalara_service_type
|
27
|
+
avalara_transaction_type
|
25
28
|
)
|
26
29
|
alias to_param add_on_code
|
27
30
|
alias quantity default_quantity
|
data/lib/recurly/adjustment.rb
CHANGED
data/lib/recurly/api.rb
CHANGED
data/lib/recurly/billing_info.rb
CHANGED
@@ -9,6 +9,8 @@ module Recurly
|
|
9
9
|
PAYPAL_ATTRIBUTES = %w(paypal_billing_agreement_id).freeze
|
10
10
|
ROKU_ATTRIBUTES = %w(roku_billing_agreement_id last_four).freeze
|
11
11
|
SEPA_ATTRIBUTES = %w(iban).freeze
|
12
|
+
BACS_ATTRIBUTES = %w(account_number sort_code type).freeze
|
13
|
+
BECS_ATTRIBUTES = %w(account_number bsb_code type).freeze
|
12
14
|
|
13
15
|
# @return [Account]
|
14
16
|
belongs_to :account
|
@@ -37,37 +39,46 @@ module Recurly
|
|
37
39
|
fraud_session_id
|
38
40
|
three_d_secure_action_result_token_id
|
39
41
|
transaction_type
|
40
|
-
iban
|
41
42
|
mandate_reference
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
attr_reader :type
|
43
|
+
tax_identifier
|
44
|
+
tax_identifier_type
|
45
|
+
) | CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES | AMAZON_ATTRIBUTES | PAYPAL_ATTRIBUTES | ROKU_ATTRIBUTES | SEPA_ATTRIBUTES | BACS_ATTRIBUTES | BECS_ATTRIBUTES
|
46
46
|
|
47
47
|
# @return [String]
|
48
48
|
def inspect
|
49
49
|
attributes = self.class.attribute_names
|
50
50
|
case type
|
51
51
|
when 'credit_card'
|
52
|
-
attributes -= (AMAZON_ATTRIBUTES + PAYPAL_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES)
|
52
|
+
attributes -= (AMAZON_ATTRIBUTES + PAYPAL_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES + BECS_ATTRIBUTES)
|
53
53
|
attributes |= CREDIT_CARD_ATTRIBUTES
|
54
54
|
when 'paypal'
|
55
|
-
attributes -= (CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES + AMAZON_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES)
|
55
|
+
attributes -= (CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES + AMAZON_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES + BECS_ATTRIBUTES)
|
56
56
|
when 'amazon'
|
57
|
-
attributes -= (CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES + PAYPAL_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES)
|
57
|
+
attributes -= (CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES + PAYPAL_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES + BECS_ATTRIBUTES)
|
58
58
|
when 'bank_account'
|
59
|
-
attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES)
|
59
|
+
attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES + BECS_ATTRIBUTES)
|
60
60
|
attributes |= BANK_ACCOUNT_ATTRIBUTES
|
61
61
|
when 'roku'
|
62
|
-
attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + SEPA_ATTRIBUTES)
|
62
|
+
attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES + BECS_ATTRIBUTES)
|
63
63
|
attributes |= ROKU_ATTRIBUTES
|
64
64
|
when 'sepa'
|
65
|
-
attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + ROKU_ATTRIBUTES)
|
65
|
+
attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + ROKU_ATTRIBUTES + BACS_ATTRIBUTES + BECS_ATTRIBUTES)
|
66
66
|
attributes |= SEPA_ATTRIBUTES
|
67
|
+
when 'bacs'
|
68
|
+
attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BECS_ATTRIBUTES)
|
69
|
+
attributes |= BACS_ATTRIBUTES
|
70
|
+
when 'becs'
|
71
|
+
attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES)
|
72
|
+
attributes |= BECS_ATTRIBUTES
|
67
73
|
end
|
68
74
|
super attributes
|
69
75
|
end
|
70
76
|
|
77
|
+
# @return ["credit_card", "paypal", "amazon", "bank_account", "roku", "sepa", "bacs", "becs", nil] The type of billing info.
|
78
|
+
def type
|
79
|
+
self[:type] || @type
|
80
|
+
end
|
81
|
+
|
71
82
|
class << self
|
72
83
|
# Overrides the inherited member_path method to allow for billing info's
|
73
84
|
# irregular URL structure.
|
data/lib/recurly/invoice.rb
CHANGED
data/lib/recurly/item.rb
CHANGED
data/lib/recurly/plan.rb
CHANGED
data/lib/recurly/resource.rb
CHANGED
@@ -824,9 +824,9 @@ module Recurly
|
|
824
824
|
|
825
825
|
# Duck-typing here is problematic because of ActiveSupport's #to_xml.
|
826
826
|
case value
|
827
|
-
when Resource
|
827
|
+
when Resource
|
828
828
|
value.to_xml options.merge(:builder => node)
|
829
|
-
when Array
|
829
|
+
when Array, Subscription::AddOns
|
830
830
|
value.each do |e|
|
831
831
|
if e.is_a? Recurly::Resource
|
832
832
|
# create a node to hold this resource
|
@@ -25,7 +25,12 @@ module Recurly
|
|
25
25
|
def << add_on
|
26
26
|
add_on = SubscriptionAddOn.new(add_on, @subscription)
|
27
27
|
|
28
|
-
exist = @add_ons.find
|
28
|
+
exist = @add_ons.find do |a|
|
29
|
+
source1 = a.add_on_source || "plan_add_on"
|
30
|
+
source2 = add_on.add_on_source || "plan_add_on"
|
31
|
+
a.add_on_code == add_on.add_on_code && source1 == source2
|
32
|
+
end
|
33
|
+
|
29
34
|
if exist
|
30
35
|
exist.quantity ||= 1
|
31
36
|
exist.quantity += add_on.quantity || 1
|
@@ -6,6 +6,9 @@ module Recurly
|
|
6
6
|
# @return [Pager<Usage>, []]
|
7
7
|
has_many :usage
|
8
8
|
|
9
|
+
# @return [[Tier], []]
|
10
|
+
has_many :tiers, class_name: :Tier, readonly: false
|
11
|
+
|
9
12
|
define_attribute_methods %w(
|
10
13
|
add_on_code
|
11
14
|
quantity
|
@@ -13,6 +16,7 @@ module Recurly
|
|
13
16
|
add_on_type
|
14
17
|
usage_type
|
15
18
|
usage_percentage
|
19
|
+
add_on_source
|
16
20
|
)
|
17
21
|
|
18
22
|
attr_reader :subscription
|
@@ -28,6 +32,10 @@ module Recurly
|
|
28
32
|
if add_on.unit_amount_in_cents
|
29
33
|
self.unit_amount_in_cents = add_on.unit_amount_in_cents.to_i
|
30
34
|
end
|
35
|
+
if add_on.respond_to? :add_on_source
|
36
|
+
self.add_on_source = add_on.add_on_source
|
37
|
+
end
|
38
|
+
self.tiers = add_on.tiers if add_on.tiers.any?
|
31
39
|
when Hash
|
32
40
|
self.attributes = add_on
|
33
41
|
when String, Symbol
|
data/lib/recurly/tax_detail.rb
CHANGED
data/lib/recurly/tier.rb
CHANGED
data/lib/recurly/transaction.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.18.
|
4
|
+
version: 2.18.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Recurly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|