recurly 2.18.10 → 2.18.15
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.rb +1 -0
- 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 +24 -9
- data/lib/recurly/invoice.rb +1 -0
- data/lib/recurly/item.rb +2 -0
- data/lib/recurly/plan.rb +2 -0
- data/lib/recurly/resource.rb +2 -2
- data/lib/recurly/subscription_add_on.rb +7 -1
- 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/verify.rb +12 -0
- data/lib/recurly/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9d5915fca9d21839f2f5029dc1b69123456fb1c8e6cb125eb3dfb52755ff8c3
|
4
|
+
data.tar.gz: c2446168d0188f6f225e7765a02726cec9fce548865226a5cd15872da0d9c175
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
17
|
+
gem 'recurly', '~> 2.18.15'
|
18
18
|
```
|
19
19
|
|
20
20
|
Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
|
data/lib/recurly.rb
CHANGED
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
@@ -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
|
-
|
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
|
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
|
@@ -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
|
-
|
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
|
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.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-
|
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
|