recurly 4.9.0 → 4.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.bumpversion.cfg +1 -1
  3. data/.travis.yml +3 -1
  4. data/CHANGELOG.md +50 -0
  5. data/GETTING_STARTED.md +9 -1
  6. data/lib/recurly/client/operations.rb +46 -3
  7. data/lib/recurly/client.rb +24 -4
  8. data/lib/recurly/connection_pool.rb +11 -9
  9. data/lib/recurly/errors/api_errors.rb +2 -0
  10. data/lib/recurly/requests/account_create.rb +4 -0
  11. data/lib/recurly/requests/account_purchase.rb +4 -0
  12. data/lib/recurly/requests/account_update.rb +4 -0
  13. data/lib/recurly/requests/add_on_create.rb +2 -2
  14. data/lib/recurly/requests/add_on_pricing.rb +4 -0
  15. data/lib/recurly/requests/billing_info_create.rb +24 -0
  16. data/lib/recurly/requests/invoice_collect.rb +1 -1
  17. data/lib/recurly/requests/line_item_create.rb +6 -2
  18. data/lib/recurly/requests/plan_pricing.rb +4 -0
  19. data/lib/recurly/requests/pricing.rb +4 -0
  20. data/lib/recurly/requests/purchase_create.rb +1 -1
  21. data/lib/recurly/requests/subscription_change_create.rb +5 -1
  22. data/lib/recurly/requests/subscription_create.rb +5 -1
  23. data/lib/recurly/requests/subscription_purchase.rb +4 -0
  24. data/lib/recurly/requests/subscription_update.rb +5 -1
  25. data/lib/recurly/resources/account.rb +4 -0
  26. data/lib/recurly/resources/account_invoice_template.rb +18 -0
  27. data/lib/recurly/resources/add_on_pricing.rb +4 -0
  28. data/lib/recurly/resources/invoice.rb +1 -1
  29. data/lib/recurly/resources/line_item.rb +7 -3
  30. data/lib/recurly/resources/plan_pricing.rb +4 -0
  31. data/lib/recurly/resources/pricing.rb +4 -0
  32. data/lib/recurly/resources/subscription_change.rb +4 -0
  33. data/lib/recurly/version.rb +1 -1
  34. data/openapi/api.yaml +251 -20
  35. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38f52125b8c12aad80f605fc94ea0587a73ea82823fb8aec6b2deae2f706983c
4
- data.tar.gz: f223a30e3a884cb319e020cb074aa00b88aeb0d44529ddab8539f5636dc38ce0
3
+ metadata.gz: 74bb3fffd3b52c40e084beb12012c90e60fdf1e77ffa7de109a33c1a7e10d8cf
4
+ data.tar.gz: e59f0c7a4b633b001ff1bb2329825ef23611739f73e0313a0dfdd207e02492d4
5
5
  SHA512:
6
- metadata.gz: 7ec68d64ac36472c09c7267b3439eb2b3d63e0d7c17ad8245068c0378395e1562d4de229b360c8aab6ac2995db1c4fa1804c230f4ec1831213bb51cf8bed6d36
7
- data.tar.gz: 922e7c9f74131d607115100ae592da8f6d50fa72760d66d90b6e15ec824a31e1d34c6202895f43d37a482bf493bbd5e06bad3fa184008b54bc42d637f2ef062f
6
+ metadata.gz: c6d9e98a5f1c647ccefabb42985ecc0877ee6186f9130af118f17473380f02872228a7be1857958faaee06e8031295adc66de7fdf85f0140068aa62944017888
7
+ data.tar.gz: 288ed5f243fb25d4c115fd1162d3e8e883b67cf90fdce2d5fb480e37429f8d4ed72bec8000f8a3c1533bc91fe5f5ed2e92b19dffe6f5bbefd524622e1aa635e4
data/.bumpversion.cfg CHANGED
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 4.9.0
2
+ current_version = 4.13.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,55 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.13.0](https://github.com/recurly/recurly-client-ruby/tree/4.13.0) (2022-01-31)
4
+
5
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.12.0...4.13.0)
6
+
7
+
8
+ **Merged Pull Requests**
9
+
10
+ - Generated Latest Changes for v2021-02-25 [#747](https://github.com/recurly/recurly-client-ruby/pull/747) ([recurly-integrations](https://github.com/recurly-integrations))
11
+ - Add region argument to client to connect in EU data center [#744](https://github.com/recurly/recurly-client-ruby/pull/744) ([FabricioCoutinho](https://github.com/FabricioCoutinho))
12
+
13
+
14
+
15
+ ## [4.12.0](https://github.com/recurly/recurly-client-ruby/tree/4.12.0) (2022-01-28)
16
+
17
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.11.0...4.12.0)
18
+
19
+
20
+ **Merged Pull Requests**
21
+
22
+ - Generated Latest Changes for v2021-02-25 (Invoice Customization) [#746](https://github.com/recurly/recurly-client-ruby/pull/746) ([recurly-integrations](https://github.com/recurly-integrations))
23
+ - Generated Latest Changes for v2021-02-25 [#743](https://github.com/recurly/recurly-client-ruby/pull/743) ([recurly-integrations](https://github.com/recurly-integrations))
24
+
25
+
26
+
27
+ ## [4.11.0](https://github.com/recurly/recurly-client-ruby/tree/4.11.0) (2021-12-29)
28
+
29
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.10.0...4.11.0)
30
+
31
+
32
+ **Merged Pull Requests**
33
+
34
+ - Generated Latest Changes for v2021-02-25 (Tax Inclusive Pricing) [#741](https://github.com/recurly/recurly-client-ruby/pull/741) ([recurly-integrations](https://github.com/recurly-integrations))
35
+
36
+
37
+
38
+ ## [4.10.0](https://github.com/recurly/recurly-client-ruby/tree/4.10.0) (2021-11-22)
39
+
40
+ [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.9.0...4.10.0)
41
+
42
+
43
+ **Merged Pull Requests**
44
+
45
+ - Generated Latest Changes for v2021-02-25 [#739](https://github.com/recurly/recurly-client-ruby/pull/739) ([recurly-integrations](https://github.com/recurly-integrations))
46
+ - Generated Latest Changes for v2021-02-25 [#736](https://github.com/recurly/recurly-client-ruby/pull/736) ([recurly-integrations](https://github.com/recurly-integrations))
47
+ - Allow API base url configuration [#735](https://github.com/recurly/recurly-client-ruby/pull/735) ([cbarton](https://github.com/cbarton))
48
+ - Generated Latest Changes for v2021-02-25 [#734](https://github.com/recurly/recurly-client-ruby/pull/734) ([recurly-integrations](https://github.com/recurly-integrations))
49
+ - Generated Latest Changes for v2021-02-25 [#728](https://github.com/recurly/recurly-client-ruby/pull/728) ([recurly-integrations](https://github.com/recurly-integrations))
50
+
51
+
52
+
3
53
  ## [4.9.0](https://github.com/recurly/recurly-client-ruby/tree/4.9.0) (2021-09-16)
4
54
 
5
55
  [Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.8.0...4.9.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.9'
8
+ gem 'recurly', '~> 4.13'
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.
@@ -22,6 +22,14 @@ client = Recurly::Client.new(api_key: API_KEY)
22
22
  sub = client.get_subscription(subscription_id: 'abcd123456')
23
23
  ```
24
24
 
25
+ To access Recurly API in Europe, you will need to specify the EU Region in the argument region.
26
+
27
+ ```ruby
28
+ API_KEY = '83749879bbde395b5fe0cc1a5abf8e5'
29
+ client = Recurly::Client.new(api_key: API_KEY, region: :eu)
30
+ sub = client.get_subscription(subscription_id: 'abcd123456')
31
+ ```
32
+
25
33
  You can also pass the initializer a block. This will give you a client scoped for just that block:
26
34
 
27
35
  ```ruby
@@ -532,7 +532,7 @@ module Recurly
532
532
  # {https://developers.recurly.com/api/v2021-02-25#operation/get_a_billing_info get_a_billing_info api documenation}
533
533
  #
534
534
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
535
- # @param billing_info_id [String] Billing Info ID.
535
+ # @param billing_info_id [String] Billing Info ID. Can ONLY be used for sites utilizing the Wallet feature.
536
536
  # @param params [Hash] Optional query string parameters:
537
537
  #
538
538
  # @return [Resources::BillingInfo] A billing info.
@@ -547,7 +547,7 @@ module Recurly
547
547
  # {https://developers.recurly.com/api/v2021-02-25#operation/update_a_billing_info update_a_billing_info api documenation}
548
548
  #
549
549
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
550
- # @param billing_info_id [String] Billing Info ID.
550
+ # @param billing_info_id [String] Billing Info ID. Can ONLY be used for sites utilizing the Wallet feature.
551
551
  # @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate}
552
552
  # @param params [Hash] Optional query string parameters:
553
553
  #
@@ -563,7 +563,7 @@ module Recurly
563
563
  # {https://developers.recurly.com/api/v2021-02-25#operation/remove_a_billing_info remove_a_billing_info api documenation}
564
564
  #
565
565
  # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+.
566
- # @param billing_info_id [String] Billing Info ID.
566
+ # @param billing_info_id [String] Billing Info ID. Can ONLY be used for sites utilizing the Wallet feature.
567
567
  # @param params [Hash] Optional query string parameters:
568
568
  #
569
569
  # @return [Resources::Empty] Billing information deleted
@@ -1712,6 +1712,49 @@ module Recurly
1712
1712
  get(path, **options)
1713
1713
  end
1714
1714
 
1715
+ # List an invoice template's associated accounts
1716
+ #
1717
+ # {https://developers.recurly.com/api/v2021-02-25#operation/list_invoice_template_accounts list_invoice_template_accounts api documenation}
1718
+ #
1719
+ # @param invoice_template_id [String] Invoice template ID.
1720
+ # @param params [Hash] Optional query string parameters:
1721
+ # :ids [String] Filter results by their IDs. Up to 200 IDs can be passed at once using
1722
+ # commas as separators, e.g. +ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6+.
1723
+ #
1724
+ # *Important notes:*
1725
+ #
1726
+ # * The +ids+ parameter cannot be used with any other ordering or filtering
1727
+ # parameters (+limit+, +order+, +sort+, +begin_time+, +end_time+, etc)
1728
+ # * Invalid or unknown IDs will be ignored, so you should check that the
1729
+ # results correspond to your request.
1730
+ # * Records are returned in an arbitrary order. Since results are all
1731
+ # returned at once you can sort the records yourself.
1732
+ #
1733
+ # :limit [Integer] Limit number of records 1-200.
1734
+ # :order [String] Sort order.
1735
+ # :sort [String] Sort field. You *really* only want to sort by +updated_at+ in ascending
1736
+ # order. In descending order updated records will move behind the cursor and could
1737
+ # prevent some records from being returned.
1738
+ #
1739
+ # :begin_time [DateTime] Inclusively filter by begin_time when +sort=created_at+ or +sort=updated_at+.
1740
+ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1741
+ #
1742
+ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+.
1743
+ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
1744
+ #
1745
+ # :email [String] Filter for accounts with this exact email address. A blank value will return accounts with both +null+ and +""+ email addresses. Note that multiple accounts can share one email address.
1746
+ # :subscriber [Boolean] Filter for accounts with or without a subscription in the +active+,
1747
+ # +canceled+, or +future+ state.
1748
+ #
1749
+ # :past_due [String] Filter for accounts with an invoice in the +past_due+ state.
1750
+ #
1751
+ # @return [Pager<Resources::Account>] A list of an invoice template's associated accounts.
1752
+ #
1753
+ def list_invoice_template_accounts(invoice_template_id:, **options)
1754
+ path = interpolate_path("/invoice_templates/{invoice_template_id}/accounts", invoice_template_id: invoice_template_id)
1755
+ pager(path, **options)
1756
+ end
1757
+
1715
1758
  # List a site's items
1716
1759
  #
1717
1760
  # {https://developers.recurly.com/api/v2021-02-25#operation/list_items list_items api documenation}
@@ -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,11 @@ 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
+ API_HOSTS = {
15
+ us: "https://v3.recurly.com",
16
+ eu: "https://v3.eu.recurly.com",
17
+ }
18
+ REGION = :us
15
19
  CA_FILE = File.join(File.dirname(__FILE__), "../data/ca-certificates.crt")
16
20
  BINARY_TYPES = [
17
21
  "application/pdf",
@@ -52,12 +56,20 @@ module Recurly
52
56
  # client = Recurly::Client.new(api_key: API_KEY2)
53
57
  # sub = client.get_subscription(subscription_id: 'uuid-abcd7890')
54
58
  #
59
+ # @param region [String] The DataCenter that is called by the API. Default to "us"
60
+ # @param base_url [String] The base URL for the API. Defaults to "https://v3.recurly.com"
61
+ # @param ca_file [String] The CA bundle to use when connecting to the API. Defaults to "data/ca-certificates.crt"
55
62
  # @param api_key [String] The private API key
56
63
  # @param logger [Logger] A logger to use. Defaults to creating a new STDOUT logger with level WARN.
57
- def initialize(api_key:, logger: nil)
64
+ def initialize(region: REGION, base_url: API_HOSTS[:us], ca_file: CA_FILE, api_key:, logger: nil)
58
65
  raise ArgumentError, "'api_key' must be set to a non-nil value" if api_key.nil?
59
66
 
67
+ raise ArgumentError, "Invalid region type. Expected one of: #{API_HOSTS.keys.join(", ")}" if !API_HOSTS.key?(region)
68
+
69
+ base_url = API_HOSTS[region] if base_url == API_HOSTS[:us] && API_HOSTS.key?(region)
70
+
60
71
  set_api_key(api_key)
72
+ set_connection_options(base_url, ca_file)
61
73
 
62
74
  if logger.nil?
63
75
  @logger = Logger.new(STDOUT).tap do |l|
@@ -107,7 +119,9 @@ module Recurly
107
119
 
108
120
  def get(path, **options)
109
121
  validate_options!(**options)
122
+
110
123
  request = Net::HTTP::Get.new build_url(path, options)
124
+
111
125
  set_headers(request, options[:headers])
112
126
  http_response = run_request(request, options)
113
127
  handle_response! request, http_response
@@ -158,13 +172,14 @@ module Recurly
158
172
  end
159
173
 
160
174
  def run_request(request, options = {})
161
- self.class.connection_pool.with_connection do |http|
175
+ self.class.connection_pool.with_connection(uri: @base_uri, ca_file: @ca_file) do |http|
162
176
  set_http_options(http, options)
163
177
 
164
178
  retries = 0
165
179
 
166
180
  begin
167
181
  http.start unless http.started?
182
+
168
183
  log_attrs = {
169
184
  method: request.method,
170
185
  path: request.path,
@@ -338,6 +353,11 @@ module Recurly
338
353
  @api_key = api_key.to_s
339
354
  end
340
355
 
356
+ def set_connection_options(base_url, ca_file)
357
+ @base_uri = URI.parse(base_url)
358
+ @ca_file = ca_file
359
+ end
360
+
341
361
  def build_url(path, options)
342
362
  path = scope_by_site(path, options)
343
363
  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
 
@@ -29,6 +29,8 @@ module Recurly
29
29
 
30
30
  class ServiceNotAvailableError < InternalServerError; end
31
31
 
32
+ class TaxServiceError < InternalServerError; end
33
+
32
34
  class BadGatewayError < ServerError; end
33
35
 
34
36
  class ServiceUnavailableError < ServerError; end
@@ -54,6 +54,10 @@ module Recurly
54
54
  # @return [String]
55
55
  define_attribute :first_name, String
56
56
 
57
+ # @!attribute invoice_template_id
58
+ # @return [String] Unique ID to identify an invoice template. Available when the Invoice Customization feature is enabled. Used to specify which invoice template, if any, should be used to generate invoices for the account.
59
+ define_attribute :invoice_template_id, String
60
+
57
61
  # @!attribute last_name
58
62
  # @return [String]
59
63
  define_attribute :last_name, String
@@ -58,6 +58,10 @@ module Recurly
58
58
  # @return [String] Optional, but if present allows an existing account to be used and updated as part of the purchase.
59
59
  define_attribute :id, String
60
60
 
61
+ # @!attribute invoice_template_id
62
+ # @return [String] Unique ID to identify an invoice template. Available when the Invoice Customization feature is enabled. Used to specify which invoice template, if any, should be used to generate invoices for the account.
63
+ define_attribute :invoice_template_id, String
64
+
61
65
  # @!attribute last_name
62
66
  # @return [String]
63
67
  define_attribute :last_name, String
@@ -46,6 +46,10 @@ module Recurly
46
46
  # @return [String]
47
47
  define_attribute :first_name, String
48
48
 
49
+ # @!attribute invoice_template_id
50
+ # @return [String] Unique ID to identify an invoice template. Available when the Invoice Customization feature is enabled. Used to specify which invoice template, if any, should be used to generate invoices for the account.
51
+ define_attribute :invoice_template_id, String
52
+
49
53
  # @!attribute last_name
50
54
  # @return [String]
51
55
  define_attribute :last_name, String
@@ -39,11 +39,11 @@ module Recurly
39
39
  define_attribute :display_quantity, :Boolean
40
40
 
41
41
  # @!attribute item_code
42
- # @return [String] Unique code to identify an item. Available when the `Credit Invoices` and `Subscription Billing Terms` features are enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
42
+ # @return [String] Unique code to identify an item. Available when the `Credit Invoices` feature are enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
43
43
  define_attribute :item_code, String
44
44
 
45
45
  # @!attribute item_id
46
- # @return [String] System-generated unique identifier for an item. Available when the `Credit Invoices` and `Subscription Billing Terms` features are enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
46
+ # @return [String] System-generated unique identifier for an item. Available when the `Credit Invoices` feature is enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
47
47
  define_attribute :item_id, String
48
48
 
49
49
  # @!attribute measured_unit_id
@@ -10,6 +10,10 @@ module Recurly
10
10
  # @return [String] 3-letter ISO 4217 currency code.
11
11
  define_attribute :currency, String
12
12
 
13
+ # @!attribute tax_inclusive
14
+ # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
15
+ define_attribute :tax_inclusive, :Boolean
16
+
13
17
  # @!attribute unit_amount
14
18
  # @return [Float] Allows up to 2 decimal places. Required unless `unit_amount_decimal` is provided.
15
19
  define_attribute :unit_amount, Float
@@ -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. `bacs` and `becs` are the only accepted values.
115
+ define_attribute :type, String
116
+
93
117
  # @!attribute vat_number
94
118
  # @return [String] VAT number
95
119
  define_attribute :vat_number, String
@@ -7,7 +7,7 @@ module Recurly
7
7
  class InvoiceCollect < Request
8
8
 
9
9
  # @!attribute billing_info_id
10
- # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info.
10
+ # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
11
11
  define_attribute :billing_info_id, String
12
12
 
13
13
  # @!attribute three_d_secure_action_result_token_id
@@ -35,11 +35,11 @@ module Recurly
35
35
  define_attribute :end_date, DateTime
36
36
 
37
37
  # @!attribute item_code
38
- # @return [String] Unique code to identify an item. Available when the Credit Invoices and Subscription Billing Terms features are enabled.
38
+ # @return [String] Unique code to identify an item. Available when the Credit Invoices feature is enabled.
39
39
  define_attribute :item_code, String
40
40
 
41
41
  # @!attribute item_id
42
- # @return [String] System-generated unique identifier for an item. Available when the Credit Invoices and Subscription Billing Terms features are enabled.
42
+ # @return [String] System-generated unique identifier for an item. Available when the Credit Invoices feature is enabled.
43
43
  define_attribute :item_id, String
44
44
 
45
45
  # @!attribute origin
@@ -70,6 +70,10 @@ module Recurly
70
70
  # @return [Boolean] `true` exempts tax on charges, `false` applies tax on charges. If not defined, then defaults to the Plan and Site settings. This attribute does not work for credits (negative line items). Credits are always applied post-tax. Pre-tax discounts should use the Coupons feature.
71
71
  define_attribute :tax_exempt, :Boolean
72
72
 
73
+ # @!attribute tax_inclusive
74
+ # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
75
+ define_attribute :tax_inclusive, :Boolean
76
+
73
77
  # @!attribute type
74
78
  # @return [String] Line item type. If `item_code`/`item_id` is present then `type` should not be present. If `item_code`/`item_id` is not present then `type` is required.
75
79
  define_attribute :type, String
@@ -14,6 +14,10 @@ module Recurly
14
14
  # @return [Float] Amount of one-time setup fee automatically charged at the beginning of a subscription billing cycle. For subscription plans with a trial, the setup fee will be charged at the time of signup. Setup fees do not increase with the quantity of a subscription plan.
15
15
  define_attribute :setup_fee, Float
16
16
 
17
+ # @!attribute tax_inclusive
18
+ # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
19
+ define_attribute :tax_inclusive, :Boolean
20
+
17
21
  # @!attribute unit_amount
18
22
  # @return [Float] Unit price
19
23
  define_attribute :unit_amount, Float
@@ -10,6 +10,10 @@ module Recurly
10
10
  # @return [String] 3-letter ISO 4217 currency code.
11
11
  define_attribute :currency, String
12
12
 
13
+ # @!attribute tax_inclusive
14
+ # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
15
+ define_attribute :tax_inclusive, :Boolean
16
+
13
17
  # @!attribute unit_amount
14
18
  # @return [Float] Unit price
15
19
  define_attribute :unit_amount, Float
@@ -11,7 +11,7 @@ module Recurly
11
11
  define_attribute :account, :AccountPurchase
12
12
 
13
13
  # @!attribute billing_info_id
14
- # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info.
14
+ # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
15
15
  define_attribute :billing_info_id, String
16
16
 
17
17
  # @!attribute collection_method
@@ -51,9 +51,13 @@ 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
+ # @!attribute tax_inclusive
58
+ # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
59
+ define_attribute :tax_inclusive, :Boolean
60
+
57
61
  # @!attribute timeframe
58
62
  # @return [String] The timeframe parameter controls when the upgrade or downgrade takes place. The subscription change can occur now, when the subscription is next billed, or when the subscription term ends. Generally, if you're performing an upgrade, you will want the change to occur immediately (now). If you're performing a downgrade, you should set the timeframe to `term_end` or `bill_date` so the change takes effect at a scheduled billing date. The `renewal` timeframe option is accepted as an alias for `term_end`.
59
63
  define_attribute :timeframe, String
@@ -19,7 +19,7 @@ module Recurly
19
19
  define_attribute :auto_renew, :Boolean
20
20
 
21
21
  # @!attribute billing_info_id
22
- # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info.
22
+ # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
23
23
  define_attribute :billing_info_id, String
24
24
 
25
25
  # @!attribute collection_method
@@ -86,6 +86,10 @@ module Recurly
86
86
  # @return [DateTime] If set, the subscription will begin in the future on this date. The subscription will apply the setup fee and trial period, unless the plan has no trial.
87
87
  define_attribute :starts_at, DateTime
88
88
 
89
+ # @!attribute tax_inclusive
90
+ # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
91
+ define_attribute :tax_inclusive, :Boolean
92
+
89
93
  # @!attribute terms_and_conditions
90
94
  # @return [String] This will default to the Terms and Conditions text specified on the Invoice Settings page in your Recurly admin. Specify custom notes to add or override Terms and Conditions. Custom notes will stay with a subscription on all renewals.
91
95
  define_attribute :terms_and_conditions, String
@@ -50,6 +50,10 @@ module Recurly
50
50
  # @return [DateTime] If set, the subscription will begin in the future on this date. The subscription will apply the setup fee and trial period, unless the plan has no trial.
51
51
  define_attribute :starts_at, DateTime
52
52
 
53
+ # @!attribute tax_inclusive
54
+ # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
55
+ define_attribute :tax_inclusive, :Boolean
56
+
53
57
  # @!attribute total_billing_cycles
54
58
  # @return [Integer] The number of cycles/billing periods in a term. When `remaining_billing_cycles=0`, if `auto_renew=true` the subscription will renew and a new term will begin, otherwise the subscription will expire.
55
59
  define_attribute :total_billing_cycles, Integer
@@ -11,7 +11,7 @@ module Recurly
11
11
  define_attribute :auto_renew, :Boolean
12
12
 
13
13
  # @!attribute billing_info_id
14
- # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info.
14
+ # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
15
15
  define_attribute :billing_info_id, String
16
16
 
17
17
  # @!attribute collection_method
@@ -58,6 +58,10 @@ module Recurly
58
58
  # @return [SubscriptionShippingUpdate] Subscription shipping details
59
59
  define_attribute :shipping, :SubscriptionShippingUpdate
60
60
 
61
+ # @!attribute tax_inclusive
62
+ # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
63
+ define_attribute :tax_inclusive, :Boolean
64
+
61
65
  # @!attribute terms_and_conditions
62
66
  # @return [String] Specify custom notes to add or override Terms and Conditions. Custom notes will stay with a subscription on all renewals.
63
67
  define_attribute :terms_and_conditions, String
@@ -90,6 +90,10 @@ module Recurly
90
90
  # @return [String]
91
91
  define_attribute :id, String
92
92
 
93
+ # @!attribute invoice_template
94
+ # @return [AccountInvoiceTemplate] Invoice template associated to the account. Available when invoice customization flag is enabled.
95
+ define_attribute :invoice_template, :AccountInvoiceTemplate
96
+
93
97
  # @!attribute last_name
94
98
  # @return [String]
95
99
  define_attribute :last_name, 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 Resources
7
+ class AccountInvoiceTemplate < Resource
8
+
9
+ # @!attribute id
10
+ # @return [String] Unique ID to identify the invoice template.
11
+ define_attribute :id, String
12
+
13
+ # @!attribute name
14
+ # @return [String] Template name
15
+ define_attribute :name, String
16
+ end
17
+ end
18
+ end
@@ -10,6 +10,10 @@ module Recurly
10
10
  # @return [String] 3-letter ISO 4217 currency code.
11
11
  define_attribute :currency, String
12
12
 
13
+ # @!attribute tax_inclusive
14
+ # @return [Boolean] Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
15
+ define_attribute :tax_inclusive, :Boolean
16
+
13
17
  # @!attribute unit_amount
14
18
  # @return [Float] Allows up to 2 decimal places. Required unless `unit_amount_decimal` is provided.
15
19
  define_attribute :unit_amount, Float
@@ -19,7 +19,7 @@ module Recurly
19
19
  define_attribute :balance, Float
20
20
 
21
21
  # @!attribute billing_info_id
22
- # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info.
22
+ # @return [String] The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
23
23
  define_attribute :billing_info_id, String
24
24
 
25
25
  # @!attribute closed_at