recurly 4.6.0 → 4.10.0

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: 4b355c5446a85f7911c3f383a4c4a5f54ab5153fc2764680c4bd739aba9b3bc9
4
- data.tar.gz: 1fa2e60c2bf6970b0d6187ae18130c0813551ccec839b9ee4e80e6e4a5e1a77c
3
+ metadata.gz: d58a4d771c61445679b271441c64f1341a58f0c39d768b5abebe635be7fc1b7f
4
+ data.tar.gz: 238128901760f8f548091ee71778a17d8599db24f746a88deb8d55eb8d224de7
5
5
  SHA512:
6
- metadata.gz: 3a71c147eb618bd49ef0350bf6492f1c8d0d0cafedfd6aebaf6a3ac35b9e13f11fa3ad7133baae2ec11b8e5ac7994e77ea768eceeaf90d2681e6c189e3723ced
7
- data.tar.gz: 7dba56f22aacea3aad801bd5a5fd3d7f26a72b2d0a5aab7f1418865cbaf8d56da51d6682514a2752989b49b7e3bf04cb06d75aecd00f13fc3880317aee2f1915
6
+ metadata.gz: 699d6dadd3afa732926744cd611e11deb5e0d592edf497a31249e5af4d012f5c02adbe1cc3aed8f1066b9254098ae74e92b8910c977aa5dd41c223b7a8adfb98
7
+ data.tar.gz: 120cda82a9e8993f3f4325ac50a3204f6d211b664f7fac160794e92eec51ccef15ec433412d286cd91d6a79f253eff83eb701ae82702144e8facdf02e4338a59
data/.bumpversion.cfg CHANGED
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 4.6.0
2
+ current_version = 4.10.0
3
3
  parse = (?P<major>\d+)
4
4
  \.(?P<minor>\d+)
5
5
  \.(?P<patch>\d+)
data/.travis.yml CHANGED
@@ -8,7 +8,9 @@ rvm:
8
8
  - 3.0
9
9
  bundler_args: --binstubs
10
10
  before_install:
11
+ - sudo apt-get update && sudo apt-get install apt-transport-https ca-certificates -y && sudo update-ca-certificates
11
12
  - gem update --system
12
13
  - gem install bundler
14
+ dist: focal
13
15
  script:
