recurly 2.4.12 → 2.5.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 +0 -18
- data/lib/recurly/account.rb +2 -2
- data/lib/recurly/api.rb +0 -8
- data/lib/recurly/api/net_http_adapter.rb +0 -1
- data/lib/recurly/redemption.rb +1 -4
- data/lib/recurly/resource.rb +6 -12
- data/lib/recurly/version.rb +2 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c4b6f4de73e5245f4dc7644b7b2fef85d66b487b
|
4
|
+
data.tar.gz: 1f0834deed95841651bce343cb8dc31decce349a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d46980a0aadb012432ded4046e46a8062e4d7e75d95d9848f7fce3715b4dc26bd78a4f50c111f11bed930104a7c9d5ed657388b13b195aee6d708b5493f01d8e
|
7
|
+
data.tar.gz: b270c39134d6ff05cde1b84e5ee6103d07890ed7d94f310805409d7ba2395ea616f9d91e3bc114232eed7512ea8edbddfe81dfc660ac5aee698bf6d3763308f4
|
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.5.0'
|
16
16
|
```
|
17
17
|
|
18
18
|
Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
|
data/lib/recurly.rb
CHANGED
@@ -88,8 +88,6 @@ module Recurly
|
|
88
88
|
end
|
89
89
|
|
90
90
|
# Assigns a logger to log requests/responses and more.
|
91
|
-
# The logger can only be set if the environment variable
|
92
|
-
# `RECURLY_INSECURE_DEBUG` equals `true`.
|
93
91
|
#
|
94
92
|
# @return [Logger, nil]
|
95
93
|
# @example
|
@@ -101,22 +99,6 @@ module Recurly
|
|
101
99
|
# Recurly.logger = nil # Or Recurly.logger = Logger.new nil
|
102
100
|
attr_accessor :logger
|
103
101
|
|
104
|
-
def logger=(logger)
|
105
|
-
if ENV['RECURLY_INSECURE_DEBUG'].to_s.downcase == 'true'
|
106
|
-
@logger = logger
|
107
|
-
puts <<-MSG
|
108
|
-
[WARNING] Recurly logger enabled. The logger has the potential to leak
|
109
|
-
PII and should never be used in production environments.
|
110
|
-
MSG
|
111
|
-
else
|
112
|
-
puts <<-MSG
|
113
|
-
[WARNING] Recurly logger has been disabled. If you wish to use it,
|
114
|
-
only do so in a non-production environment and make sure
|
115
|
-
the `RECURLY_INSECURE_DEBUG` environment variable is set to `true`.
|
116
|
-
MSG
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
102
|
# Convenience logging method includes a Logger#progname dynamically.
|
121
103
|
# @return [true, nil]
|
122
104
|
def log level, message
|
data/lib/recurly/account.rb
CHANGED
data/lib/recurly/api.rb
CHANGED
@@ -15,7 +15,6 @@ 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
19
|
RECURLY_API_VERSION = '2.1'
|
21
20
|
|
@@ -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/redemption.rb
CHANGED
@@ -24,14 +24,11 @@ module Recurly
|
|
24
24
|
total_discounted_in_cents
|
25
25
|
currency
|
26
26
|
state
|
27
|
+
coupon_code
|
27
28
|
subscription_uuid
|
28
29
|
created_at
|
29
30
|
)
|
30
31
|
|
31
|
-
def destroy_uri
|
32
|
-
uri + "s/#{uuid}"
|
33
|
-
end
|
34
|
-
|
35
32
|
def save
|
36
33
|
return false if persisted?
|
37
34
|
copy_from coupon.redeem account, currency
|
data/lib/recurly/resource.rb
CHANGED
@@ -322,8 +322,9 @@ module Recurly
|
|
322
322
|
raise NotFound, "can't find a record with nil identifier"
|
323
323
|
end
|
324
324
|
|
325
|
+
uri = uuid =~ /^http/ ? uuid : member_path(uuid)
|
325
326
|
begin
|
326
|
-
from_response API.get(
|
327
|
+
from_response API.get(uri, {}, options)
|
327
328
|
rescue API::NotFound => e
|
328
329
|
raise NotFound, e.description
|
329
330
|
end
|
@@ -596,12 +597,9 @@ module Recurly
|
|
596
597
|
return if response.body.to_s.length.zero?
|
597
598
|
fresh = self.class.from_response response
|
598
599
|
else
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
else
|
603
|
-
self.class.find(to_param, options)
|
604
|
-
end
|
600
|
+
fresh = self.class.find(
|
601
|
+
@href || to_param, :etag => (etag unless changed?)
|
602
|
+
)
|
605
603
|
end
|
606
604
|
fresh and copy_from fresh
|
607
605
|
persist! true
|
@@ -919,16 +917,12 @@ module Recurly
|
|
919
917
|
# race_condition.destroy # raises Recurly::Resource::NotFound
|
920
918
|
def destroy
|
921
919
|
return false unless persisted?
|
922
|
-
@response = API.delete
|
920
|
+
@response = API.delete uri
|
923
921
|
@destroyed = true
|
924
922
|
rescue API::NotFound => e
|
925
923
|
raise NotFound, e.description
|
926
924
|
end
|
927
925
|
|
928
|
-
def destroy_uri
|
929
|
-
uri
|
930
|
-
end
|
931
|
-
|
932
926
|
def signable_attributes
|
933
927
|
Hash[xml_keys.map { |key| [key, self[key]] }]
|
934
928
|
end
|
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.
|
4
|
+
version: 2.5.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-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -143,8 +143,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
143
|
version: '0'
|
144
144
|
requirements: []
|
145
145
|
rubyforge_project:
|
146
|
-
rubygems_version: 2.
|
146
|
+
rubygems_version: 2.2.5
|
147
147
|
signing_key:
|
148
148
|
specification_version: 4
|
149
149
|
summary: Recurly API Client
|
150
150
|
test_files: []
|
151
|
+
has_rdoc: true
|