recurly 2.6.4 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of recurly might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/lib/recurly.rb +1 -18
- data/lib/recurly/account.rb +3 -1
- data/lib/recurly/account_balance.rb +11 -0
- data/lib/recurly/add_on.rb +1 -0
- data/lib/recurly/adjustment.rb +1 -0
- data/lib/recurly/api.rb +1 -9
- data/lib/recurly/api/net_http_adapter.rb +0 -1
- data/lib/recurly/plan.rb +2 -0
- data/lib/recurly/resource.rb +5 -7
- data/lib/recurly/subscription.rb +1 -0
- data/lib/recurly/transaction.rb +3 -0
- data/lib/recurly/version.rb +2 -2
- metadata +23 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: dc732a5ca8416f1d5546b1ae6817b9c1a460356f
|
4
|
+
data.tar.gz: 46a561b5db08c3751e3f137fcf48753ff745cdf9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 899b14789c5b52e5168e46c94054b79098d5c36ea31a1a86dfcb9bc8939d338f81cab622f853c6584dc751fafe1e2e3a180d0b2b29463c44de3e9dc6f17a44f3
|
7
|
+
data.tar.gz: c599887af8463d163cf228eb15b625368a27017203913db1d44c71fb114e0e1d79f7c87501e2aa14ee6b0022a0d7dde3293c6ddf810192d04f278d7835d24724
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ Recurly is packaged as a Ruby gem. We recommend you install it with
|
|
12
12
|
[Bundler](http://gembundler.com/) by adding the following line to your Gemfile:
|
13
13
|
|
14
14
|
``` ruby
|
15
|
-
gem 'recurly', '~> 2.
|
15
|
+
gem 'recurly', '~> 2.7.0'
|
16
16
|
```
|
17
17
|
|
18
18
|
Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
|
data/lib/recurly.rb
CHANGED
@@ -6,6 +6,7 @@ module Recurly
|
|
6
6
|
require 'recurly/resource'
|
7
7
|
require 'recurly/billing_info'
|
8
8
|
require 'recurly/account'
|
9
|
+
require 'recurly/account_balance'
|
9
10
|
require 'recurly/add_on'
|
10
11
|
require 'recurly/address'
|
11
12
|
require 'recurly/tax_detail'
|
@@ -80,8 +81,6 @@ module Recurly
|
|
80
81
|
end
|
81
82
|
|
82
83
|
# Assigns a logger to log requests/responses and more.
|
83
|
-
# The logger can only be set if the environment variable
|
84
|
-
# `RECURLY_INSECURE_DEBUG` equals `true`.
|
85
84
|
#
|
86
85
|
# @return [Logger, nil]
|
87
86
|
# @example
|
@@ -93,22 +92,6 @@ module Recurly
|
|
93
92
|
# Recurly.logger = nil # Or Recurly.logger = Logger.new nil
|
94
93
|
attr_accessor :logger
|
95
94
|
|
96
|
-
def logger=(logger)
|
97
|
-
if ENV['RECURLY_INSECURE_DEBUG'].to_s.downcase == 'true'
|
98
|
-
@logger = logger
|
99
|
-
puts <<-MSG
|
100
|
-
[WARNING] Recurly logger enabled. The logger has the potential to leak
|
101
|
-
PII and should never be used in production environments.
|
102
|
-
MSG
|
103
|
-
else
|
104
|
-
puts <<-MSG
|
105
|
-
[WARNING] Recurly logger has been disabled. If you wish to use it,
|
106
|
-
only do so in a non-production environment and make sure
|
107
|
-
the `RECURLY_INSECURE_DEBUG` environment variable is set to `true`.
|
108
|
-
MSG
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
95
|
# Convenience logging method includes a Logger#progname dynamically.
|
113
96
|
# @return [true, nil]
|
114
97
|
def log level, message
|
data/lib/recurly/account.rb
CHANGED
@@ -16,11 +16,13 @@ module Recurly
|
|
16
16
|
has_many :invoices
|
17
17
|
has_many :subscriptions
|
18
18
|
has_many :transactions
|
19
|
+
has_many :redemptions
|
19
20
|
|
20
21
|
# @return [BillingInfo, nil]
|
21
22
|
has_one :billing_info, :readonly => false
|
22
23
|
|
23
|
-
|
24
|
+
# @return [AccountBalance, nil]
|
25
|
+
has_one :account_balance, :readonly => true
|
24
26
|
|
25
27
|
def redemption coupon_code
|
26
28
|
redemptions.detect { |r| r.coupon_code == coupon_code }
|
data/lib/recurly/add_on.rb
CHANGED
data/lib/recurly/adjustment.rb
CHANGED
data/lib/recurly/api.rb
CHANGED
@@ -15,9 +15,8 @@ module Recurly
|
|
15
15
|
require 'recurly/api/errors'
|
16
16
|
|
17
17
|
@@base_uri = "https://api.recurly.com/v2/"
|
18
|
-
@@valid_domains = [".recurly.com"]
|
19
18
|
|
20
|
-
RECURLY_API_VERSION = '2.
|
19
|
+
RECURLY_API_VERSION = '2.3'
|
21
20
|
|
22
21
|
FORMATS = Helper.hash_with_indifferent_read_access(
|
23
22
|
'pdf' => 'application/pdf',
|
@@ -76,13 +75,6 @@ module Recurly
|
|
76
75
|
URI.parse @@base_uri.sub('api', Recurly.subdomain)
|
77
76
|
end
|
78
77
|
|
79
|
-
def validate_uri!(uri)
|
80
|
-
domain = @@valid_domains.detect { |d| uri.host.end_with?(d) }
|
81
|
-
unless domain
|
82
|
-
raise ArgumentError, "URI #{uri} is invalid. You may only make requests to a Recurly domain."
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
78
|
# @return [String]
|
87
79
|
def user_agent
|
88
80
|
"Recurly/#{Version}; #{RUBY_DESCRIPTION}"
|
data/lib/recurly/plan.rb
CHANGED
data/lib/recurly/resource.rb
CHANGED
@@ -328,8 +328,9 @@ module Recurly
|
|
328
328
|
raise NotFound, "can't find a record with nil identifier"
|
329
329
|
end
|
330
330
|
|
331
|
+
uri = uuid =~ /^http/ ? uuid : member_path(uuid)
|
331
332
|
begin
|
332
|
-
from_response API.get(
|
333
|
+
from_response API.get(uri, {}, options)
|
333
334
|
rescue API::NotFound => e
|
334
335
|
raise NotFound, e.description
|
335
336
|
end
|
@@ -609,12 +610,9 @@ module Recurly
|
|
609
610
|
return if response.body.to_s.length.zero?
|
610
611
|
fresh = self.class.from_response response
|
611
612
|
else
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
else
|
616
|
-
self.class.find(to_param, options)
|
617
|
-
end
|
613
|
+
fresh = self.class.find(
|
614
|
+
@href || to_param, :etag => (etag unless changed?)
|
615
|
+
)
|
618
616
|
end
|
619
617
|
fresh and copy_from fresh
|
620
618
|
persist! true
|
data/lib/recurly/subscription.rb
CHANGED
data/lib/recurly/transaction.rb
CHANGED
data/lib/recurly/version.rb
CHANGED
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recurly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Recurly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '11.1'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '11.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '5.8'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '5.8'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: webmock
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.24'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.24'
|
55
55
|
description: 'An API client library for Recurly: http://recurly.com'
|
@@ -60,20 +60,18 @@ extensions: []
|
|
60
60
|
extra_rdoc_files:
|
61
61
|
- README.md
|
62
62
|
files:
|
63
|
-
- README.md
|
64
|
-
- bin/recurly
|
65
63
|
- lib/ecurly.rb
|
66
64
|
- lib/rails/generators/recurly/config_generator.rb
|
67
65
|
- lib/rails/recurly.rb
|
68
|
-
- lib/recurly.rb
|
69
66
|
- lib/recurly/account.rb
|
67
|
+
- lib/recurly/account_balance.rb
|
70
68
|
- lib/recurly/add_on.rb
|
71
69
|
- lib/recurly/address.rb
|
72
70
|
- lib/recurly/adjustment.rb
|
73
71
|
- lib/recurly/all.rb
|
74
|
-
- lib/recurly/api.rb
|
75
72
|
- lib/recurly/api/errors.rb
|
76
73
|
- lib/recurly/api/net_http_adapter.rb
|
74
|
+
- lib/recurly/api.rb
|
77
75
|
- lib/recurly/billing_info.rb
|
78
76
|
- lib/recurly/coupon.rb
|
79
77
|
- lib/recurly/error.rb
|
@@ -84,19 +82,18 @@ files:
|
|
84
82
|
- lib/recurly/money.rb
|
85
83
|
- lib/recurly/plan.rb
|
86
84
|
- lib/recurly/redemption.rb
|
87
|
-
- lib/recurly/resource.rb
|
88
85
|
- lib/recurly/resource/association.rb
|
89
86
|
- lib/recurly/resource/errors.rb
|
90
87
|
- lib/recurly/resource/pager.rb
|
91
|
-
- lib/recurly/
|
88
|
+
- lib/recurly/resource.rb
|
92
89
|
- lib/recurly/subscription/add_ons.rb
|
90
|
+
- lib/recurly/subscription.rb
|
93
91
|
- lib/recurly/subscription_add_on.rb
|
94
92
|
- lib/recurly/tax_detail.rb
|
95
|
-
- lib/recurly/transaction.rb
|
96
93
|
- lib/recurly/transaction/errors.rb
|
94
|
+
- lib/recurly/transaction.rb
|
97
95
|
- lib/recurly/usage.rb
|
98
96
|
- lib/recurly/version.rb
|
99
|
-
- lib/recurly/webhook.rb
|
100
97
|
- lib/recurly/webhook/account_notification.rb
|
101
98
|
- lib/recurly/webhook/billing_info_updated_notification.rb
|
102
99
|
- lib/recurly/webhook/canceled_account_notification.rb
|
@@ -121,33 +118,38 @@ files:
|
|
121
118
|
- lib/recurly/webhook/transaction_notification.rb
|
122
119
|
- lib/recurly/webhook/updated_subscription_notification.rb
|
123
120
|
- lib/recurly/webhook/void_payment_notification.rb
|
124
|
-
- lib/recurly/
|
121
|
+
- lib/recurly/webhook.rb
|
125
122
|
- lib/recurly/xml/nokogiri.rb
|
126
123
|
- lib/recurly/xml/rexml.rb
|
124
|
+
- lib/recurly/xml.rb
|
125
|
+
- lib/recurly.rb
|
126
|
+
- README.md
|
127
|
+
- bin/recurly
|
127
128
|
homepage: https://github.com/recurly/recurly-client-ruby
|
128
129
|
licenses:
|
129
130
|
- MIT
|
130
131
|
metadata: {}
|
131
132
|
post_install_message:
|
132
133
|
rdoc_options:
|
133
|
-
-
|
134
|
+
- --main
|
134
135
|
- README.md
|
135
136
|
require_paths:
|
136
137
|
- lib
|
137
138
|
required_ruby_version: !ruby/object:Gem::Requirement
|
138
139
|
requirements:
|
139
|
-
- -
|
140
|
+
- - '>='
|
140
141
|
- !ruby/object:Gem::Version
|
141
142
|
version: 1.9.3
|
142
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
144
|
requirements:
|
144
|
-
- -
|
145
|
+
- - '>='
|
145
146
|
- !ruby/object:Gem::Version
|
146
147
|
version: '0'
|
147
148
|
requirements: []
|
148
149
|
rubyforge_project:
|
149
|
-
rubygems_version: 2.
|
150
|
+
rubygems_version: 2.0.14.1
|
150
151
|
signing_key:
|
151
152
|
specification_version: 4
|
152
153
|
summary: Recurly API Client
|
153
154
|
test_files: []
|
155
|
+
has_rdoc: true
|