14
- - ./scripts/test
16
+ - ./scripts/test
data/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.10.0](https://github.com/recurly/recurly-client-ruby/tree/4.10.0) (2021-11-22)
4
+
5
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.9.0...4.10.0)
6
+
7
+
8
+ **Merged Pull Requests**
9
+
10
+ - Generated Latest Changes for v2021-02-25 [#739](https://github.com/recurly/recurly-client-ruby/pull/739) ([recurly-integrations](https://github.com/recurly-integrations))
11
+ - Generated Latest Changes for v2021-02-25 [#736](https://github.com/recurly/recurly-client-ruby/pull/736) ([recurly-integrations](https://github.com/recurly-integrations))
12
+ - Allow API base url configuration [#735](https://github.com/recurly/recurly-client-ruby/pull/735) ([cbarton](https://github.com/cbarton))
13
+ - Generated Latest Changes for v2021-02-25 [#734](https://github.com/recurly/recurly-client-ruby/pull/734) ([recurly-integrations](https://github.com/recurly-integrations))
14
+ - Generated Latest Changes for v2021-02-25 [#728](https://github.com/recurly/recurly-client-ruby/pull/728) ([recurly-integrations](https://github.com/recurly-integrations))
15
+
16
+
17
+
18
+ ## [4.9.0](https://github.com/recurly/recurly-client-ruby/tree/4.9.0) (2021-09-16)
19
+
20
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.8.0...4.9.0)
21
+
22
+
23
+ **Merged Pull Requests**
24
+
25
+ - Generated Latest Changes for v2021-02-25 (Support to new subscription fields and response) [#725](https://github.com/recurly/recurly-client-ruby/pull/725) ([recurly-integrations](https://github.com/recurly-integrations))
26
+
27
+
28
+
29
+ ## [4.8.0](https://github.com/recurly/recurly-client-ruby/tree/4.8.0) (2021-09-01)
30
+
31
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.7.0...4.8.0)
32
+
33
+
34
+ **Merged Pull Requests**
35
+
36
+ - Generated Latest Changes for v2021-02-25 (Dunning Campaigns feature) [#724](https://github.com/recurly/recurly-client-ruby/pull/724) ([recurly-integrations](https://github.com/recurly-integrations))
37
+
38
+
39
+
40
+ ## [4.7.0](https://github.com/recurly/recurly-client-ruby/tree/4.7.0) (2021-08-19)
41
+
42
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.6.0...4.7.0)
43
+
44
+
45
+ **Merged Pull Requests**
46
+
47
+ - Generated Latest Changes for v2021-02-25 (get_preview_renewal) [#722](https://github.com/recurly/recurly-client-ruby/pull/722) ([recurly-integrations](https://github.com/recurly-integrations))
48
+
49
+
50
+
3
51
  ## [4.6.0](https://github.com/recurly/recurly-client-ruby/tree/4.6.0) (2021-08-11)
4
52
 
5
53
  [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.5.0...4.6.0)
data/GETTING_STARTED.md CHANGED
@@ -5,7 +5,7 @@ This repository houses the official ruby client for Recurly's V3 API.
5
5
  In your Gemfile, add `recurly` as a dependency.
6
6
 
7
7
  ```ruby
8
- gem 'recurly', '~> 4.6'
8
+ gem 'recurly', '~> 4.10'
9
9
  ```
10
10
 
11
11
  > *Note*: We try to follow [semantic versioning](https://semver.org/) and will only apply breaking changes to major versions.
@@ -3300,6 +3300,20 @@ module Recurly
3300
3300
  put(path, **options)
3301
3301
  end
3302
3302
 
3303
+ # Fetch a preview of a subscription's renewal invoice(s)
3304
+ #
3305
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_preview_renewal get_preview_renewal api documenation}
3306
+ #
3307
+ # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
3308
+ # @param params [Hash] Optional query string parameters:
3309
+ #
3310
+ # @return [Resources::InvoiceCollection] A preview of the subscription's renewal invoice(s).
3311
+ #
3312
+ def get_preview_renewal(subscription_id:, **options)
3313
+ path = interpolate_path("/subscriptions/{subscription_id}/preview_renewal", subscription_id: subscription_id)
3314
+ get(path, **options)
3315
+ end
3316
+
3303
3317
  # Fetch a subscription's pending change
3304
3318
  #
3305
3319
  # {https://developers.recurly.com/api/v2021-02-25#operation/get_subscription_change get_subscription_change api documenation}
@@ -3889,5 +3903,50 @@ module Recurly
3889
3903
  path = interpolate_path("/export_dates/{export_date}/export_files", export_date: export_date)
3890
3904
  get(path, **options)
3891
3905
  end
3906
+
3907
+ # Show the dunning campaigns for a site
3908
+ #
3909
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_dunning_campaigns list_dunning_campaigns api documenation}
3910
+ #
3911
+ # @param params [Hash] Optional query string parameters:
3912
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
3913
+ # order. In descending order updated records will move behind the cursor and could
3914
+ # prevent some records from being returned.
3915
+ #
3916
+ #
3917
+ # @return [Pager<Resources::DunningCampaign>] A list of the the dunning_campaigns on an account.
3918
+ #
3919
+ def list_dunning_campaigns(**options)
3920
+ path = "/dunning_campaigns"
3921
+ pager(path, **options)
3922
+ end
3923
+
3924
+ # Show the settings for a dunning campaign
3925
+ #
3926
+ # {https://developers.recurly.com/api/v2021-02-25#operation/get_dunning_campaign get_dunning_campaign api documenation}
3927
+ #
3928
+ # @param dunning_campaign_id [String] Dunning Campaign ID, e.g. +e28zov4fw0v2+.
3929
+ # @param params [Hash] Optional query string parameters:
3930
+ #
3931
+ # @return [Resources::DunningCampaign] Settings for a dunning campaign.
3932
+ #
3933
+ def get_dunning_campaign(dunning_campaign_id:, **options)
3934
+ path = interpolate_path("/dunning_campaigns/{dunning_campaign_id}", dunning_campaign_id: dunning_campaign_id)
3935
+ get(path, **options)
3936
+ end
3937
+
3938
+ # Assign a dunning campaign to multiple plans
3939
+ #
3940
+ # {https://developers.recurly.com/api/v2021-02-25#operation/put_dunning_campaign_bulk_update put_dunning_campaign_bulk_update api documenation}
3941
+ #
3942
+ # @param body [Requests::DunningCampaignsBulkUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::DunningCampaignsBulkUpdate}
3943
+ # @param params [Hash] Optional query string parameters:
3944
+ #
3945
+ # @return [Resources::DunningCampaignsBulkUpdateResponse] A list of updated plans.
3946
+ #
3947
+ def put_dunning_campaign_bulk_update(body:, **options)
3948
+ path = "/dunning_campaigns/{dunning_campaign_id}/bulk_update"
3949
+ put(path, body, Requests::DunningCampaignsBulkUpdate, **options)
3950
+ end
3892
3951
  end
3893
3952
  end
@@ -3,6 +3,7 @@ require "erb"
3
3
  require "net/https"
4
4
  require "base64"
5
5
  require "securerandom"
6
+ require "uri"
6
7
  require_relative "./schema/json_parser"
7
8
  require_relative "./schema/file_parser"
8
9
 
@@ -10,8 +11,7 @@ module Recurly
10
11
  class Client
11
12
  require_relative "./client/operations"
12
13
 
13
- BASE_HOST = "v3.recurly.com"
14
- BASE_PORT = 443
14
+ BASE_URL = "https://v3.recurly.com"
15
15
  CA_FILE = File.join(File.dirname(__FILE__), "../data/ca-certificates.crt")
16
16
  BINARY_TYPES = [
17
17
  "application/pdf",
@@ -52,12 +52,15 @@ module Recurly
52
52
  # client = Recurly::Client.new(api_key: API_KEY2)
53
53
  # sub = client.get_subscription(subscription_id: 'uuid-abcd7890')
54
54
  #
55
+ # @param base_url [String] The base URL for the API. Defaults to "https://v3.recurly.com"
56
+ # @param ca_file [String] The CA bundle to use when connecting to the API. Defaults to "data/ca-certificates.crt"
55
57
  # @param api_key [String] The private API key
56
58
  # @param logger [Logger] A logger to use. Defaults to creating a new STDOUT logger with level WARN.
57
- def initialize(api_key:, logger: nil)
59
+ def initialize(base_url: BASE_URL, ca_file: CA_FILE, api_key:, logger: nil)
58
60
  raise ArgumentError, "'api_key' must be set to a non-nil value" if api_key.nil?
59
61
 
60
62
  set_api_key(api_key)
63
+ set_connection_options(base_url, ca_file)
61
64
 
62
65
  if logger.nil?
63
66
  @logger = Logger.new(STDOUT).tap do |l|
@@ -158,7 +161,7 @@ module Recurly
158
161
  end
159
162
 
160
163
  def run_request(request, options = {})
161
- self.class.connection_pool.with_connection do |http|
164
+ self.class.connection_pool.with_connection(uri: @base_uri, ca_file: @ca_file) do |http|
162
165
  set_http_options(http, options)
163
166
 
164
167
  retries = 0
@@ -338,6 +341,11 @@ module Recurly
338
341
  @api_key = api_key.to_s
339
342
  end
340
343
 
344
+ def set_connection_options(base_url, ca_file)
345
+ @base_uri = URI.parse(base_url)
346
+ @ca_file = ca_file
347
+ end
348
+
341
349
  def build_url(path, options)
342
350
  path = scope_by_site(path, options)
343
351
  query_params = map_array_params(options.fetch(:params, {}))
@@ -1,36 +1,38 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "net/https"
2
4
 
3
5
  module Recurly
4
6
  class ConnectionPool
5
7
  def initialize
6
8
  @mutex = Mutex.new
7
- @pool = []
9
+ @pool = Hash.new { |h, k| h[k] = [] }
8
10
  end
9
11
 
10
- def with_connection
12
+ def with_connection(uri:, ca_file: nil)
11
13
  http = nil
12
14
  @mutex.synchronize do
13
- http = @pool.pop
15
+ http = @pool[[uri.host, uri.port]].pop
14
16
  end
15
17
 
16
18
  # create connection if the pool was empty
17
- http ||= init_http_connection
19
+ http ||= init_http_connection(uri, ca_file)
18
20
 
19
21
  response = yield http
20
22
 
21
23
  if http.started?
22
24
  @mutex.synchronize do
23
- @pool.push(http)
25
+ @pool[[uri.host, uri.port]].push(http)
24
26
  end
25
27
  end
26
28
 
27
29
  response
28
30
  end
29
31
 
30
- def init_http_connection
31
- http = Net::HTTP.new(Client::BASE_HOST, Client::BASE_PORT)
32
- http.use_ssl = true
33
- http.ca_file = Client::CA_FILE
32
+ def init_http_connection(uri, ca_file)
33
+ http = Net::HTTP.new(uri.host, uri.port)
34
+ http.use_ssl = uri.scheme == "https"
35
+ http.ca_file = ca_file
34
36
  http.verify_mode = OpenSSL::SSL::VERIFY_PEER
35
37
  http.keep_alive_timeout = 600
36
38
 
@@ -38,6 +38,10 @@ module Recurly
38
38
  # @return [Array[CustomField]] The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
39
39
  define_attribute :custom_fields, Array, { :item_type => :CustomField }
40
40
 
41
+ # @!attribute dunning_campaign_id
42
+ # @return [String] Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is enabled. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
43
+ define_attribute :dunning_campaign_id, String
44
+
41
45
  # @!attribute email
42
46
  # @return [String] The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique.
43
47
  define_attribute :email, String
@@ -38,6 +38,10 @@ module Recurly
38
38
  # @return [Array[CustomField]] The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
39
39
  define_attribute :custom_fields, Array, { :item_type => :CustomField }
40
40
 
41
+ # @!attribute dunning_campaign_id
42
+ # @return [String] Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is enabled. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
43
+ define_attribute :dunning_campaign_id, String
44
+
41
45
  # @!attribute email
42
46
  # @return [String] The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique.
43
47
  define_attribute :email, String
@@ -30,6 +30,10 @@ module Recurly
30
30
  # @return [Array[CustomField]] The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
31
31
  define_attribute :custom_fields, Array, { :item_type => :CustomField }
32
32
 
33
+ # @!attribute dunning_campaign_id
34
+ # @return [String] Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is enabled. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
35
+ define_attribute :dunning_campaign_id, String
36
+
33
37
  # @!attribute email
34
38
  # @return [String] The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique.
35
39
  define_attribute :email, String
@@ -6,6 +6,14 @@ module Recurly
6
6
  module Requests
7
7
  class BillingInfoCreate < Request
8
8
 
9
+ # @!attribute account_number
10
+ # @return [String] The bank account number. (ACH, Bacs only)
11
+ define_attribute :account_number, String
12
+
13
+ # @!attribute account_type
14
+ # @return [String] The bank account type. (ACH only)
15
+ define_attribute :account_type, String
16
+
9
17
  # @!attribute address
10
18
  # @return [Address]
11
19
  define_attribute :address, :Address
@@ -58,6 +66,10 @@ module Recurly
58
66
  # @return [String] Expiration month
59
67
  define_attribute :month, String
60
68
 
69
+ # @!attribute name_on_account
70
+ # @return [String] The name associated with the bank account (ACH, SEPA, Bacs only)
71
+ define_attribute :name_on_account, String
72
+
61
73
  # @!attribute number
62
74
  # @return [String] Credit card number, spaces and dashes are accepted.
63
75
  define_attribute :number, String
@@ -70,6 +82,14 @@ module Recurly
70
82
  # @return [Boolean] The `primary_payment_method` field is used to designate the primary billing info on the account. The first billing info created on an account will always become primary. Adding additional billing infos provides the flexibility to mark another billing info as primary, or adding additional non-primary billing infos. This can be accomplished by passing the `primary_payment_method` with a value of `true`. When adding billing infos via the billing_info and /accounts endpoints, this value is not permitted, and will return an error if provided.
71
83
  define_attribute :primary_payment_method, :Boolean
72
84
 
85
+ # @!attribute routing_number
86
+ # @return [String] The bank's rounting number. (ACH only)
87
+ define_attribute :routing_number, String
88
+
89
+ # @!attribute sort_code
90
+ # @return [String] Bank identifier code for UK based banks. Required for Bacs based billing infos. (Bacs only)
91
+ define_attribute :sort_code, String
92
+
73
93
  # @!attribute tax_identifier
74
94
  # @return [String] Tax identifier is required if adding a billing info that is a consumer card in Brazil or in Argentina. This would be the customer's CPF (Brazil) and CUIT (Argentina). CPF and CUIT are tax identifiers for all residents who pay taxes in Brazil and Argentina respectively.
75
95
  define_attribute :tax_identifier, String
@@ -90,6 +110,10 @@ module Recurly
90
110
  # @return [String] An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.
91
111
  define_attribute :transaction_type, String
92
112
 
113
+ # @!attribute type
114
+ # @return [String] The payment method type for a non-credit card based billing info. The value of `bacs` is the only accepted value (Bacs only)
115
+ define_attribute :type, String
116
+
93
117
  # @!attribute vat_number
94
118
  # @return [String] VAT number
95
119
  define_attribute :vat_number, String
@@ -0,0 +1,18 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
5
+ module Recurly
6
+ module Requests
7
+ class DunningCampaignsBulkUpdate < Request
8
+
9
+ # @!attribute plan_codes
10
+ # @return [Array[String]] List of `plan_codes` associated with the Plans for which the dunning campaign should be updated. Required unless `plan_ids` is present.
11
+ define_attribute :plan_codes, Array, { :item_type => String }
12
+
13
+ # @!attribute plan_ids
14
+ # @return [Array[String]] List of `plan_ids` associated with the Plans for which the dunning campaign should be updated. Required unless `plan_codes` is present.
15
+ define_attribute :plan_ids, Array, { :item_type => String }
16
+ end
17
+ end
18
+ end
@@ -42,6 +42,10 @@ module Recurly
42
42
  # @return [String] Optional description, not displayed.
43
43
  define_attribute :description, String
44
44
 
45
+ # @!attribute dunning_campaign_id
46
+ # @return [String] Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is enabled. Used to specify if a non-default dunning campaign should be assigned to this plan. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
47
+ define_attribute :dunning_campaign_id, String
48
+
45
49
  # @!attribute hosted_pages
46
50
  # @return [PlanHostedPages] Hosted pages settings
47
51
  define_attribute :hosted_pages, :PlanHostedPages
@@ -38,6 +38,10 @@ module Recurly
38
38
  # @return [String] Optional description, not displayed.
39
39
  define_attribute :description, String
40
40
 
41
+ # @!attribute dunning_campaign_id
42
+ # @return [String] Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is enabled. Used to specify if a non-default dunning campaign should be assigned to this plan. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
43
+ define_attribute :dunning_campaign_id, String
44
+
41
45
  # @!attribute hosted_pages
42
46
  # @return [PlanHostedPages] Hosted pages settings
43
47
  define_attribute :hosted_pages, :PlanHostedPages
@@ -51,7 +51,7 @@ module Recurly
51
51
  define_attribute :revenue_schedule_type, String
52
52
 
53
53
  # @!attribute shipping
54
- # @return [SubscriptionChangeShippingCreate] The shipping address can currently only be changed immediately, using SubscriptionUpdate.
54
+ # @return [SubscriptionChangeShippingCreate] Shipping addresses are tied to a customer's account. Each account can have up to 20 different shipping addresses, and if you have enabled multiple subscriptions per account, you can associate different shipping addresses to each subscription.
55
55
  define_attribute :shipping, :SubscriptionChangeShippingCreate
56
56
 
57
57
  # @!attribute timeframe
@@ -6,6 +6,14 @@ module Recurly
6
6
  module Requests
7
7
  class SubscriptionChangeShippingCreate < Request
8
8
 
9
+ # @!attribute address
10
+ # @return [ShippingAddressCreate]
11
+ define_attribute :address, :ShippingAddressCreate
12
+
13
+ # @!attribute address_id
14
+ # @return [String] Assign a shipping address from the account's existing shipping addresses. If this and address are both present, address will take precedence.
15
+ define_attribute :address_id, String
16
+
9
17
  # @!attribute amount
10
18
  # @return [Float] Assigns the subscription's shipping cost. If this is greater than zero then a `method_id` or `method_code` is required.
11
19
  define_attribute :amount, Float
@@ -7,7 +7,7 @@ module Recurly
7
7
  class SubscriptionPause < Request
8
8
 
9
9
  # @!attribute remaining_pause_cycles
10
- # @return [Integer] Number of billing cycles to pause the subscriptions.
10
+ # @return [Integer] Number of billing cycles to pause the subscriptions. A value of 0 will cancel any pending pauses on the subscription.
11
11
  define_attribute :remaining_pause_cycles, Integer
12
12
  end
13
13
  end
@@ -26,6 +26,10 @@ module Recurly
26
26
  # @return [String] Specify custom notes to add or override Customer Notes. Custom notes will stay with a subscription on all renewals.
27
27
  define_attribute :customer_notes, String
28
28
 
29
+ # @!attribute gateway_code
30
+ # @return [String] If present, this subscription's transactions will use the payment gateway with this code.
31
+ define_attribute :gateway_code, String
32
+
29
33
  # @!attribute net_terms
30
34
  # @return [Integer] Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.
31
35
  define_attribute :net_terms, Integer
@@ -42,6 +42,10 @@ module Recurly
42
42
  # @return [DateTime] If present, when the account was last marked inactive.
43
43
  define_attribute :deleted_at, DateTime
44
44
 
45
+ # @!attribute dunning_campaign_id
46
+ # @return [String] Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is enabled. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
47
+ define_attribute :dunning_campaign_id, String
48
+
45
49
  # @!attribute email
46
50
  # @return [String] The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique.
47
51
  define_attribute :email, String
@@ -18,6 +18,10 @@ module Recurly
18
18
  # @return [String]
19
19
  define_attribute :company, String
20
20
 
21
+ # @!attribute dunning_campaign_id
22
+ # @return [String] Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is enabled. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
23
+ define_attribute :dunning_campaign_id, String
24
+
21
25
  # @!attribute email
22
26
  # @return [String] The email address used for communicating with this customer.
23
27
  define_attribute :email, String
@@ -0,0 +1,50 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
5
+ module Recurly
6
+ module Resources
7
+ class DunningCampaign < Resource
8
+
9
+ # @!attribute code
10
+ # @return [String] Campaign code.
11
+ define_attribute :code, String
12
+
13
+ # @!attribute created_at
14
+ # @return [DateTime] When the current campaign was created in Recurly.
15
+ define_attribute :created_at, DateTime
16
+
17
+ # @!attribute default_campaign
18
+ # @return [Boolean] Whether or not this is the default campaign for accounts or plans without an assigned dunning campaign.
19
+ define_attribute :default_campaign, :Boolean
20
+
21
+ # @!attribute deleted_at
22
+ # @return [DateTime] When the current campaign was deleted in Recurly.
23
+ define_attribute :deleted_at, DateTime
24
+
25
+ # @!attribute description
26
+ # @return [String] Campaign description.
27
+ define_attribute :description, String
28
+
29
+ # @!attribute dunning_cycles
30
+ # @return [Array[DunningCycle]] Dunning Cycle settings.
31
+ define_attribute :dunning_cycles, Array, { :item_type => :DunningCycle }
32
+
33
+ # @!attribute id
34
+ # @return [String]
35
+ define_attribute :id, String
36
+
37
+ # @!attribute name
38
+ # @return [String] Campaign name.
39
+ define_attribute :name, String
40
+
41
+ # @!attribute object
42
+ # @return [String] Object type
43
+ define_attribute :object, String
44
+
45
+ # @!attribute updated_at
46
+ # @return [DateTime] When the current campaign was updated in Recurly.
47
+ define_attribute :updated_at, DateTime
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,18 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
5
+ module Recurly
6
+ module Resources
7
+ class DunningCampaignsBulkUpdateResponse < Resource
8
+
9
+ # @!attribute object
10
+ # @return [String] Object type
11
+ define_attribute :object, String
12
+
13
+ # @!attribute plans
14
+ # @return [Array[Plan]] An array containing all of the `Plan` resources that have been updated.
15
+ define_attribute :plans, Array, { :item_type => :Plan }
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,58 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
5
+ module Recurly
6
+ module Resources
7
+ class DunningCycle < Resource
8
+
9
+ # @!attribute applies_to_manual_trial
10
+ # @return [Boolean] Whether the dunning settings will be applied to manual trials. Only applies to trial cycles.
11
+ define_attribute :applies_to_manual_trial, :Boolean
12
+
13
+ # @!attribute created_at
14
+ # @return [DateTime] When the current settings were created in Recurly.
15
+ define_attribute :created_at, DateTime
16
+
17
+ # @!attribute expire_subscription
18
+ # @return [Boolean] Whether the subscription(s) should be cancelled at the end of the dunning cycle.
19
+ define_attribute :expire_subscription, :Boolean
20
+
21
+ # @!attribute fail_invoice
22
+ # @return [Boolean] Whether the invoice should be failed at the end of the dunning cycle.
23
+ define_attribute :fail_invoice, :Boolean
24
+
25
+ # @!attribute first_communication_interval
26
+ # @return [Integer] The number of days after a transaction failure before the first dunning email is sent.
27
+ define_attribute :first_communication_interval, Integer
28
+
29
+ # @!attribute intervals
30
+ # @return [Array[DunningInterval]] Dunning intervals.
31
+ define_attribute :intervals, Array, { :item_type => :DunningInterval }
32
+
33
+ # @!attribute send_immediately_on_hard_decline
34
+ # @return [Boolean] Whether or not to send an extra email immediately to customers whose initial payment attempt fails with either a hard decline or invalid billing info.
35
+ define_attribute :send_immediately_on_hard_decline, :Boolean
36
+
37
+ # @!attribute total_dunning_days
38
+ # @return [Integer] The number of days between the first dunning email being sent and the end of the dunning cycle.
39
+ define_attribute :total_dunning_days, Integer
40
+
41
+ # @!attribute total_recycling_days
42
+ # @return [Integer] The number of days between a transaction failure and the end of the dunning cycle.
43
+ define_attribute :total_recycling_days, Integer
44
+
45
+ # @!attribute type
46
+ # @return [String] The type of invoice this cycle applies to.
47
+ define_attribute :type, String
48
+
49
+ # @!attribute updated_at
50
+ # @return [DateTime] When the current settings were updated in Recurly.
51
+ define_attribute :updated_at, DateTime
52
+
53
+ # @!attribute version
54
+ # @return [Integer] Current campaign version.
55
+ define_attribute :version, Integer
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,18 @@
1
+ # This file is automatically created by Recurly's OpenAPI generation process
2
+ # and thus any edits you make by hand will be lost. If you wish to make a
3
+ # change to this file, please create a Github issue explaining the changes you
4
+ # need and we will usher them to the appropriate places.
5
+ module Recurly
6
+ module Resources
7
+ class DunningInterval < Resource
8
+
9
+ # @!attribute days
10
+ # @return [Integer] Number of days before sending the next email.
11
+ define_attribute :days, Integer
12
+
13
+ # @!attribute email_template
14
+ # @return [String] Email template being used.
15
+ define_attribute :email_template, String
16
+ end
17
+ end
18
+ end
@@ -54,6 +54,10 @@ module Recurly
54
54
  # @return [DateTime] Date invoice is due. This is the date the net terms are reached.
55
55
  define_attribute :due_at, DateTime
56
56
 
57
+ # @!attribute dunning_campaign_id
58
+ # @return [String] Unique ID to identify the dunning campaign used when dunning the invoice. Available when the Dunning Campaigns feature is enabled. For sites without multiple dunning campaigns enabled, this will always be the default dunning campaign.
59
+ define_attribute :dunning_campaign_id, String
60
+
57
61
  # @!attribute has_more_line_items
58
62
  # @return [Boolean] Identifies if the invoice has more line items than are returned in `line_items`. If `has_more_line_items` is `true`, then a request needs to be made to the `list_invoice_line_items` endpoint.
59
63
  define_attribute :has_more_line_items, :Boolean