recurly 3.3.1 → 3.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.bumpversion.cfg +5 -1
- data/.github/workflows/docs.yml +28 -0
- data/.travis.yml +1 -0
- data/CHANGELOG.md +92 -1
- data/GETTING_STARTED.md +61 -1
- data/README.md +1 -1
- data/lib/data/ca-certificates.crt +3464 -29
- data/lib/recurly.rb +1 -0
- data/lib/recurly/client.rb +217 -111
- data/lib/recurly/client/operations.rb +301 -1
- data/lib/recurly/connection_pool.rb +40 -0
- data/lib/recurly/errors.rb +30 -0
- data/lib/recurly/errors/network_errors.rb +2 -0
- data/lib/recurly/http.rb +13 -8
- data/lib/recurly/pager.rb +31 -12
- data/lib/recurly/requests/add_on_create.rb +15 -3
- data/lib/recurly/requests/add_on_update.rb +9 -1
- data/lib/recurly/requests/billing_info_create.rb +26 -2
- data/lib/recurly/requests/external_transaction.rb +26 -0
- data/lib/recurly/requests/plan_create.rb +8 -0
- data/lib/recurly/requests/plan_update.rb +8 -0
- data/lib/recurly/requests/shipping_method_create.rb +26 -0
- data/lib/recurly/requests/shipping_method_update.rb +26 -0
- data/lib/recurly/requests/subscription_add_on_create.rb +5 -1
- data/lib/recurly/requests/subscription_add_on_tier.rb +18 -0
- data/lib/recurly/requests/subscription_add_on_update.rb +6 -2
- data/lib/recurly/requests/subscription_change_create.rb +1 -1
- data/lib/recurly/requests/tier.rb +18 -0
- data/lib/recurly/resources/add_on.rb +8 -0
- data/lib/recurly/resources/line_item.rb +1 -1
- data/lib/recurly/resources/payment_method.rb +4 -0
- data/lib/recurly/resources/plan.rb +8 -0
- data/lib/recurly/resources/shipping_method.rb +4 -0
- data/lib/recurly/resources/subscription_add_on.rb +12 -0
- data/lib/recurly/resources/subscription_add_on_tier.rb +18 -0
- data/lib/recurly/resources/tier.rb +18 -0
- data/lib/recurly/resources/transaction.rb +4 -0
- data/lib/recurly/version.rb +1 -1
- data/openapi/api.yaml +5325 -2782
- data/recurly.gemspec +8 -3
- data/scripts/changelog +2 -0
- data/scripts/format +5 -1
- data/scripts/release +5 -3
- metadata +17 -38
- data/lib/recurly/client/adapter.rb +0 -39
@@ -0,0 +1,40 @@
|
|
1
|
+
require "net/https"
|
2
|
+
|
3
|
+
module Recurly
|
4
|
+
class ConnectionPool
|
5
|
+
def initialize
|
6
|
+
@mutex = Mutex.new
|
7
|
+
@pool = []
|
8
|
+
end
|
9
|
+
|
10
|
+
def with_connection
|
11
|
+
http = nil
|
12
|
+
@mutex.synchronize do
|
13
|
+
http = @pool.pop
|
14
|
+
end
|
15
|
+
|
16
|
+
# create connection if the pool was empty
|
17
|
+
http ||= init_http_connection
|
18
|
+
|
19
|
+
response = yield http
|
20
|
+
|
21
|
+
if http.started?
|
22
|
+
@mutex.synchronize do
|
23
|
+
@pool.push(http)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
response
|
28
|
+
end
|
29
|
+
|
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
|
34
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
35
|
+
http.keep_alive_timeout = 600
|
36
|
+
|
37
|
+
http
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/recurly/errors.rb
CHANGED
@@ -17,6 +17,36 @@ module Recurly
|
|
17
17
|
Errors.const_get(class_name)
|
18
18
|
end
|
19
19
|
|
20
|
+
# When the response does not have a JSON body, this determines the appropriate
|
21
|
+
# Error class based on the response code. This may occur when a load balancer
|
22
|
+
# returns an error before it reaches Recurly's API.
|
23
|
+
# @param response [Net::Response]
|
24
|
+
# @return [Errors::APIError,Errors::NetworkError]
|
25
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
26
|
+
def self.from_response(response)
|
27
|
+
case response
|
28
|
+
when Net::HTTPBadRequest # 400
|
29
|
+
Recurly::Errors::BadRequestError
|
30
|
+
when Net::HTTPUnauthorized, Net::HTTPForbidden # 401, 403
|
31
|
+
Recurly::Errors::UnauthorizedError
|
32
|
+
when Net::HTTPRequestTimeOut # 408
|
33
|
+
Recurly::Errors::TimeoutError
|
34
|
+
when Net::HTTPTooManyRequests # 429
|
35
|
+
Recurly::Errors::RateLimitedError
|
36
|
+
when Net::HTTPInternalServerError # 500
|
37
|
+
Recurly::Errors::InternalServerError
|
38
|
+
when Net::HTTPServiceUnavailable # 503
|
39
|
+
Recurly::Errors::UnavailableError
|
40
|
+
when Net::HTTPGatewayTimeOut # 504
|
41
|
+
Recurly::Errors::TimeoutError
|
42
|
+
when Net::HTTPServerError # 5xx
|
43
|
+
Recurly::Errors::UnavailableError
|
44
|
+
else
|
45
|
+
Recurly::Errors::APIError
|
46
|
+
end
|
47
|
+
end
|
48
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
49
|
+
|
20
50
|
def initialize(response, error)
|
21
51
|
super(error.message)
|
22
52
|
@response = response
|
@@ -1,8 +1,10 @@
|
|
1
1
|
module Recurly
|
2
2
|
module Errors
|
3
3
|
class NetworkError < StandardError; end
|
4
|
+
class InvalidResponseError < NetworkError; end
|
4
5
|
class TimeoutError < NetworkError; end
|
5
6
|
class ConnectionFailedError < NetworkError; end
|
6
7
|
class SSLError < NetworkError; end
|
8
|
+
class UnavailableError < NetworkError; end
|
7
9
|
end
|
8
10
|
end
|
data/lib/recurly/http.rb
CHANGED
@@ -4,16 +4,21 @@ module Recurly
|
|
4
4
|
attr_accessor :status, :body, :request,
|
5
5
|
:request_id, :rate_limit, :rate_limit_remaining,
|
6
6
|
:rate_limit_reset, :date, :proxy_metadata,
|
7
|
-
:content_type
|
7
|
+
:content_type, :total_records
|
8
8
|
|
9
9
|
def initialize(resp, request)
|
10
|
-
@request = request
|
11
|
-
@status = resp.
|
12
|
-
@request_id = resp
|
13
|
-
@rate_limit = resp
|
14
|
-
@rate_limit_remaining = resp
|
15
|
-
@rate_limit_reset = Time.at(resp
|
16
|
-
@
|
10
|
+
@request = Request.new(request.method, request.path, request.body)
|
11
|
+
@status = resp.code.to_i
|
12
|
+
@request_id = resp["x-request-id"]
|
13
|
+
@rate_limit = resp["x-ratelimit-limit"].to_i
|
14
|
+
@rate_limit_remaining = resp["x-ratelimit-remaining"].to_i
|
15
|
+
@rate_limit_reset = Time.at(resp["x-ratelimit-reset"].to_i).to_datetime
|
16
|
+
@total_records = resp["recurly-total-records"]&.to_i
|
17
|
+
if resp["content-type"]
|
18
|
+
@content_type = resp["content-type"].split(";").first
|
19
|
+
else
|
20
|
+
@content_type = resp.content_type
|
21
|
+
end
|
17
22
|
if resp.body && !resp.body.empty?
|
18
23
|
@body = resp.body
|
19
24
|
else
|
data/lib/recurly/pager.rb
CHANGED
@@ -7,7 +7,25 @@ module Recurly
|
|
7
7
|
@client = client
|
8
8
|
@path = path
|
9
9
|
@options = map_array_params(options)
|
10
|
-
|
10
|
+
rewind!
|
11
|
+
end
|
12
|
+
|
13
|
+
# Performs a request with the pager `limit` set to 1 and only returns the first
|
14
|
+
# result in the response.
|
15
|
+
def first
|
16
|
+
# Modify the @next url to set the :limit to 1
|
17
|
+
original_next = @next
|
18
|
+
@next = @path
|
19
|
+
fetch_next!(@options.merge(limit: 1))
|
20
|
+
# Restore the @next url to the original
|
21
|
+
@next = original_next
|
22
|
+
@data.first
|
23
|
+
end
|
24
|
+
|
25
|
+
# Makes a HEAD request to the API to determine how many total records exist.
|
26
|
+
def count
|
27
|
+
resource = @client.send(:head, self.next, @options)
|
28
|
+
resource.get_response.total_records
|
11
29
|
end
|
12
30
|
|
13
31
|
# Enumerates each "page" from the server.
|
@@ -84,7 +102,9 @@ module Recurly
|
|
84
102
|
def page_enumerator
|
85
103
|
Enumerator.new do |yielder|
|
86
104
|
loop do
|
87
|
-
|
105
|
+
# Pass in @options when requesting the first page (@data.empty?)
|
106
|
+
next_options = @data.empty? ? @options : {}
|
107
|
+
fetch_next!(next_options)
|
88
108
|
yielder << data
|
89
109
|
unless has_more?
|
90
110
|
rewind!
|
@@ -94,8 +114,9 @@ module Recurly
|
|
94
114
|
end
|
95
115
|
end
|
96
116
|
|
97
|
-
def fetch_next!
|
98
|
-
|
117
|
+
def fetch_next!(options)
|
118
|
+
path = extract_path(self.next)
|
119
|
+
page = @client.send(:get, path, options)
|
99
120
|
@data = page.data.map { |d| JSONParser.from_json(d) }
|
100
121
|
@has_more = page.has_more
|
101
122
|
@next = page.next
|
@@ -103,15 +124,13 @@ module Recurly
|
|
103
124
|
|
104
125
|
def rewind!
|
105
126
|
@data = []
|
106
|
-
@next =
|
127
|
+
@next = @path
|
107
128
|
end
|
108
129
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
"#{path}?#{URI.encode_www_form(options)}"
|
114
|
-
end
|
130
|
+
# Returns just the path and parameters so we can safely reuse the connection
|
131
|
+
def extract_path(uri_or_path)
|
132
|
+
uri = URI(uri_or_path)
|
133
|
+
uri.kind_of?(URI::HTTP) ? uri.request_uri : uri_or_path
|
115
134
|
end
|
116
135
|
|
117
136
|
# Converts array parameters to CSV strings to maintain consistency with
|
@@ -121,7 +140,7 @@ module Recurly
|
|
121
140
|
@options = params.map do |key, param|
|
122
141
|
new_param = param.is_a?(Array) ? param.join(",") : param
|
123
142
|
[key, new_param]
|
124
|
-
end
|
143
|
+
end.to_h
|
125
144
|
end
|
126
145
|
end
|
127
146
|
end
|
@@ -15,7 +15,7 @@ module Recurly
|
|
15
15
|
define_attribute :code, String
|
16
16
|
|
17
17
|
# @!attribute currencies
|
18
|
-
# @return [Array[AddOnPricing]] If `item_code`/`item_id` is part of the request and the item has a default currency then `currencies` is optional. If the item does not have a default currency, then `currencies` is required. If `item_code`/`item_id` is not present `currencies` is required.
|
18
|
+
# @return [Array[AddOnPricing]] * If `item_code`/`item_id` is part of the request and the item has a default currency then `currencies` is optional. If the item does not have a default currency, then `currencies` is required. If `item_code`/`item_id` is not present `currencies` is required. * If the add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `currencies` must be absent.
|
19
19
|
define_attribute :currencies, Array, { :item_type => :AddOnPricing }
|
20
20
|
|
21
21
|
# @!attribute default_quantity
|
@@ -27,17 +27,21 @@ module Recurly
|
|
27
27
|
define_attribute :display_quantity, :Boolean
|
28
28
|
|
29
29
|
# @!attribute item_code
|
30
|
-
# @return [String] Unique code to identify an item. Avaliable when the `
|
30
|
+
# @return [String] Unique code to identify an item. Avaliable 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.
|
31
31
|
define_attribute :item_code, String
|
32
32
|
|
33
33
|
# @!attribute item_id
|
34
|
-
# @return [String] System-generated unique identifier for an item. Available when the `
|
34
|
+
# @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.
|
35
35
|
define_attribute :item_id, String
|
36
36
|
|
37
37
|
# @!attribute name
|
38
38
|
# @return [String] Describes your add-on and will appear in subscribers' invoices. If `item_code`/`item_id` is part of the request then `name` must be absent. If `item_code`/`item_id` is not present `name` is required.
|
39
39
|
define_attribute :name, String
|
40
40
|
|
41
|
+
# @!attribute optional
|
42
|
+
# @return [Boolean] Whether the add-on is optional for the customer to include in their purchase on the hosted payment page. If false, the add-on will be included when a subscription is created through the Recurly UI. However, the add-on will not be included when a subscription is created through the API.
|
43
|
+
define_attribute :optional, :Boolean
|
44
|
+
|
41
45
|
# @!attribute plan_id
|
42
46
|
# @return [String] Plan ID
|
43
47
|
define_attribute :plan_id, String
|
@@ -49,6 +53,14 @@ module Recurly
|
|
49
53
|
# @!attribute tax_code
|
50
54
|
# @return [String] Optional field used by Avalara, Vertex, and Recurly's EU VAT tax feature to determine taxation rules. If you have your own AvaTax or Vertex account configured, use their tax codes to assign specific tax rules. If you are using Recurly's EU VAT feature, you can use values of `unknown`, `physical`, or `digital`. If `item_code`/`item_id` is part of the request then `tax_code` must be absent.
|
51
55
|
define_attribute :tax_code, String
|
56
|
+
|
57
|
+
# @!attribute tier_type
|
58
|
+
# @return [String] The pricing model for the add-on. For more information, [click here](https://docs.recurly.com/docs/billing-models#section-quantity-based).
|
59
|
+
define_attribute :tier_type, String
|
60
|
+
|
61
|
+
# @!attribute tiers
|
62
|
+
# @return [Array[Tier]] If the tier_type is `flat`, then `tiers` must be absent. The `tiers` object must include one to many tiers with `ending_quantity` and `unit_amount` for the desired `currencies`. There must be one tier with an `ending_quantity` of 999999999 which is the default if not provided.
|
63
|
+
define_attribute :tiers, Array, { :item_type => :Tier }
|
52
64
|
end
|
53
65
|
end
|
54
66
|
end
|
@@ -15,7 +15,7 @@ module Recurly
|
|
15
15
|
define_attribute :code, String
|
16
16
|
|
17
17
|
# @!attribute currencies
|
18
|
-
# @return [Array[AddOnPricing]]
|
18
|
+
# @return [Array[AddOnPricing]] If the add-on's `tier_type` is `tiered`, `volume` or `stairstep`, then `currencies` must be absent.
|
19
19
|
define_attribute :currencies, Array, { :item_type => :AddOnPricing }
|
20
20
|
|
21
21
|
# @!attribute default_quantity
|
@@ -34,6 +34,10 @@ module Recurly
|
|
34
34
|
# @return [String] Describes your add-on and will appear in subscribers' invoices. If an `Item` is associated to the `AddOn` then `name` must be absent.
|
35
35
|
define_attribute :name, String
|
36
36
|
|
37
|
+
# @!attribute optional
|
38
|
+
# @return [Boolean] Whether the add-on is optional for the customer to include in their purchase on the hosted payment page. If false, the add-on will be included when a subscription is created through the Recurly UI. However, the add-on will not be included when a subscription is created through the API.
|
39
|
+
define_attribute :optional, :Boolean
|
40
|
+
|
37
41
|
# @!attribute revenue_schedule_type
|
38
42
|
# @return [String] When this add-on is invoiced, the line item will use this revenue schedule. If an `Item` is associated to the `AddOn` then `revenue_schedule_type` must be absent in the request as the value will be set from the item.
|
39
43
|
define_attribute :revenue_schedule_type, String
|
@@ -41,6 +45,10 @@ module Recurly
|
|
41
45
|
# @!attribute tax_code
|
42
46
|
# @return [String] Optional field used by Avalara, Vertex, and Recurly's EU VAT tax feature to determine taxation rules. If you have your own AvaTax or Vertex account configured, use their tax codes to assign specific tax rules. If you are using Recurly's EU VAT feature, you can use values of `unknown`, `physical`, or `digital`. If an `Item` is associated to the `AddOn` then `tax code` must be absent.
|
43
47
|
define_attribute :tax_code, String
|
48
|
+
|
49
|
+
# @!attribute tiers
|
50
|
+
# @return [Array[Tier]] If the tier_type is `flat`, then `tiers` must be absent. The `tiers` object must include one to many tiers with `ending_quantity` and `unit_amount` for the desired `currencies`. There must be one tier with an `ending_quantity` of 999999999 which is the default if not provided.
|
51
|
+
define_attribute :tiers, Array, { :item_type => :Tier }
|
44
52
|
end
|
45
53
|
end
|
46
54
|
end
|
@@ -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
|
@@ -39,7 +47,7 @@ module Recurly
|
|
39
47
|
define_attribute :gateway_token, String
|
40
48
|
|
41
49
|
# @!attribute iban
|
42
|
-
# @return [String] The International Bank Account Number, up to 34 alphanumeric characters comprising a country code; two check digits; and a number that includes the domestic bank account number, branch identifier, and potential routing information
|
50
|
+
# @return [String] The International Bank Account Number, up to 34 alphanumeric characters comprising a country code; two check digits; and a number that includes the domestic bank account number, branch identifier, and potential routing information. (SEPA only)
|
43
51
|
define_attribute :iban, String
|
44
52
|
|
45
53
|
# @!attribute ip_address
|
@@ -54,6 +62,10 @@ module Recurly
|
|
54
62
|
# @return [String] Expiration month
|
55
63
|
define_attribute :month, String
|
56
64
|
|
65
|
+
# @!attribute name_on_account
|
66
|
+
# @return [String] The name associated with the bank account (ACH, SEPA, Bacs only)
|
67
|
+
define_attribute :name_on_account, String
|
68
|
+
|
57
69
|
# @!attribute number
|
58
70
|
# @return [String] Credit card number, spaces and dashes are accepted.
|
59
71
|
define_attribute :number, String
|
@@ -62,18 +74,30 @@ module Recurly
|
|
62
74
|
# @return [String] PayPal billing agreement ID
|
63
75
|
define_attribute :paypal_billing_agreement_id, String
|
64
76
|
|
77
|
+
# @!attribute routing_number
|
78
|
+
# @return [String] The bank's rounting number. (ACH only)
|
79
|
+
define_attribute :routing_number, String
|
80
|
+
|
81
|
+
# @!attribute sort_code
|
82
|
+
# @return [String] Bank identifier code for UK based banks. Required for Bacs based billing infos. (Bacs only)
|
83
|
+
define_attribute :sort_code, String
|
84
|
+
|
65
85
|
# @!attribute three_d_secure_action_result_token_id
|
66
86
|
# @return [String] A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or authentication challenge.
|
67
87
|
define_attribute :three_d_secure_action_result_token_id, String
|
68
88
|
|
69
89
|
# @!attribute token_id
|
70
|
-
# @return [String] A token [generated by Recurly.js](https://
|
90
|
+
# @return [String] A token [generated by Recurly.js](https://developers.recurly.com/reference/recurly-js/#getting-a-token).
|
71
91
|
define_attribute :token_id, String
|
72
92
|
|
73
93
|
# @!attribute transaction_type
|
74
94
|
# @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.
|
75
95
|
define_attribute :transaction_type, String
|
76
96
|
|
97
|
+
# @!attribute type
|
98
|
+
# @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)
|
99
|
+
define_attribute :type, String
|
100
|
+
|
77
101
|
# @!attribute vat_number
|
78
102
|
# @return [String] VAT number
|
79
103
|
define_attribute :vat_number, String
|
@@ -0,0 +1,26 @@
|
|
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 ExternalTransaction < Request
|
8
|
+
|
9
|
+
# @!attribute amount
|
10
|
+
# @return [Float] The total amount of the transcaction. Cannot excceed the invoice total.
|
11
|
+
define_attribute :amount, Float
|
12
|
+
|
13
|
+
# @!attribute collected_at
|
14
|
+
# @return [DateTime] Datetime that the external payment was collected. Defaults to current datetime.
|
15
|
+
define_attribute :collected_at, DateTime
|
16
|
+
|
17
|
+
# @!attribute description
|
18
|
+
# @return [String] Used as the transaction's description.
|
19
|
+
define_attribute :description, String
|
20
|
+
|
21
|
+
# @!attribute payment_method
|
22
|
+
# @return [String] Payment method used for the external transaction.
|
23
|
+
define_attribute :payment_method, String
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -14,6 +14,10 @@ module Recurly
|
|
14
14
|
# @return [Array[AddOnCreate]] Add Ons
|
15
15
|
define_attribute :add_ons, Array, { :item_type => :AddOnCreate }
|
16
16
|
|
17
|
+
# @!attribute allow_any_item_on_subscriptions
|
18
|
+
# @return [Boolean] Used to determine whether items can be assigned as add-ons to individual subscriptions. If `true`, items can be assigned as add-ons to individual subscription add-ons. If `false`, only plan add-ons can be used.
|
19
|
+
define_attribute :allow_any_item_on_subscriptions, :Boolean
|
20
|
+
|
17
21
|
# @!attribute auto_renew
|
18
22
|
# @return [Boolean] Subscriptions will automatically inherit this value once they are active. If `auto_renew` is `true`, then a subscription will automatically renew its term at renewal. If `auto_renew` is `false`, then a subscription will expire at the end of its term. `auto_renew` can be overridden on the subscription record itself.
|
19
23
|
define_attribute :auto_renew, :Boolean
|
@@ -74,6 +78,10 @@ module Recurly
|
|
74
78
|
# @return [Integer] Length of plan's trial period in `trial_units`. `0` means `no trial`.
|
75
79
|
define_attribute :trial_length, Integer
|
76
80
|
|
81
|
+
# @!attribute trial_requires_billing_info
|
82
|
+
# @return [Boolean] Allow free trial subscriptions to be created without billing info. Should not be used if billing info is needed for initial invoice due to existing uninvoiced charges or setup fee.
|
83
|
+
define_attribute :trial_requires_billing_info, :Boolean
|
84
|
+
|
77
85
|
# @!attribute trial_unit
|
78
86
|
# @return [String] Units for the plan's trial period.
|
79
87
|
define_attribute :trial_unit, String
|
@@ -14,6 +14,10 @@ module Recurly
|
|
14
14
|
# @return [Array[AddOnCreate]] Add Ons
|
15
15
|
define_attribute :add_ons, Array, { :item_type => :AddOnCreate }
|
16
16
|
|
17
|
+
# @!attribute allow_any_item_on_subscriptions
|
18
|
+
# @return [Boolean] Used to determine whether items can be assigned as add-ons to individual subscriptions. If `true`, items can be assigned as add-ons to individual subscription add-ons. If `false`, only plan add-ons can be used.
|
19
|
+
define_attribute :allow_any_item_on_subscriptions, :Boolean
|
20
|
+
|
17
21
|
# @!attribute auto_renew
|
18
22
|
# @return [Boolean] Subscriptions will automatically inherit this value once they are active. If `auto_renew` is `true`, then a subscription will automatically renew its term at renewal. If `auto_renew` is `false`, then a subscription will expire at the end of its term. `auto_renew` can be overridden on the subscription record itself.
|
19
23
|
define_attribute :auto_renew, :Boolean
|
@@ -70,6 +74,10 @@ module Recurly
|
|
70
74
|
# @return [Integer] Length of plan's trial period in `trial_units`. `0` means `no trial`.
|
71
75
|
define_attribute :trial_length, Integer
|
72
76
|
|
77
|
+
# @!attribute trial_requires_billing_info
|
78
|
+
# @return [Boolean] Allow free trial subscriptions to be created without billing info. Should not be used if billing info is needed for initial invoice due to existing uninvoiced charges or setup fee.
|
79
|
+
define_attribute :trial_requires_billing_info, :Boolean
|
80
|
+
|
73
81
|
# @!attribute trial_unit
|
74
82
|
# @return [String] Units for the plan's trial period.
|
75
83
|
define_attribute :trial_unit, String
|
@@ -0,0 +1,26 @@
|
|
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 ShippingMethodCreate < Request
|
8
|
+
|
9
|
+
# @!attribute accounting_code
|
10
|
+
# @return [String] Accounting code for shipping method.
|
11
|
+
define_attribute :accounting_code, String
|
12
|
+
|
13
|
+
# @!attribute code
|
14
|
+
# @return [String] The internal name used identify the shipping method.
|
15
|
+
define_attribute :code, String
|
16
|
+
|
17
|
+
# @!attribute name
|
18
|
+
# @return [String] The name of the shipping method displayed to customers.
|
19
|
+
define_attribute :name, String
|
20
|
+
|
21
|
+
# @!attribute tax_code
|
22
|
+
# @return [String] Used by Avalara, Vertex, and Recurly’s built-in tax feature. The tax code values are specific to each tax system. If you are using Recurly’s built-in taxes the values are: - `FR` – Common Carrier FOB Destination - `FR022000` – Common Carrier FOB Origin - `FR020400` – Non Common Carrier FOB Destination - `FR020500` – Non Common Carrier FOB Origin - `FR010100` – Delivery by Company Vehicle Before Passage of Title - `FR010200` – Delivery by Company Vehicle After Passage of Title - `NT` – Non-Taxable
|
23
|
+
define_attribute :tax_code, String
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
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 ShippingMethodUpdate < Request
|
8
|
+
|
9
|
+
# @!attribute accounting_code
|
10
|
+
# @return [String] Accounting code for shipping method.
|
11
|
+
define_attribute :accounting_code, String
|
12
|
+
|
13
|
+
# @!attribute code
|
14
|
+
# @return [String] The internal name used identify the shipping method.
|
15
|
+
define_attribute :code, String
|
16
|
+
|
17
|
+
# @!attribute name
|
18
|
+
# @return [String] The name of the shipping method displayed to customers.
|
19
|
+
define_attribute :name, String
|
20
|
+
|
21
|
+
# @!attribute tax_code
|
22
|
+
# @return [String] Used by Avalara, Vertex, and Recurly’s built-in tax feature. The tax code values are specific to each tax system. If you are using Recurly’s built-in taxes the values are: - `FR` – Common Carrier FOB Destination - `FR022000` – Common Carrier FOB Origin - `FR020400` – Non Common Carrier FOB Destination - `FR020500` – Non Common Carrier FOB Origin - `FR010100` – Delivery by Company Vehicle Before Passage of Title - `FR010200` – Delivery by Company Vehicle After Passage of Title - `NT` – Non-Taxable
|
23
|
+
define_attribute :tax_code, String
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|