recurly 2.16.1 → 2.16.2

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
2
  SHA256:
3
- metadata.gz: 81d0bdd694148de478169f53f0002f07cd87cf6c32a99c7ef4aaa30796068a47
4
- data.tar.gz: e4272fa08247d00936c8413c7df6a32e02d571ceda3ca01d1e2332ce5114315c
3
+ metadata.gz: c88aeded1f841b46fca644e8b89977c68111e609a13ed580bde4a692acf0fd25
4
+ data.tar.gz: cffcae2d4baa388b880206f705a81cb2a62dfc83948dc1b2bdecf1aea0e2fbe4
5
5
  SHA512:
6
- metadata.gz: 510f1deb2f6003b0103e3804140976b868b2bbc467133e6efb08a0ad68f0db35351e775266f968788d3eceeda3703a51e133f3b7caf2532382d939a38a527e8f
7
- data.tar.gz: cc165ad1315afa96d9bcdef5a7957fa8739630ae29eca942aa5adfdc4a448fb53d9ea32fc026fa70a2cf3775eecbcf15d153f9e1be7bb6302768e9ae9bdbcbb5
6
+ metadata.gz: 676ce8e9f2a8e731931ed89dd4a1b293a10a19b5419e18ba60388b2548a6b1c2425faa2081e5ca91c1aa1e6f61b43ccc6d13167841c9ba1f6f6ae402678ea06d
7
+ data.tar.gz: c0104c602b86fbbb68efda6e9b35271a051d9c3a6bdff25b01d367b065d3a4df6562bd96c3275421b5e2ff20f1a722b4ad18752f95577ec3c61e03ad98fdd3aa
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.16.1'
17
+ gem 'recurly', '~> 2.16.2'
18
18
  ```
19
19
 
20
20
  Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
@@ -1,6 +1,10 @@
1
1
  module Recurly
2
2
  class Address < Resource
3
3
  define_attribute_methods %w(
4
+ first_name
5
+ last_name
6
+ name_on_account
7
+ company
4
8
  address1
5
9
  address2
6
10
  city
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.13'
20
+ RECURLY_API_VERSION = '2.14'
21
21
 
22
22
  FORMATS = Helper.hash_with_indifferent_read_access(
23
23
  'pdf' => 'application/pdf',
@@ -86,6 +86,7 @@ module Recurly
86
86
  line_items
87
87
  transactions
88
88
  terms_and_conditions
89
+ vat_reverse_charge_notes # Only shows if reverse charge invoice
89
90
  customer_notes
90
91
  address
91
92
  net_terms
@@ -201,6 +202,22 @@ module Recurly
201
202
  super - ['currency']
202
203
  end
203
204
 
205
+ # Attempts to update the invoice, returning the success of the request.
206
+ # Raises an error if attempting to create an invoice using this method.
207
+ #
208
+ # @return [true, false]
209
+ # @raise [RuntimeError] Raises error if you attempt to create an invoice.
210
+ # @example
211
+ # invoice = Recurly::Invoice.find('1000')
212
+ # invoice.po_number = '1234'
213
+ # invoice.save # => true
214
+ def save
215
+ unless persisted?
216
+ raise "Invoices can only be updated with Invoice#save. New invoices cannot be created using this method."
217
+ end
218
+ super
219
+ end
220
+
204
221
  private
205
222
 
206
223
  def initialize(attributes = {})
@@ -230,7 +247,6 @@ module Recurly
230
247
 
231
248
  # Invoices are only writeable through {Account} instances.
232
249
  embedded! true
233
- undef save
234
250
  undef destroy
235
251
  end
236
252
  end
@@ -230,7 +230,19 @@ module Recurly
230
230
  true
231
231
  end
232
232
 
233
- # Update the notes sections of the subscription
233
+ # Update the notes sections of the subscription. This endpoint also allows you to
234
+ # update the custom fields.
235
+ #
236
+ # @example
237
+ # subscription.custom_fields.first.value = nil
238
+ # subscription.update_notes(terms_and_conditions: 'New T&C')
239
+ # #=>
240
+ # # <subscription>
241
+ # # <custom_fields><custom_field><name>food</name><value nil="nil"/><custom_field></custom_fields>
242
+ # # <terms_and_conditions>New T&C</terms_and_conditions>
243
+ # # </subscription>
244
+ # # it's also okay to call without notes
245
+ # subscription.update_notes({})
234
246
  #
235
247
  # @param notes [Hash] should be the notes parameters you wish to update
236
248
  # @return [true, false] +true+ when successful, +false+ when unable to
@@ -2,7 +2,7 @@ module Recurly
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 16
5
- PATCH = 1
5
+ PATCH = 2
6
6
  PRE = nil
7
7
 
8
8
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join('.').freeze
@@ -66,6 +66,7 @@ module Recurly
66
66
  autoload :RedeemedGiftCardNotification, 'recurly/webhook/redeemed_gift_card_notification'
67
67
  autoload :UpdatedBalanceGiftCardNotification, 'recurly/webhook/updated_balance_gift_card_notification'
68
68
  autoload :NewUsageNotification, 'recurly/webhook/new_usage_notification'
69
+ autoload :TransactionAuthorizedNotification, 'recurly/webhook/transaction_authorized_notification'
69
70
  # This exception is raised if the Webhook Notification initialization fails
70
71
  class NotificationError < Error
71
72
  end
@@ -0,0 +1,6 @@
1
+ module Recurly
2
+ module Webhook
3
+ class TransactionAuthorizedNotification < TransactionNotification
4
+ end
5
+ end
6
+ end
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.16.1
4
+ version: 2.16.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-06 00:00:00.000000000 Z
11
+ date: 2018-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -238,6 +238,7 @@ files:
238
238
  - lib/recurly/webhook/subscription_notification.rb
239
239
  - lib/recurly/webhook/successful_payment_notification.rb
240
240
  - lib/recurly/webhook/successful_refund_notification.rb
241
+ - lib/recurly/webhook/transaction_authorized_notification.rb
241
242
  - lib/recurly/webhook/transaction_notification.rb
242
243
  - lib/recurly/webhook/updated_account_notification.rb
243
244
  - lib/recurly/webhook/updated_balance_gift_card_notification.rb
@@ -270,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
270
271
  version: '0'
271
272
  requirements: []
272
273
  rubyforge_project:
273
- rubygems_version: 2.7.6
274
+ rubygems_version: 2.7.7
274
275
  signing_key:
275
276
  specification_version: 4
276
277
  summary: Recurly API Client