recurly 2.18.9 → 2.18.10
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/api.rb +1 -1
- data/lib/recurly/billing_info.rb +16 -11
- data/lib/recurly/plan.rb +1 -0
- data/lib/recurly/subscription/add_ons.rb +6 -1
- data/lib/recurly/subscription_add_on.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: 9385debc236700bed1b93ee013313ab4c70a7dfdea8c42e7d48a8d0dd755d26e
|
4
|
+
data.tar.gz: f8b0ee42838c58896a4c6c58b86795d75b2b952ba9abcf96424d751c93f24b75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ec2b05f194f44f727bd6ad3c553be37559a3a40735d7b1408eb151ee242f79f3e6368418c76dcec8d60156ae7724c2943549031fa4587679b67bcbc3a2c6ec7
|
7
|
+
data.tar.gz: 0b4277c3af336d565b7d2797f22f1897a4827e790dffd6dc6455ebd0f3b383bbc86392e6c6931e2272dc0e434db2fbcd9031f5b619b039b4cd92deeb32d84f24
|
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.10'
|
18
18
|
```
|
19
19
|
|
20
20
|
Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
|
data/lib/recurly/api.rb
CHANGED
data/lib/recurly/billing_info.rb
CHANGED
@@ -9,6 +9,7 @@ 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
|
12
13
|
|
13
14
|
# @return [Account]
|
14
15
|
belongs_to :account
|
@@ -37,37 +38,41 @@ module Recurly
|
|
37
38
|
fraud_session_id
|
38
39
|
three_d_secure_action_result_token_id
|
39
40
|
transaction_type
|
40
|
-
iban
|
41
41
|
mandate_reference
|
42
|
-
) | CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES | AMAZON_ATTRIBUTES | PAYPAL_ATTRIBUTES | ROKU_ATTRIBUTES | SEPA_ATTRIBUTES
|
43
|
-
|
44
|
-
# @return ["credit_card", "paypal", "amazon", "bank_account", "roku", "sepa", nil] The type of billing info.
|
45
|
-
attr_reader :type
|
42
|
+
) | CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES | AMAZON_ATTRIBUTES | PAYPAL_ATTRIBUTES | ROKU_ATTRIBUTES | SEPA_ATTRIBUTES | BACS_ATTRIBUTES
|
46
43
|
|
47
44
|
# @return [String]
|
48
45
|
def inspect
|
49
46
|
attributes = self.class.attribute_names
|
50
47
|
case type
|
51
48
|
when 'credit_card'
|
52
|
-
attributes -= (AMAZON_ATTRIBUTES + PAYPAL_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES)
|
49
|
+
attributes -= (AMAZON_ATTRIBUTES + PAYPAL_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES)
|
53
50
|
attributes |= CREDIT_CARD_ATTRIBUTES
|
54
51
|
when 'paypal'
|
55
|
-
attributes -= (CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES + AMAZON_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES)
|
52
|
+
attributes -= (CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES + AMAZON_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES)
|
56
53
|
when 'amazon'
|
57
|
-
attributes -= (CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES + PAYPAL_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES)
|
54
|
+
attributes -= (CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES + PAYPAL_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES)
|
58
55
|
when 'bank_account'
|
59
|
-
attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES)
|
56
|
+
attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES)
|
60
57
|
attributes |= BANK_ACCOUNT_ATTRIBUTES
|
61
58
|
when 'roku'
|
62
|
-
attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + SEPA_ATTRIBUTES)
|
59
|
+
attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES)
|
63
60
|
attributes |= ROKU_ATTRIBUTES
|
64
61
|
when 'sepa'
|
65
|
-
attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + ROKU_ATTRIBUTES)
|
62
|
+
attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + ROKU_ATTRIBUTES + BACS_ATTRIBUTES)
|
66
63
|
attributes |= SEPA_ATTRIBUTES
|
64
|
+
when 'bacs'
|
65
|
+
attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES)
|
66
|
+
attributes |= BACS_ATTRIBUTES
|
67
67
|
end
|
68
68
|
super attributes
|
69
69
|
end
|
70
70
|
|
71
|
+
# @return ["credit_card", "paypal", "amazon", "bank_account", "roku", "sepa", "bacs", nil] The type of billing info.
|
72
|
+
def type
|
73
|
+
self[:type] || @type
|
74
|
+
end
|
75
|
+
|
71
76
|
class << self
|
72
77
|
# Overrides the inherited member_path method to allow for billing info's
|
73
78
|
# irregular URL structure.
|
data/lib/recurly/plan.rb
CHANGED
@@ -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
|
@@ -13,6 +13,7 @@ module Recurly
|
|
13
13
|
add_on_type
|
14
14
|
usage_type
|
15
15
|
usage_percentage
|
16
|
+
add_on_source
|
16
17
|
)
|
17
18
|
|
18
19
|
attr_reader :subscription
|
@@ -28,6 +29,7 @@ module Recurly
|
|
28
29
|
if add_on.unit_amount_in_cents
|
29
30
|
self.unit_amount_in_cents = add_on.unit_amount_in_cents.to_i
|
30
31
|
end
|
32
|
+
self.add_on_source = add_on.add_on_source
|
31
33
|
when Hash
|
32
34
|
self.attributes = add_on
|
33
35
|
when String, Symbol
|
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.10
|
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-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|