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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc652c9bf17962b4cba8a2e1bb07f4ed3f22f50169ccb25e914ada87a04b2e9f
4
- data.tar.gz: 469194dbfb35df3ff98392edc8e830142e2b53cbf0ed28ca70c59b2179d7c64e
3
+ metadata.gz: 9385debc236700bed1b93ee013313ab4c70a7dfdea8c42e7d48a8d0dd755d26e
4
+ data.tar.gz: f8b0ee42838c58896a4c6c58b86795d75b2b952ba9abcf96424d751c93f24b75
5
5
  SHA512:
6
- metadata.gz: 74d95dd33418be41ae07cf3809cfb3f5fef49b7f9b42de17f9a85e350951c58f1a7df180345a4b2de3f9413c7c5fdf36440b2c2368ba3878cb7782bc84373305
7
- data.tar.gz: f66bd9275edb0509f433d5caf5112bd9304f0ad72d146c1875bf38d72f8657e243850daf87afa3737b5cf79eb2dab38ef1ee883517ac2f216b91a493ffcf883e
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.9'
17
+ gem 'recurly', '~> 2.18.10'
18
18
  ```
19
19
 
20
20
  Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
@@ -18,7 +18,7 @@ module Recurly
18
18
  @@base_uri = "https://api.recurly.com/v2/"
19
19
  @@valid_domains = [".recurly.com"]
20
20
 
21
- RECURLY_API_VERSION = '2.26'
21
+ RECURLY_API_VERSION = '2.27'
22
22
 
23
23
  FORMATS = Helper.hash_with_indifferent_read_access(
24
24
  'pdf' => 'application/pdf',
@@ -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.
@@ -32,6 +32,7 @@ module Recurly
32
32
  tax_code
33
33
  trial_requires_billing_info
34
34
  auto_renew
35
+ allow_any_item_on_subscriptions
35
36
  created_at
36
37
  updated_at
37
38
  )
@@ -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 { |a| a.add_on_code == add_on.add_on_code }
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
@@ -1,6 +1,6 @@
1
1
  module Recurly
2
2
  module Version
3
- VERSION = "2.18.9"
3
+ VERSION = "2.18.10"
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.9
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-04-15 00:00:00.000000000 Z
11
+ date: 2020-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri