recurly 2.18.21 → 2.18.22

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
  SHA256:
3
- metadata.gz: 90911f96367a97bcc65fb3227083ab224b662639c9a233d3f085f66e79197592
4
- data.tar.gz: 61d45e9d4d4249b1061af262a4b9569c4368dd20b987521fbf809bf8061d7ac4
3
+ metadata.gz: 89370fbc69e2a1dc5dc317f45c0b3be37fad9b22d7fd0186416312f6cdfbe68c
4
+ data.tar.gz: 34a070a7121166d2e810bbf27313d792e657f681c74ce9139938e52cc4924f85
5
5
  SHA512:
6
- metadata.gz: 4bd74ae8c57c57660dc12c11cf644c1441c2f28f42954344412f80745b6f1d8211783cb8b1917f8de557cfadb147e36c36ae56ce502c096db51db7366a1e61f4
7
- data.tar.gz: 805fa6a086423a13b37b640056506b60f099af605af2595ca3de1efa552d7537f0e741520c1d6cbffffa5f8bc05c485634861d4d72ebd2710b8a6b39afc4671c
6
+ metadata.gz: a56882820ac3dd3cc339e5d9e0d23ab3d17c425754199f6ed7e39b8cddb75ab5c4760a5ccc4b948552f85005ce8ea1256b5e4dd29bd57747bc7e5b2476081e71
7
+ data.tar.gz: 89dde5248e08a6f9b2d521df965c5de159fd73d5e96518a8d4e78e878de50b44f464aebbef0aaf3aa493622bb1919de18f7ab48b98bae29615267a0575688152
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.18.21'
17
+ gem 'recurly', '~> 2.18.22'
18
18
  ```
19
19
 
20
20
  Recurly will automatically use [Nokogiri](http://nokogiri.org/) (for a nice
@@ -95,6 +95,7 @@ module Recurly
95
95
  has_paused_subscription
96
96
  preferred_locale
97
97
  transaction_type
98
+ dunning_campaign_id
98
99
  )
99
100
  alias to_param account_code
100
101
 
@@ -13,6 +13,8 @@ module Recurly
13
13
 
14
14
  # @return [Account, nil]
15
15
  belongs_to :account
16
+ # @return [Account, nil]
17
+ belongs_to :bill_for_account, class_name: :Account, readonly: true
16
18
  # @return [Invoice, nil]
17
19
  belongs_to :invoice
18
20
  # @return [Subscription, nil]
@@ -0,0 +1,30 @@
1
+ module Recurly
2
+ # Recurly Documentation: https://developers.recurly.com/api-v2/latest/index.html#tag/dunning-campaigns
3
+ class DunningCampaign < Resource
4
+ # @return [[DunningCycle], []]
5
+ has_many :dunning_cycles
6
+
7
+ define_attribute_methods %w(
8
+ id
9
+ name
10
+ code
11
+ description
12
+ default_campaign
13
+ dunning_cycles
14
+ created_at
15
+ updated_at
16
+ deleted_at
17
+ )
18
+
19
+ def bulk_update(plan_codes)
20
+ return false unless link? :bulk_update
21
+
22
+ builder = XML.new("<dunning_campaign/>")
23
+ node = builder.add_element("plan_codes")
24
+ plan_codes.each { |plan_code| node.add_element "plan_code", plan_code }
25
+
26
+ reload follow_link(:bulk_update, :body => builder.to_s)
27
+ true
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,18 @@
1
+ module Recurly
2
+ class DunningCycle < Resource
3
+ define_attribute_methods %w(
4
+ type
5
+ applies_to_manual_trial
6
+ first_communication_interval
7
+ send_immediately_on_hard_decline
8
+ intervals
9
+ expire_subscription
10
+ fail_invoice
11
+ total_dunning_days
12
+ total_recycling_days
13
+ version
14
+ created_at
15
+ updated_at
16
+ )
17
+ end
18
+ end
@@ -115,6 +115,7 @@ module Recurly
115
115
  surcharge_in_cents
116
116
  tax_details
117
117
  billing_info_uuid
118
+ dunning_campaign_id
118
119
  )
119
120
  alias to_param invoice_number_with_prefix
120
121
 
data/lib/recurly/plan.rb CHANGED
@@ -35,6 +35,7 @@ module Recurly
35
35
  allow_any_item_on_subscriptions
36
36
  avalara_transaction_type
37
37
  avalara_service_type
38
+ dunning_campaign_id
38
39
  created_at
39
40
  updated_at
40
41
  )
@@ -608,7 +608,7 @@ module Recurly
608
608
 
609
609
  def find_resource_class(name)
610
610
  resource_name = Helper.classify(name)
611
- if Recurly.const_defined?(resource_name, false)
611
+ if Recurly.const_defined?(resource_name, false) && Recurly.const_get(resource_name, false).instance_of?(Class)
612
612
  Recurly.const_get(resource_name, false)
613
613
  end
614
614
  end
@@ -1,6 +1,6 @@
1
1
  module Recurly
2
2
  module Version
3
- VERSION = "2.18.21"
3
+ VERSION = "2.18.22"
4
4
 
5
5
  class << self
6
6
  def inspect
data/lib/recurly.rb CHANGED
@@ -42,6 +42,8 @@ module Recurly
42
42
  require 'recurly/webhook'
43
43
  require 'recurly/verify'
44
44
  require 'recurly/tier'
45
+ require 'recurly/dunning_campaign'
46
+ require 'recurly/dunning_cycle'
45
47
 
46
48
  @subdomain = nil
47
49
 
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.21
4
+ version: 2.18.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recurly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-25 00:00:00.000000000 Z
11
+ date: 2021-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -141,6 +141,8 @@ files:
141
141
  - lib/recurly/credit_payment.rb
142
142
  - lib/recurly/custom_field.rb
143
143
  - lib/recurly/delivery.rb
144
+ - lib/recurly/dunning_campaign.rb
145
+ - lib/recurly/dunning_cycle.rb
144
146
  - lib/recurly/error.rb
145
147
  - lib/recurly/gift_card.rb
146
148
  - lib/recurly/helper.rb