recurly 2.18.10 → 2.18.15

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: 9385debc236700bed1b93ee013313ab4c70a7dfdea8c42e7d48a8d0dd755d26e
4
- data.tar.gz: f8b0ee42838c58896a4c6c58b86795d75b2b952ba9abcf96424d751c93f24b75
3
+ metadata.gz: c9d5915fca9d21839f2f5029dc1b69123456fb1c8e6cb125eb3dfb52755ff8c3
4
+ data.tar.gz: c2446168d0188f6f225e7765a02726cec9fce548865226a5cd15872da0d9c175
5
5
  SHA512:
6
- metadata.gz: 9ec2b05f194f44f727bd6ad3c553be37559a3a40735d7b1408eb151ee242f79f3e6368418c76dcec8d60156ae7724c2943549031fa4587679b67bcbc3a2c6ec7
7
- data.tar.gz: 0b4277c3af336d565b7d2797f22f1897a4827e790dffd6dc6455ebd0f3b383bbc86392e6c6931e2272dc0e434db2fbcd9031f5b619b039b4cd92deeb32d84f24
6
+ metadata.gz: 6a43add77b2f6282aa551f662039a042d69cbd955cc9e7902d4a6e9fc35020902e5946182c1cb5c3b8551aa653dacfee237fb3b4db2333d7061128f1c78f3828
7
+ data.tar.gz: 5505a3f99ef1c65fc6dea6456f0ab3f77bc63fd98bba8c2e8fbe7cdcb010381b7d0b71236b9869898bce5b05be3703bd4223fb0e0e526fa1ab98284a7b89e019
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.10'
17
+ gem 'recurly', '~> 2.18.15'
18
18
  ```
19
19
 
20
20
  Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
@@ -40,6 +40,7 @@ module Recurly
40
40
  require 'recurly/gift_card'
41
41
  require 'recurly/purchase'
42
42
  require 'recurly/webhook'
43
+ require 'recurly/verify'
43
44
  require 'recurly/tier'
44
45
 
45
46
  @subdomain = nil
@@ -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
@@ -57,6 +57,8 @@ module Recurly
57
57
  original_adjustment_uuid
58
58
  shipping_address_id
59
59
  surcharge_in_cents
60
+ avalara_transaction_type
61
+ avalara_service_type
60
62
  )
61
63
  alias to_param uuid
62
64
 
@@ -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.27'
21
+ RECURLY_API_VERSION = '2.29'
22
22
 
23
23
  FORMATS = Helper.hash_with_indifferent_read_access(
24
24
  'pdf' => 'application/pdf',
@@ -10,6 +10,7 @@ module Recurly
10
10
  ROKU_ATTRIBUTES = %w(roku_billing_agreement_id last_four).freeze
11
11
  SEPA_ATTRIBUTES = %w(iban).freeze
12
12
  BACS_ATTRIBUTES = %w(account_number sort_code type).freeze
13
+ BECS_ATTRIBUTES = %w(account_number bsb_code type).freeze
13
14
 
14
15
  # @return [Account]
15
16
  belongs_to :account
@@ -39,36 +40,50 @@ module Recurly
39
40
  three_d_secure_action_result_token_id
40
41
  transaction_type
41
42
  mandate_reference
42
- ) | CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES | AMAZON_ATTRIBUTES | PAYPAL_ATTRIBUTES | ROKU_ATTRIBUTES | SEPA_ATTRIBUTES | BACS_ATTRIBUTES
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
+
47
+ # Verify an account's stored billing info
48
+ #
49
+ # @param [Hash] gateway_code (optional) is the code for the gateway to use for verification. If unspecified, a gateway will be selected using the normal rules.
50
+ # @return [Transaction]
51
+ # @raise [Invalid] Raise if the account's billing info cannot be verified
52
+ def verify(attrs = {})
53
+ Transaction.from_response API.post("#{path}/verify", attrs.empty? ? nil : Verify.to_xml(attrs))
54
+ end
43
55
 
44
56
  # @return [String]
45
57
  def inspect
46
58
  attributes = self.class.attribute_names
47
59
  case type
48
60
  when 'credit_card'
49
- attributes -= (AMAZON_ATTRIBUTES + PAYPAL_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES)
61
+ attributes -= (AMAZON_ATTRIBUTES + PAYPAL_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES + BECS_ATTRIBUTES)
50
62
  attributes |= CREDIT_CARD_ATTRIBUTES
51
63
  when 'paypal'
52
- attributes -= (CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES + AMAZON_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES)
64
+ attributes -= (CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES + AMAZON_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES + BECS_ATTRIBUTES)
53
65
  when 'amazon'
54
- attributes -= (CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES + PAYPAL_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES)
66
+ attributes -= (CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES + PAYPAL_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES + BECS_ATTRIBUTES)
55
67
  when 'bank_account'
56
- attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES)
68
+ attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES + BECS_ATTRIBUTES)
57
69
  attributes |= BANK_ACCOUNT_ATTRIBUTES
58
70
  when 'roku'
59
- attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES)
71
+ attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES + BECS_ATTRIBUTES)
60
72
  attributes |= ROKU_ATTRIBUTES
61
73
  when 'sepa'
62
- attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + ROKU_ATTRIBUTES + BACS_ATTRIBUTES)
74
+ attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + ROKU_ATTRIBUTES + BACS_ATTRIBUTES + BECS_ATTRIBUTES)
63
75
  attributes |= SEPA_ATTRIBUTES
64
76
  when 'bacs'
65
- attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES)
77
+ attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BECS_ATTRIBUTES)
66
78
  attributes |= BACS_ATTRIBUTES
79
+ when 'becs'
80
+ attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES + ROKU_ATTRIBUTES + SEPA_ATTRIBUTES + BACS_ATTRIBUTES)
81
+ attributes |= BECS_ATTRIBUTES
67
82
  end
68
83
  super attributes
69
84
  end
70
85
 
71
- # @return ["credit_card", "paypal", "amazon", "bank_account", "roku", "sepa", "bacs", nil] The type of billing info.
86
+ # @return ["credit_card", "paypal", "amazon", "bank_account", "roku", "sepa", "bacs", "becs", nil] The type of billing info.
72
87
  def type
73
88
  self[:type] || @type
74
89
  end
@@ -110,6 +110,7 @@ module Recurly
110
110
  final_dunning_event
111
111
  gateway_code
112
112
  surcharge_in_cents
113
+ tax_details
113
114
  )
114
115
  alias to_param invoice_number_with_prefix
115
116
 
@@ -11,6 +11,8 @@ module Recurly
11
11
  accounting_code
12
12
  revenue_schedule_type
13
13
  state
14
+ avalara_transaction_type
15
+ avalara_service_type
14
16
  created_at
15
17
  updated_at
16
18
  deleted_at
@@ -33,6 +33,8 @@ module Recurly
33
33
  trial_requires_billing_info
34
34
  auto_renew
35
35
  allow_any_item_on_subscriptions
36
+ avalara_transaction_type
37
+ avalara_service_type
36
38
  created_at
37
39
  updated_at
38
40
  )
@@ -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, Subscription::AddOns
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
@@ -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
@@ -29,7 +32,10 @@ module Recurly
29
32
  if add_on.unit_amount_in_cents
30
33
  self.unit_amount_in_cents = add_on.unit_amount_in_cents.to_i
31
34
  end
32
- self.add_on_source = add_on.add_on_source
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?
33
39
  when Hash
34
40
  self.attributes = add_on
35
41
  when String, Symbol
@@ -7,6 +7,8 @@ module Recurly
7
7
  type
8
8
  tax_rate
9
9
  tax_in_cents
10
+ level
11
+ billable
10
12
  )
11
13
 
12
14
  embedded! true
@@ -2,6 +2,7 @@ module Recurly
2
2
  class Tier < Resource
3
3
 
4
4
  belongs_to :add_on
5
+ belongs_to :subscription_add_on
5
6
 
6
7
  define_attribute_methods %w(
7
8
  ending_quantity
@@ -70,6 +70,8 @@ module Recurly
70
70
  billing_country
71
71
  subscription_id
72
72
  manually_entered
73
+ avalara_transaction_type
74
+ avalara_service_type
73
75
  )
74
76
  alias to_param uuid
75
77
  alias fraud_info fraud
@@ -0,0 +1,12 @@
1
+ module Recurly
2
+ class Verify < Resource
3
+ define_attribute_methods %w(
4
+ gateway_code
5
+ )
6
+
7
+ def self.to_xml(attrs)
8
+ verify = new attrs
9
+ verify.to_xml
10
+ end
11
+ end
12
+ end
@@ -1,6 +1,6 @@
1
1
  module Recurly
2
2
  module Version
3
- VERSION = "2.18.10"
3
+ VERSION = "2.18.15"
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.10
4
+ version: 2.18.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-30 00:00:00.000000000 Z
11
+ date: 2020-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -253,6 +253,7 @@ files:
253
253
  - lib/recurly/transaction.rb
254
254
  - lib/recurly/transaction/errors.rb
255
255
  - lib/recurly/usage.rb
256
+ - lib/recurly/verify.rb
256
257
  - lib/recurly/version.rb
257
258
  - lib/recurly/webhook.rb
258
259
  - lib/recurly/webhook/account_notification.rb