recurly 2.4.1 → 2.4.2

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: d567b8311cdce239cb392169321fc856f1878249
4
- data.tar.gz: 028a4010498bf77cf85c2436a91146589143cd41
3
+ metadata.gz: ddb625be4f19f5431404479e8c3ecc69da68ab6d
4
+ data.tar.gz: 86bca1d301ff339f047bc3c5a5c10e2e54a927b4
5
5
  SHA512:
6
- metadata.gz: aaed9878f89831c78e13521d7388e1adebfe6d562169cf7499a3856596154aaf3fc1c46e52c525b67981c6c0157994aca8cc4a9685fbc0287543bc0c489c88ae
7
- data.tar.gz: e759c21d690ccdc0d449d81d61427adbb599913e8ada19ef94cc105ca85abb9f32dd3b523c53d9237bc1b3785fbba9a7b5cd300a79ac5e5f0da7a35bbd6d443c
6
+ metadata.gz: dd1378cd47e9b78eaf65fd400a07d609aa55046646436b61735e00253c7d7e311cae33989e80bc5c29f8c458135c41b2277108caa9e857af38a95f2af7cd343f
7
+ data.tar.gz: cbc13c1937aa071e89ab3e821ed9908cc1920da15694f798f26bdaeb7f785e4458f2ffed497114c9465006b9dd1ab5dc0b89a2f880028fdbbccebfb78e8f0fd1
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.1'
15
+ gem 'recurly', '~> 2.4.2'
16
16
  ```
17
17
 
18
18
  Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
@@ -130,7 +130,7 @@ your changes.
130
130
 
131
131
  (The MIT License.)
132
132
 
133
- © 2009–2014 Recurly Inc.
133
+ © 2009–2015 Recurly Inc.
134
134
 
135
135
  Permission is hereby granted, free of charge, to any person obtaining a copy
136
136
  of this software and associated documentation files (the "Software"), to deal
@@ -25,17 +25,21 @@ module Recurly
25
25
  unit_amount_in_cents
26
26
  quantity
27
27
  discount_in_cents
28
- tax_in_cents
29
28
  total_in_cents
30
29
  currency
31
- tax_exempt
32
- tax_code
33
- tax_details
34
30
  product_code
35
31
  start_date
36
32
  end_date
37
33
  created_at
38
34
  quantity_remaining
35
+
36
+ tax_in_cents
37
+ tax_type
38
+ tax_region
39
+ tax_rate
40
+ tax_exempt
41
+ tax_code
42
+ tax_details
39
43
  )
40
44
  alias to_param uuid
41
45
 
@@ -1,5 +1,10 @@
1
1
  module Recurly
2
2
  class BillingInfo < Resource
3
+ BANK_ACCOUNT_ATTRIBUTES = %w(name_on_account account_type last_four routing_number).freeze
4
+ CREDIT_CARD_ATTRIBUTES = %w(number verification_value card_type year month first_six last_four).freeze
5
+ AMAZON_ATTRIBUTES = %w(amazon_billing_agreement_id).freeze
6
+ PAYPAL_ATTRIBUTES = %w(paypal_billing_agreement_id).freeze
7
+
3
8
  # @return [Account]
4
9
  belongs_to :account
5
10
 
@@ -17,22 +22,10 @@ module Recurly
17
22
  vat_number
18
23
  ip_address
19
24
  ip_address_country
20
- card_type
21
- year
22
- month
23
- start_year
24
- start_month
25
- issue_number
26
- first_six
27
- last_four
28
- paypal_billing_agreement_id
29
- amazon_billing_agreement_id
30
- number
31
- verification_value
32
25
  token_id
33
- )
26
+ ) | CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES | AMAZON_ATTRIBUTES | PAYPAL_ATTRIBUTES
34
27
 
35
- # @return ["credit_card", "paypal", "amazon", nil] The type of billing info.
28
+ # @return ["credit_card", "paypal", "amazon", "bank_account", nil] The type of billing info.
36
29
  attr_reader :type
37
30
 
38
31
  # @return [String]
@@ -40,12 +33,15 @@ module Recurly
40
33
  attributes = self.class.attribute_names
41
34
  case type
42
35
  when 'credit_card'
43
- attributes -= %w(paypal_billing_agreement_id amazon_billing_agreement_id)
36
+ attributes -= (AMAZON_ATTRIBUTES + PAYPAL_ATTRIBUTES + BANK_ACCOUNT_ATTRIBUTES)
37
+ attributes |= CREDIT_CARD_ATTRIBUTES
44
38
  when 'paypal'
45
- attributes -= %w(
46
- card_type year month start_year start_month issue_number
47
- first_six last_four
48
- )
39
+ attributes -= (CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES + AMAZON_ATTRIBUTES)
40
+ when 'amazon'
41
+ attributes -= (CREDIT_CARD_ATTRIBUTES | BANK_ACCOUNT_ATTRIBUTES + PAYPAL_ATTRIBUTES)
42
+ when 'bank_account'
43
+ attributes -= (CREDIT_CARD_ATTRIBUTES + PAYPAL_ATTRIBUTES + AMAZON_ATTRIBUTES)
44
+ attributes |= BANK_ACCOUNT_ATTRIBUTES
49
45
  end
50
46
  super attributes
51
47
  end
@@ -49,6 +49,8 @@ module Recurly
49
49
  terms_and_conditions
50
50
  customer_notes
51
51
  address
52
+ net_terms
53
+ collection_method
52
54
  )
53
55
  alias to_param invoice_number_with_prefix
54
56
 
@@ -1,6 +1,5 @@
1
1
  require 'date'
2
2
  require 'erb'
3
- require 'recurly/resource/association'
4
3
 
5
4
  module Recurly
6
5
  # The base class for all Recurly resources (e.g. {Account}, {Subscription},
@@ -117,6 +116,7 @@ module Recurly
117
116
  class Resource
118
117
  autoload :Errors, 'recurly/resource/errors'
119
118
  autoload :Pager, 'recurly/resource/pager'
119
+ autoload :Association, 'recurly/resource/association'
120
120
 
121
121
  # Raised when a record cannot be found.
122
122
  #
@@ -388,7 +388,6 @@ module Recurly
388
388
  record = {}
389
389
  end
390
390
  klass ||= self
391
- associations = klass.associations
392
391
 
393
392
  xml.root.attributes.each do |name, value|
394
393
  record.instance_variable_set "@#{name}", value.to_s
@@ -1,3 +1,5 @@
1
+ require 'erb'
2
+
1
3
  module Recurly
2
4
  class Resource
3
5
  # Pages through an index resource, yielding records as it goes. It's rare
@@ -169,11 +171,10 @@ module Recurly
169
171
 
170
172
  def find uuid
171
173
  if resource_class.respond_to? :find
172
- raise NoMethodError,
173
- "#find must be called on #{resource_class} directly"
174
+ raise NoMethodError, "#find must be called on #{resource_class} directly"
174
175
  end
175
176
 
176
- resource_class.from_response API.get("#{uri}/#{uuid}")
177
+ resource_class.from_response API.get("#{uri}/#{ERB::Util.url_encode(uuid)}")
177
178
  end
178
179
 
179
180
  # @return [true, false]
@@ -2,7 +2,7 @@ module Recurly
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 4
5
- PATCH = 1
5
+ PATCH = 2
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.1
4
+ version: 2.4.2
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-24 00:00:00.000000000 Z
11
+ date: 2015-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  version: '0'
119
119
  requirements: []
120
120
  rubyforge_project:
121
- rubygems_version: 2.2.2
121
+ rubygems_version: 2.4.3
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: Recurly API Client