recurly 2.11.4 → 2.12.0

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
- SHA256:
3
- metadata.gz: e3df40f9f11d5d004fa052ae8e050dfd43b262174b6bffdeb8727b914d3a102b
4
- data.tar.gz: add471129aad67a7599a1d0cfcc4f74192f07f9e3ea4f46e3ef20e3a03a553b7
2
+ SHA1:
3
+ metadata.gz: 30039336af3791ec6be7d1558b24c2b473905847
4
+ data.tar.gz: c10ff1cda98c646bb3c1412f4168a218ba4b2b03
5
5
  SHA512:
6
- metadata.gz: f8223bdf8af0e1f8327ec89eb34de782a7fb1c7445663bfa7961f5f547e53978e7bd0ae9122c4560e9224d121d5daa98e2af5dfaf117c3385a37d88448af99f4
7
- data.tar.gz: c0494a00072ddad91b395394628257ee71f2ef5a008fa4fa0056f4ff03832ba2415f405d829669f93b169d93b1b584c57642f45e67dfe70d9c11ea86483f813c
6
+ metadata.gz: 6e2590f4f92aed783303979a9e7a78c7f671a9987c24721f0ff80544cb23e85f77168adfc35263f95247873c4fa76ff07405741650a7adb24075e0d7424175cd
7
+ data.tar.gz: 483cfeb2fe5d42b7465c4acbcae83532697166ae4d1624ba7fa3c8321228cc9a5c15784321def41a60a6a39911e137e27a6dd7ad68abea0b4ec636c67f634600
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.11.3'
17
+ gem 'recurly', '~> 2.12.0'
18
18
  ```
19
19
 
20
20
  Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
data/lib/recurly.rb CHANGED
@@ -87,8 +87,6 @@ module Recurly
87
87
  end
88
88
 
89
89
  # Assigns a logger to log requests/responses and more.
90
- # The logger can only be set if the environment variable
91
- # `RECURLY_INSECURE_DEBUG` equals `true`.
92
90
  #
93
91
  # @return [Logger, nil]
94
92
  # @example
@@ -100,22 +98,6 @@ module Recurly
100
98
  # Recurly.logger = nil # Or Recurly.logger = Logger.new nil
101
99
  attr_accessor :logger
102
100
 
103
- def logger=(logger)
104
- if ENV['RECURLY_INSECURE_DEBUG'].to_s.downcase == 'true'
105
- @logger = logger
106
- puts <<-MSG
107
- [WARNING] Recurly logger enabled. The logger has the potential to leak
108
- PII and should never be used in production environments.
109
- MSG
110
- else
111
- puts <<-MSG
112
- [WARNING] Recurly logger has been disabled. If you wish to use it,
113
- only do so in a non-production environment and make sure
114
- the `RECURLY_INSECURE_DEBUG` environment variable is set to `true`.
115
- MSG
116
- end
117
- end
118
-
119
101
  # Convenience logging method includes a Logger#progname dynamically.
120
102
  # @return [true, nil]
121
103
  def log level, message
data/lib/recurly/api.rb CHANGED
@@ -17,7 +17,7 @@ module Recurly
17
17
  @@base_uri = "https://api.recurly.com/v2/"
18
18
  @@valid_domains = [".recurly.com"]
19
19
 
20
- RECURLY_API_VERSION = '2.8'
20
+ RECURLY_API_VERSION = '2.9'
21
21
 
22
22
  FORMATS = Helper.hash_with_indifferent_read_access(
23
23
  'pdf' => 'application/pdf',
@@ -30,6 +30,7 @@ module Recurly
30
30
  currency
31
31
  geo_code
32
32
  updated_at
33
+ external_hpp_type
33
34
  ) | CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES | AMAZON_ATTRIBUTES | PAYPAL_ATTRIBUTES | ROKU_ATTRIBUTES
34
35
 
35
36
  # @return ["credit_card", "paypal", "amazon", "bank_account", "roku", nil] The type of billing info.
@@ -18,9 +18,6 @@ module Recurly
18
18
  # @return [Account]
19
19
  belongs_to :account
20
20
 
21
- # @return [Subscription]
22
- belongs_to :subscription
23
-
24
21
  # @return [Pager<Subscription>, []]
25
22
  has_many :subscriptions
26
23
 
@@ -102,12 +102,12 @@ module Recurly
102
102
 
103
103
  class << self
104
104
 
105
- # Generate an invoice for the purchase and run any needed transactions
105
+ # Generate an invoice for the purchase and run any needed transactions.
106
106
  #
107
- # @param purchase [Purchase] The purchase data for the request
108
- # @return [Invoice] The new invoice representing this purchase
109
- # @raise [Invalid] Raised if the account cannot be invoiced.
110
- # @raise [Transaction::Error] Raised if the transaction failed
107
+ # @param purchase [Purchase] The purchase data for the request.
108
+ # @return [Invoice] The saved invoice representing this purchase.
109
+ # @raise [Invalid] Raised if the purchase cannot be invoiced.
110
+ # @raise [Transaction::Error] Raised if the transaction failed.
111
111
  def invoice!(purchase)
112
112
  post(purchase, collection_path)
113
113
  end
@@ -115,13 +115,26 @@ module Recurly
115
115
  # Generate a preview invoice for the purchase. Runs validations
116
116
  # but does not run any transactions.
117
117
  #
118
- # @param purchase [Purchase] The purchase data for the request
119
- # @return [Invoice] The new invoice representing this purchase
120
- # @raise [Invalid] Raised if the account cannot be invoiced.
118
+ # @param purchase [Purchase] The purchase data for the request.
119
+ # @return [Invoice] The preview invoice representing this purchase.
120
+ # @raise [Invalid] Raised if the purchase cannot be invoiced.
121
121
  def preview!(purchase)
122
122
  post(purchase, "#{collection_path}/preview")
123
123
  end
124
124
 
125
+ # Generate an authorized invoice for the purchase. Runs validations
126
+ # but does not run any transactions. This endpoint will create a
127
+ # pending purchase that can be activated at a later time once payment
128
+ # has been completed on an external source (e.g. Adyen's Hosted
129
+ # Payment Pages).
130
+ #
131
+ # @param purchase [Purchase] The purchase data for the request.
132
+ # @return [Invoice] The authorized invoice representing this purchase.
133
+ # @raise [Invalid] Raised if the purchase cannot be invoiced.
134
+ def authorize!(purchase)
135
+ post(purchase, "#{collection_path}/authorize")
136
+ end
137
+
125
138
  def post(purchase, path)
126
139
  response = API.send(:post, path, purchase.to_xml)
127
140
  Invoice.from_response(response)
@@ -16,8 +16,6 @@ module Recurly
16
16
  belongs_to :account
17
17
  # @return [Invoice, nil]
18
18
  belongs_to :invoice
19
- # @return [Subscription, nil]
20
- belongs_to :subscription
21
19
 
22
20
  # @return [Pager<Subscription>, nil]
23
21
  has_many :subscriptions
@@ -1,8 +1,8 @@
1
1
  module Recurly
2
2
  module Version
3
3
  MAJOR = 2
4
- MINOR = 11
5
- PATCH = 4
4
+ MINOR = 12
5
+ PATCH = 0
6
6
  PRE = nil
7
7
 
8
8
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join('.').freeze
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.11.4
4
+ version: 2.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-09 00:00:00.000000000 Z
11
+ date: 2017-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  version: '0'
239
239
  requirements: []
240
240
  rubyforge_project:
241
- rubygems_version: 2.7.6
241
+ rubygems_version: 2.6.13
242
242
  signing_key:
243
243
  specification_version: 4
244
244
  summary: Recurly API Client