recurly 2.18.0 → 2.18.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa3a6583aae99844185b0c2a98740596b4d5cf12
4
- data.tar.gz: 3af828ab17994fa0ed0376c460bffa470b1eb2e0
3
+ metadata.gz: 54d02262c0576c5815a42475a47f3c5fc538604d
4
+ data.tar.gz: a329e6dab7f4fc71e6a2a987f111b4c704fc65ac
5
5
  SHA512:
6
- metadata.gz: 11bf511f85233e0d498dc1debae2c3611fab6260c83b5e8d12d84053acaaecaea1a2eb7172dcafaf20d7ebfd353c07418a214ec635add505214e59b69e16ae78
7
- data.tar.gz: 92da77b27aaccf4e5b942e6b457ddeb4ee5e71c1b98b0eb8240892e888fbbe5453c570c953f6ff4a72ce00f4fa4650524e439b3b34dc4c639d2192ebe4ca0d6b
6
+ metadata.gz: 23a3975f33addab379a20893a61fb5c66ce1768b75e1fda8e23b93a681c651dfbd0ba4f514b0d120ce6fd548c79d7ec05db0fa2f3a4fac5a2ae47f0d5f1f84fc
7
+ data.tar.gz: a3d7dc1eb216a1a2319cc953189069d52da6118f851300a3e43c09d67688e549c1aff3f91e0d2db8c009c2845aa727bbc2e361b58c2d284ee8923f7ddd0773d5
@@ -18,6 +18,9 @@ module Recurly
18
18
  # @return [Invoice, nil] The charge invoice for the gift card redemption.
19
19
  has_one :purchase_invoice, class_name: :Invoice, readonly: true
20
20
 
21
+ # @return [BillingInfo, nil]
22
+ has_one :billing_info, class_name: :BillingInfo, readonly: false
23
+
21
24
  define_attribute_methods %w(
22
25
  balance_in_cents
23
26
  currency
@@ -153,8 +153,8 @@ module Recurly
153
153
  def force_collect(options = {})
154
154
  return false unless link? :force_collect
155
155
  http_opts = {}
156
- if options[:transaction_type]
157
- http_opts[:body] = transaction_type_xml(options[:transaction_type])
156
+ if body = force_collect_xml(options)
157
+ http_opts[:body] = body
158
158
  end
159
159
  reload follow_link(:force_collect, http_opts)
160
160
  true
@@ -276,14 +276,21 @@ module Recurly
276
276
  builder.to_s
277
277
  end
278
278
 
279
- def transaction_type_xml(transaction_type)
280
- builder = XML.new("<invoice/>")
281
- builder.add_element 'transaction_type', transaction_type.to_s
282
- builder.to_s
279
+ # Returns an xml body or nil given some options
280
+ def force_collect_xml(options = {})
281
+ if options[:transaction_type] || options[:billing_info]
282
+ ForceCollect.new(options).to_xml
283
+ end
283
284
  end
284
285
 
285
286
  # Invoices are only writeable through {Account} instances.
286
287
  embedded! true
287
288
  undef destroy
289
+
290
+ # Represents a body for the force collect endpoint
291
+ class ForceCollect < Resource
292
+ has_one :billing_info, class_name: :BillingInfo, readonly: false
293
+ define_attribute_methods %w[transaction_type]
294
+ end
288
295
  end
289
296
  end
@@ -41,6 +41,9 @@ module Recurly
41
41
  # @return [InvoiceCollection, nil]
42
42
  has_one :invoice_collection, class_name: :InvoiceCollection, readonly: true
43
43
 
44
+ # @return [BillingInfo, nil]
45
+ has_one :billing_info, class_name: :BillingInfo, readonly: false
46
+
44
47
  define_attribute_methods %w(
45
48
  uuid
46
49
  state
@@ -2,7 +2,7 @@ module Recurly
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 18
5
- PATCH = 0
5
+ PATCH = 1
6
6
  PRE = nil
7
7
 
8
8
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join('.').freeze
@@ -70,6 +70,7 @@ module Recurly
70
70
  autoload :LowBalanceGiftCardNotification, 'recurly/webhook/low_balance_gift_card_notification'
71
71
  autoload :TransactionStatusUpdatedNotification, 'recurly/webhook/transaction_status_updated_notification'
72
72
  autoload :UpdatedInvoiceNotification, 'recurly/webhook/updated_invoice_notification'
73
+ autoload :NewShippingAddressNotification, 'recurly/webhook/new_shipping_address_notification'
73
74
  # This exception is raised if the Webhook Notification initialization fails
74
75
  class NotificationError < Error
75
76
  end
@@ -5,6 +5,9 @@ module Recurly
5
5
  class AccountNotification < Notification
6
6
  # @return [Account]
7
7
  has_one :account
8
+
9
+ # @return [ShippingAddress]
10
+ has_one :shipping_address
8
11
  end
9
12
  end
10
13
  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.18.0
4
+ version: 2.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-21 00:00:00.000000000 Z
11
+ date: 2019-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri