recurly 2.4.0 → 2.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39d29efdd5130af37d30fed7585a480ddd295dcb
4
- data.tar.gz: 6d5f1620ff648319c552eb70249b39e8dd6cd678
3
+ metadata.gz: d567b8311cdce239cb392169321fc856f1878249
4
+ data.tar.gz: 028a4010498bf77cf85c2436a91146589143cd41
5
5
  SHA512:
6
- metadata.gz: b8fc77aced05652c1691ba483954b35fcfe4e8052286469ee3b641d02b5e5de3fc2bbbb2c71969fd65991f1bdbd135bdbe8f123cb8383ff02ac1f58e5d51b869
7
- data.tar.gz: 25f9aa18dc272ef1befb71692e0807e0f81f8f95b9a9265308dc058b6a7f473f93c159e99eb55f40f722e1d43c28de26640b9c6dc8a7737c3870671545bd5da2
6
+ metadata.gz: aaed9878f89831c78e13521d7388e1adebfe6d562169cf7499a3856596154aaf3fc1c46e52c525b67981c6c0157994aca8cc4a9685fbc0287543bc0c489c88ae
7
+ data.tar.gz: e759c21d690ccdc0d449d81d61427adbb599913e8ada19ef94cc105ca85abb9f32dd3b523c53d9237bc1b3785fbba9a7b5cd300a79ac5e5f0da7a35bbd6d443c
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.4.0'
15
+ gem 'recurly', '~> 2.4.1'
16
16
  ```
17
17
 
18
18
  Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
@@ -38,6 +38,7 @@ module Recurly
38
38
  tax_exempt
39
39
  entity_use_code
40
40
  created_at
41
+ vat_location_valid
41
42
  )
42
43
  alias to_param account_code
43
44
 
@@ -23,10 +23,15 @@ module Recurly
23
23
  # @return [Redemption]
24
24
  has_one :redemption
25
25
 
26
+ def invoice_number_with_prefix
27
+ "#{invoice_number_prefix}#{invoice_number}"
28
+ end
29
+
26
30
  define_attribute_methods %w(
27
31
  uuid
28
32
  state
29
33
  invoice_number
34
+ invoice_number_prefix
30
35
  po_number
31
36
  vat_number
32
37
  subtotal_in_cents
@@ -45,7 +50,7 @@ module Recurly
45
50
  customer_notes
46
51
  address
47
52
  )
48
- alias to_param invoice_number
53
+ alias to_param invoice_number_with_prefix
49
54
 
50
55
  def self.to_xml(attrs)
51
56
  invoice = new attrs
@@ -734,7 +734,7 @@ module Recurly
734
734
  # account.read_link :billing_info # => <Recurly::BillingInfo>
735
735
  def follow_link key, options = {}
736
736
  if link = links[key = key.to_s]
737
- response = API.send link[:method], link[:href], nil, options
737
+ response = API.send link[:method], link[:href], options[:body], options
738
738
  if resource_class = link[:resource_class]
739
739
  response = resource_class.from_response response
740
740
  response.attributes[self.class.member_name] = self
@@ -114,6 +114,11 @@ module Recurly
114
114
  end
115
115
  alias add_ons= subscription_add_ons=
116
116
 
117
+ def pending_subscription
118
+ sub = self[:pending_subscription]
119
+ sub.tap {|e| e.currency = currency} if sub.is_a? Subscription
120
+ end
121
+
117
122
  # Cancel a subscription so that it will not renew.
118
123
  #
119
124
  # @return [true, false] +true+ when successful, +false+ when unable to
@@ -184,11 +189,10 @@ module Recurly
184
189
  # @return [true, false] +true+ when successful, +false+ when unable to
185
190
  # @params notes [Hash] should be the notes parameters you wish to update
186
191
  def update_notes(notes)
192
+ return false unless link? :notes
187
193
  self.attributes = notes
188
- @response = API.send(:put, "#{path}/notes", to_xml)
189
- reload response
190
- rescue API::UnprocessableEntity => e
191
- apply_errors e
194
+ reload follow_link(:notes, body: to_xml)
195
+ true
192
196
  end
193
197
 
194
198
  def signable_attributes
@@ -2,7 +2,7 @@ module Recurly
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 4
5
- PATCH = 0
5
+ PATCH = 1
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.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-07 00:00:00.000000000 Z
11
+ date: 2015-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake