recurly 2.18.11 → 2.18.16
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 +1 -0
- data/lib/recurly/api.rb +1 -1
- data/lib/recurly/billing_info.rb +24 -9
- data/lib/recurly/coupon.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 +0 -1
- data/lib/recurly/tier.rb +1 -0
- data/lib/recurly/verify.rb +12 -0
- data/lib/recurly/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81da082560bca542b9109eb8ae61089f33e28838f9c8b495f3cea9a37c612f5c
|
4
|
+
data.tar.gz: 2df98aa3795f057055ab8973584ab3facb05242316c8e299e7e8b88489fafa08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 206bda608a120910f408779cb21701e343b6e0d2753bfb6034555a1bae67f24966448c363772c12283a421bc21833e5c6af184a94a2de91408a0feadda6182d1
|
7
|
+
data.tar.gz: 823c10946b07e4dd80ba2a4a3152eef3a119cccc6ecf64adefcf0af0c4d0679d437ec9a652933294fba0b14e4a1f32976fe060aa365974136c192f8b6559c519
|
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.16'
|
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
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/coupon.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/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.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Recurly
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-05 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
|
@@ -331,7 +332,7 @@ homepage: https://github.com/recurly/recurly-client-ruby
|
|
331
332
|
licenses:
|
332
333
|
- MIT
|
333
334
|
metadata: {}
|
334
|
-
post_install_message:
|
335
|
+
post_install_message:
|
335
336
|
rdoc_options:
|
336
337
|
- "--main"
|
337
338
|
- README.md
|
@@ -349,7 +350,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
349
350
|
version: '0'
|
350
351
|
requirements: []
|
351
352
|
rubygems_version: 3.0.3
|
352
|
-
signing_key:
|
353
|
+
signing_key:
|
353
354
|
specification_version: 4
|
354
355
|
summary: Recurly API Client
|
355
356
|
test_files: []
|