recurly 2.10.0 → 2.10.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: 2b2f5ee6a8f39d65f8f8b7bf0e7e28dc8fbfe5f7
4
- data.tar.gz: 87bb6b057dd79daa33251094d2be8b4cf9030c80
3
+ metadata.gz: fe4613ae5c45634fb98b0006c9900be7cdb62eb4
4
+ data.tar.gz: 28e4c99d3263a3f78442deccd876a32d72f67444
5
5
  SHA512:
6
- metadata.gz: 44074d5b0f6e35dadb1a0d442be7f071b1f5a8466e838163afcb73cb9901f0b5ba5821916e2e1cd26c806f618940bbd1f2a32ced62610016cb86ba50dd76e875
7
- data.tar.gz: '049c7dd6465aba53105a3d5d279d8a5cb9298dabb52be3c682020c0db665fce2e964b37a8fd21036d98226a9bd3b642b2902a294f29914b29a82ecf316dff170'
6
+ metadata.gz: a709d5d28c3f17a7815132a835d364810dfbce9ebd07972839bb0f473d473a44d2dea84e645b0cd17658b247183a8c63cea1b9bbec601279e7aaaf24f6eef4ad
7
+ data.tar.gz: 7442860e57b511ffd702cfbda16755f3660395851070c700a62bc51307047d9445cf75f24133ad25e804e42b92137017c43a1f5d1333c249cddcbfb450f9cf04
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.10.0'
17
+ gem 'recurly', '~> 2.10.1'
18
18
  ```
19
19
 
20
20
  Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
@@ -54,7 +54,7 @@ module Recurly
54
54
  # @example
55
55
  # account.adjustments.new attributes
56
56
  # @see Resource#initialize
57
- def initialize attributes = {}
57
+ def initialize(attributes = {})
58
58
  super({ :currency => Recurly.default_currency }.merge attributes)
59
59
  end
60
60
 
data/lib/recurly/api.rb CHANGED
@@ -16,7 +16,7 @@ module Recurly
16
16
 
17
17
  @@base_uri = "https://api.recurly.com/v2/"
18
18
 
19
- RECURLY_API_VERSION = '2.6'
19
+ RECURLY_API_VERSION = '2.7'
20
20
 
21
21
  FORMATS = Helper.hash_with_indifferent_read_access(
22
22
  'pdf' => 'application/pdf',
@@ -3,7 +3,8 @@ module Recurly
3
3
  belongs_to :invoice
4
4
  belongs_to :gifter_account, class_name: :Account, readonly: false
5
5
  belongs_to :recipient_account, class_name: :Account, readonly: false
6
- has_one :delivery, readonly: false
6
+ has_one :delivery, readonly: false, class_name: :Delivery
7
+ has_one :address, readonly: false, class_name: :Address
7
8
 
8
9
  define_attribute_methods %w(
9
10
  balance_in_cents
@@ -18,7 +18,7 @@ module Recurly
18
18
 
19
19
  def singularize word
20
20
  word = word.to_s
21
- return "shipping_address" if word == "shipping_address"
21
+ return word if word.end_with?('address')
22
22
  return "shipping_address" if word == "shipping_addresses"
23
23
  word.sub(/s$/, '').sub(/ie$/, 'y')
24
24
  end
@@ -151,7 +151,7 @@ module Recurly
151
151
 
152
152
  private
153
153
 
154
- def initialize attributes = {}
154
+ def initialize(attributes = {})
155
155
  super({ :currency => Recurly.default_currency }.merge attributes)
156
156
  end
157
157
 
data/lib/recurly/plan.rb CHANGED
@@ -34,16 +34,5 @@ module Recurly
34
34
  updated_at
35
35
  )
36
36
  alias to_param plan_code
37
-
38
- #TODO this can be removed after the server update
39
- def trial_requires_billing_info
40
- val = read_attribute(:trial_requires_billing_info)
41
- case val
42
- when String
43
- val == 'true'
44
- else
45
- val
46
- end
47
- end
48
37
  end
49
38
  end
@@ -57,7 +57,7 @@ module Recurly
57
57
  # })
58
58
  #
59
59
  # begin
60
- # preview_invoice = Recurly::Purchase.invoice!(purchase)
60
+ # preview_invoice = Recurly::Purchase.preview!(purchase)
61
61
  # puts preview_invoice.inspect
62
62
  # rescue Recurly::Resource::Invalid => e
63
63
  # # Invalid data
@@ -82,13 +82,20 @@ module Recurly
82
82
  has_many :adjustments, class_name: :Adjustment, readonly: false
83
83
 
84
84
  # @return [Account, nil]
85
- has_one :account, readonly: false
85
+ has_one :account, class_name: :Account, readonly: false
86
+
87
+ # @return [GiftCard, nil]
88
+ has_one :gift_card, class_name: :GiftCard, readonly: false
89
+
90
+ # @return [[Subscription], nil]
91
+ has_many :subscriptions, class_name: :Subscription, readonly: false
86
92
 
87
93
  define_attribute_methods %w(
88
94
  currency
89
95
  collection_method
90
96
  po_number
91
97
  net_terms
98
+ coupon_codes
92
99
  )
93
100
 
94
101
  class << self
@@ -90,8 +90,8 @@ module Recurly
90
90
  end
91
91
 
92
92
  # @return [Subscription] A new subscription.
93
- def initialize attributes = {}
94
- super({ :currency => Recurly.default_currency }.merge attributes)
93
+ def initialize(attributes = {})
94
+ super(attributes)
95
95
  end
96
96
 
97
97
  # Assign a Plan resource (rather than a plan code).
@@ -70,7 +70,7 @@ module Recurly
70
70
  attr_reader :type
71
71
 
72
72
  # @see Resource#initialize
73
- def initialize attributes = {}
73
+ def initialize(attributes = {})
74
74
  super({ :currency => Recurly.default_currency }.merge attributes)
75
75
  end
76
76
 
@@ -2,7 +2,7 @@ module Recurly
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 10
5
- PATCH = 0
5
+ PATCH = 1
6
6
  PRE = nil
7
7
 
8
8
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join('.').freeze
@@ -0,0 +1,6 @@
1
+ module Recurly
2
+ module Webhook
3
+ class UpdatedAccountNotification < AccountNotification
4
+ end
5
+ end
6
+ end
@@ -33,6 +33,7 @@ module Recurly
33
33
  autoload :ExpiredSubscriptionNotification, 'recurly/webhook/expired_subscription_notification'
34
34
  autoload :FailedPaymentNotification, 'recurly/webhook/failed_payment_notification'
35
35
  autoload :NewAccountNotification, 'recurly/webhook/new_account_notification'
36
+ autoload :UpdatedAccountNotification, 'recurly/webhook/updated_account_notification'
36
37
  autoload :NewInvoiceNotification, 'recurly/webhook/new_invoice_notification'
37
38
  autoload :NewSubscriptionNotification, 'recurly/webhook/new_subscription_notification'
38
39
  autoload :PastDueInvoiceNotification, 'recurly/webhook/past_due_invoice_notification'
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.10.0
4
+ version: 2.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-19 00:00:00.000000000 Z
11
+ date: 2017-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -212,6 +212,7 @@ files:
212
212
  - lib/recurly/webhook/successful_payment_notification.rb
213
213
  - lib/recurly/webhook/successful_refund_notification.rb
214
214
  - lib/recurly/webhook/transaction_notification.rb
215
+ - lib/recurly/webhook/updated_account_notification.rb
215
216
  - lib/recurly/webhook/updated_subscription_notification.rb
216
217
  - lib/recurly/webhook/void_payment_notification.rb
217
218
  - lib/recurly/xml.rb