recurly 3.18.1 → 4.3.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 +1 -1
- data/.changelog_config.yaml +11 -0
- data/.github/workflows/docs.yml +1 -1
- data/CHANGELOG.md +90 -348
- data/GETTING_STARTED.md +20 -17
- data/lib/recurly/client.rb +48 -21
- data/lib/recurly/client/operations.rb +691 -573
- data/lib/recurly/errors.rb +5 -22
- data/lib/recurly/errors/api_errors.rb +3 -0
- data/lib/recurly/errors/network_errors.rb +1 -4
- data/lib/recurly/pager.rb +4 -14
- data/lib/recurly/requests/{account_acquisition_updatable.rb → account_acquisition_update.rb} +1 -1
- data/lib/recurly/requests/account_create.rb +2 -2
- data/lib/recurly/requests/account_purchase.rb +2 -2
- data/lib/recurly/requests/add_on_create.rb +4 -4
- data/lib/recurly/requests/add_on_pricing.rb +5 -1
- data/lib/recurly/requests/add_on_update.rb +4 -4
- data/lib/recurly/requests/address.rb +0 -8
- data/lib/recurly/requests/billing_info_create.rb +6 -26
- data/lib/recurly/requests/billing_info_verify.rb +14 -0
- data/lib/recurly/requests/coupon_create.rb +1 -1
- data/lib/recurly/requests/external_transaction.rb +1 -1
- data/lib/recurly/requests/{invoice_updatable.rb → invoice_update.rb} +1 -1
- data/lib/recurly/requests/line_item_create.rb +1 -1
- data/lib/recurly/requests/subscription_add_on_create.rb +6 -2
- data/lib/recurly/requests/subscription_add_on_tier.rb +9 -1
- 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/subscription_create.rb +3 -3
- data/lib/recurly/requests/subscription_purchase.rb +1 -1
- data/lib/recurly/requests/tier.rb +7 -3
- data/lib/recurly/requests/tier_pricing.rb +22 -0
- data/lib/recurly/resources/add_on.rb +1 -1
- data/lib/recurly/resources/add_on_pricing.rb +5 -1
- data/lib/recurly/resources/address.rb +0 -8
- data/lib/recurly/resources/address_with_name.rb +46 -0
- data/lib/recurly/resources/billing_info.rb +5 -1
- data/lib/recurly/resources/coupon.rb +5 -17
- data/lib/recurly/resources/invoice.rb +6 -2
- data/lib/recurly/resources/line_item.rb +4 -0
- data/lib/recurly/resources/plan.rb +1 -1
- data/lib/recurly/resources/subscription_add_on.rb +6 -2
- data/lib/recurly/resources/subscription_add_on_tier.rb +9 -1
- data/lib/recurly/resources/subscription_change.rb +0 -4
- data/lib/recurly/resources/tax_detail.rb +26 -0
- data/lib/recurly/resources/tax_info.rb +4 -0
- data/lib/recurly/resources/tier.rb +7 -3
- data/lib/recurly/resources/tier_pricing.rb +22 -0
- data/lib/recurly/resources/transaction.rb +6 -2
- data/lib/recurly/resources/unique_coupon_code_params.rb +26 -0
- data/lib/recurly/resources/usage.rb +5 -1
- data/lib/recurly/version.rb +1 -1
- data/openapi/api.yaml +2114 -2012
- data/scripts/build +2 -2
- data/scripts/format +2 -2
- data/scripts/prepare-release +43 -29
- data/scripts/release +5 -20
- metadata +15 -13
- data/.github_changelog_generator +0 -8
- data/lib/recurly/resources/line_item_list.rb +0 -26
- data/lib/recurly/resources/subscription_change_preview.rb +0 -78
- data/scripts/bump +0 -11
- data/scripts/changelog +0 -14
data/lib/recurly/errors.rb
CHANGED
@@ -21,34 +21,17 @@ module Recurly
|
|
21
21
|
# Error class based on the response code. This may occur when a load balancer
|
22
22
|
# returns an error before it reaches Recurly's API.
|
23
23
|
# @param response [Net::Response]
|
24
|
-
# @return [Errors::APIError
|
25
|
-
# rubocop:disable Metrics/CyclomaticComplexity
|
24
|
+
# @return [Errors::APIError]
|
26
25
|
def self.from_response(response)
|
27
|
-
|
28
|
-
|
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
|
26
|
+
if Recurly::Errors::ERROR_MAP.has_key?(response.code)
|
27
|
+
Recurly::Errors.const_get(Recurly::Errors::ERROR_MAP[response.code])
|
44
28
|
else
|
45
29
|
Recurly::Errors::APIError
|
46
30
|
end
|
47
31
|
end
|
48
|
-
# rubocop:enable Metrics/CyclomaticComplexity
|
49
32
|
|
50
|
-
def initialize(response, error)
|
51
|
-
super(
|
33
|
+
def initialize(message, response = nil, error = nil)
|
34
|
+
super(message)
|
52
35
|
@response = response
|
53
36
|
@recurly_error = error
|
54
37
|
end
|
@@ -8,6 +8,7 @@ module Recurly
|
|
8
8
|
"500" => "InternalServerError",
|
9
9
|
"502" => "BadGatewayError",
|
10
10
|
"503" => "ServiceUnavailableError",
|
11
|
+
"504" => "TimeoutError",
|
11
12
|
"304" => "NotModifiedError",
|
12
13
|
"400" => "BadRequestError",
|
13
14
|
"401" => "UnauthorizedError",
|
@@ -32,6 +33,8 @@ module Recurly
|
|
32
33
|
|
33
34
|
class ServiceUnavailableError < ServerError; end
|
34
35
|
|
36
|
+
class TimeoutError < ServerError; end
|
37
|
+
|
35
38
|
class RedirectionError < ResponseError; end
|
36
39
|
|
37
40
|
class NotModifiedError < ResponseError; end
|
@@ -1,10 +1,7 @@
|
|
1
1
|
module Recurly
|
2
2
|
module Errors
|
3
|
-
class NetworkError <
|
4
|
-
class InvalidResponseError < NetworkError; end
|
5
|
-
class TimeoutError < NetworkError; end
|
3
|
+
class NetworkError < APIError; end
|
6
4
|
class ConnectionFailedError < NetworkError; end
|
7
5
|
class SSLError < NetworkError; end
|
8
|
-
class UnavailableError < NetworkError; end
|
9
6
|
end
|
10
7
|
end
|
data/lib/recurly/pager.rb
CHANGED
@@ -6,7 +6,7 @@ module Recurly
|
|
6
6
|
def initialize(client:, path:, options: {})
|
7
7
|
@client = client
|
8
8
|
@path = path
|
9
|
-
@options =
|
9
|
+
@options = options
|
10
10
|
rewind!
|
11
11
|
end
|
12
12
|
|
@@ -16,7 +16,7 @@ module Recurly
|
|
16
16
|
# Modify the @next url to set the :limit to 1
|
17
17
|
original_next = @next
|
18
18
|
@next = @path
|
19
|
-
fetch_next!(@options.merge(limit: 1))
|
19
|
+
fetch_next!(@options.merge(params: @options.fetch(:params, {}).merge({ limit: 1 })))
|
20
20
|
# Restore the @next url to the original
|
21
21
|
@next = original_next
|
22
22
|
@data.first
|
@@ -24,7 +24,7 @@ module Recurly
|
|
24
24
|
|
25
25
|
# Makes a HEAD request to the API to determine how many total records exist.
|
26
26
|
def count
|
27
|
-
resource = @client.send(:head, self.next,
|
27
|
+
resource = @client.send(:head, self.next, **@options)
|
28
28
|
resource.get_response.total_records
|
29
29
|
end
|
30
30
|
|
@@ -103,7 +103,7 @@ module Recurly
|
|
103
103
|
Enumerator.new do |yielder|
|
104
104
|
loop do
|
105
105
|
# Pass in @options when requesting the first page (@data.empty?)
|
106
|
-
next_options = @data.empty? ? @options : {}
|
106
|
+
next_options = @data.empty? ? @options : @options.merge(params: {})
|
107
107
|
fetch_next!(next_options)
|
108
108
|
yielder << data
|
109
109
|
unless has_more?
|
@@ -132,15 +132,5 @@ module Recurly
|
|
132
132
|
uri = URI(uri_or_path)
|
133
133
|
uri.kind_of?(URI::HTTP) ? uri.request_uri : uri_or_path
|
134
134
|
end
|
135
|
-
|
136
|
-
# Converts array parameters to CSV strings to maintain consistency with
|
137
|
-
# how the server expects the request to be formatted while providing the
|
138
|
-
# developer with an array type to maintain developer happiness!
|
139
|
-
def map_array_params(params)
|
140
|
-
@options = params.map do |key, param|
|
141
|
-
new_param = param.is_a?(Array) ? param.join(",") : param
|
142
|
-
[key, new_param]
|
143
|
-
end.to_h
|
144
|
-
end
|
145
135
|
end
|
146
136
|
end
|
data/lib/recurly/requests/{account_acquisition_updatable.rb → account_acquisition_update.rb}
RENAMED
@@ -4,7 +4,7 @@
|
|
4
4
|
# need and we will usher them to the appropriate places.
|
5
5
|
module Recurly
|
6
6
|
module Requests
|
7
|
-
class
|
7
|
+
class AccountAcquisitionUpdate < Request
|
8
8
|
|
9
9
|
# @!attribute campaign
|
10
10
|
# @return [String] An arbitrary identifier for the marketing campaign that led to the acquisition of this account.
|
@@ -7,8 +7,8 @@ module Recurly
|
|
7
7
|
class AccountCreate < Request
|
8
8
|
|
9
9
|
# @!attribute acquisition
|
10
|
-
# @return [
|
11
|
-
define_attribute :acquisition, :
|
10
|
+
# @return [AccountAcquisitionUpdate]
|
11
|
+
define_attribute :acquisition, :AccountAcquisitionUpdate
|
12
12
|
|
13
13
|
# @!attribute address
|
14
14
|
# @return [Address]
|
@@ -7,8 +7,8 @@ module Recurly
|
|
7
7
|
class AccountPurchase < Request
|
8
8
|
|
9
9
|
# @!attribute acquisition
|
10
|
-
# @return [
|
11
|
-
define_attribute :acquisition, :
|
10
|
+
# @return [AccountAcquisitionUpdate]
|
11
|
+
define_attribute :acquisition, :AccountAcquisitionUpdate
|
12
12
|
|
13
13
|
# @!attribute address
|
14
14
|
# @return [Address]
|
@@ -27,7 +27,7 @@ module Recurly
|
|
27
27
|
define_attribute :code, String
|
28
28
|
|
29
29
|
# @!attribute currencies
|
30
|
-
# @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.
|
30
|
+
# @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. * Must be absent if `add_on_type` is `usage` and `usage_type` is `percentage`.
|
31
31
|
define_attribute :currencies, Array, { :item_type => :AddOnPricing }
|
32
32
|
|
33
33
|
# @!attribute default_quantity
|
@@ -39,7 +39,7 @@ 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.
|
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.
|
43
43
|
define_attribute :item_code, String
|
44
44
|
|
45
45
|
# @!attribute item_id
|
@@ -79,11 +79,11 @@ module Recurly
|
|
79
79
|
define_attribute :tier_type, String
|
80
80
|
|
81
81
|
# @!attribute tiers
|
82
|
-
# @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
|
82
|
+
# @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`, or alternatively, `usage_percentage` for usage percentage type usage add ons. There must be one tier with an `ending_quantity` of 999999999 which is the default if not provided.
|
83
83
|
define_attribute :tiers, Array, { :item_type => :Tier }
|
84
84
|
|
85
85
|
# @!attribute usage_percentage
|
86
|
-
# @return [Float] The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is usage and `usage_type` is percentage. Must be omitted otherwise.
|
86
|
+
# @return [Float] The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is usage, `tier_type` is `flat` and `usage_type` is percentage. Must be omitted otherwise.
|
87
87
|
define_attribute :usage_percentage, Float
|
88
88
|
|
89
89
|
# @!attribute usage_type
|
@@ -11,8 +11,12 @@ module Recurly
|
|
11
11
|
define_attribute :currency, String
|
12
12
|
|
13
13
|
# @!attribute unit_amount
|
14
|
-
# @return [Float]
|
14
|
+
# @return [Float] Allows up to 2 decimal places. Required unless `unit_amount_decimal` is provided.
|
15
15
|
define_attribute :unit_amount, Float
|
16
|
+
|
17
|
+
# @!attribute unit_amount_decimal
|
18
|
+
# @return [String] Allows up to 9 decimal places. Only supported when `add_on_type` = `usage`. If `unit_amount_decimal` is provided, `unit_amount` cannot be provided.
|
19
|
+
define_attribute :unit_amount_decimal, String
|
16
20
|
end
|
17
21
|
end
|
18
22
|
end
|
@@ -23,7 +23,7 @@ module Recurly
|
|
23
23
|
define_attribute :code, String
|
24
24
|
|
25
25
|
# @!attribute currencies
|
26
|
-
# @return [Array[AddOnPricing]] If the add-on's `tier_type` is `tiered`, `volume
|
26
|
+
# @return [Array[AddOnPricing]] If the add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then currencies must be absent. Must also be absent if `add_on_type` is `usage` and `usage_type` is `percentage`.
|
27
27
|
define_attribute :currencies, Array, { :item_type => :AddOnPricing }
|
28
28
|
|
29
29
|
# @!attribute default_quantity
|
@@ -55,7 +55,7 @@ module Recurly
|
|
55
55
|
define_attribute :optional, :Boolean
|
56
56
|
|
57
57
|
# @!attribute revenue_schedule_type
|
58
|
-
# @return [String] When this add-on is invoiced, the line item will use this revenue schedule. If
|
58
|
+
# @return [String] When this add-on is invoiced, the line item will use this revenue schedule. If `item_code`/`item_id` is part of the request then `revenue_schedule_type` must be absent in the request as the value will be set from the item.
|
59
59
|
define_attribute :revenue_schedule_type, String
|
60
60
|
|
61
61
|
# @!attribute tax_code
|
@@ -63,11 +63,11 @@ module Recurly
|
|
63
63
|
define_attribute :tax_code, String
|
64
64
|
|
65
65
|
# @!attribute tiers
|
66
|
-
# @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
|
66
|
+
# @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`, or alternatively, `usage_percentage` for usage percentage type usage add ons. There must be one tier with an `ending_quantity` of 999999999 which is the default if not provided.
|
67
67
|
define_attribute :tiers, Array, { :item_type => :Tier }
|
68
68
|
|
69
69
|
# @!attribute usage_percentage
|
70
|
-
# @return [Float] The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is usage and `usage_type` is percentage. Must be omitted otherwise.
|
70
|
+
# @return [Float] The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is usage, `tier_type` is `flat` and `usage_type` is percentage. Must be omitted otherwise.
|
71
71
|
define_attribute :usage_percentage, Float
|
72
72
|
end
|
73
73
|
end
|
@@ -14,14 +14,6 @@ module Recurly
|
|
14
14
|
# @return [String] Country, 2-letter ISO code.
|
15
15
|
define_attribute :country, String
|
16
16
|
|
17
|
-
# @!attribute first_name
|
18
|
-
# @return [String] First name
|
19
|
-
define_attribute :first_name, String
|
20
|
-
|
21
|
-
# @!attribute last_name
|
22
|
-
# @return [String] Last name
|
23
|
-
define_attribute :last_name, String
|
24
|
-
|
25
17
|
# @!attribute phone
|
26
18
|
# @return [String] Phone number
|
27
19
|
define_attribute :phone, String
|
@@ -6,14 +6,6 @@ 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
|
-
|
17
9
|
# @!attribute address
|
18
10
|
# @return [Address]
|
19
11
|
define_attribute :address, :Address
|
@@ -22,6 +14,10 @@ module Recurly
|
|
22
14
|
# @return [String] Amazon billing agreement ID
|
23
15
|
define_attribute :amazon_billing_agreement_id, String
|
24
16
|
|
17
|
+
# @!attribute backup_payment_method
|
18
|
+
# @return [Boolean] The `backup_payment_method` field is used to designate a billing info as a backup on the account that will be tried if the initial billing info used for an invoice is declined. All payment methods, including the billing info marked `primary_payment_method` can be set as a backup. An account can have a maximum of 1 backup, if a user sets a different payment method as a backup, the existing backup will no longer be marked as such.
|
19
|
+
define_attribute :backup_payment_method, :Boolean
|
20
|
+
|
25
21
|
# @!attribute company
|
26
22
|
# @return [String] Company name
|
27
23
|
define_attribute :company, String
|
@@ -47,7 +43,7 @@ module Recurly
|
|
47
43
|
define_attribute :gateway_token, String
|
48
44
|
|
49
45
|
# @!attribute iban
|
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
|
46
|
+
# @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
|
51
47
|
define_attribute :iban, String
|
52
48
|
|
53
49
|
# @!attribute ip_address
|
@@ -62,10 +58,6 @@ module Recurly
|
|
62
58
|
# @return [String] Expiration month
|
63
59
|
define_attribute :month, String
|
64
60
|
|
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
|
-
|
69
61
|
# @!attribute number
|
70
62
|
# @return [String] Credit card number, spaces and dashes are accepted.
|
71
63
|
define_attribute :number, String
|
@@ -75,17 +67,9 @@ module Recurly
|
|
75
67
|
define_attribute :paypal_billing_agreement_id, String
|
76
68
|
|
77
69
|
# @!attribute primary_payment_method
|
78
|
-
# @return [Boolean] The `primary_payment_method`
|
70
|
+
# @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.
|
79
71
|
define_attribute :primary_payment_method, :Boolean
|
80
72
|
|
81
|
-
# @!attribute routing_number
|
82
|
-
# @return [String] The bank's rounting number. (ACH only)
|
83
|
-
define_attribute :routing_number, String
|
84
|
-
|
85
|
-
# @!attribute sort_code
|
86
|
-
# @return [String] Bank identifier code for UK based banks. Required for Bacs based billing infos. (Bacs only)
|
87
|
-
define_attribute :sort_code, String
|
88
|
-
|
89
73
|
# @!attribute tax_identifier
|
90
74
|
# @return [String] Tax identifier is required if adding a billing info that is a consumer card in Brazil. This would be the customer's CPF, CPF is a Brazilian tax identifier for all tax paying residents.
|
91
75
|
define_attribute :tax_identifier, String
|
@@ -106,10 +90,6 @@ module Recurly
|
|
106
90
|
# @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.
|
107
91
|
define_attribute :transaction_type, String
|
108
92
|
|
109
|
-
# @!attribute type
|
110
|
-
# @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)
|
111
|
-
define_attribute :type, String
|
112
|
-
|
113
93
|
# @!attribute vat_number
|
114
94
|
# @return [String] VAT number
|
115
95
|
define_attribute :vat_number, String
|
@@ -0,0 +1,14 @@
|
|
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 BillingInfoVerify < Request
|
8
|
+
|
9
|
+
# @!attribute gateway_code
|
10
|
+
# @return [String] An identifier for a specific payment gateway.
|
11
|
+
define_attribute :gateway_code, String
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -11,7 +11,7 @@ module Recurly
|
|
11
11
|
define_attribute :applies_to_all_items, :Boolean
|
12
12
|
|
13
13
|
# @!attribute applies_to_all_plans
|
14
|
-
# @return [Boolean] The coupon is valid for all plans if true. If false then `plans`
|
14
|
+
# @return [Boolean] The coupon is valid for all plans if true. If false then `plans` will list the applicable plans.
|
15
15
|
define_attribute :applies_to_all_plans, :Boolean
|
16
16
|
|
17
17
|
# @!attribute applies_to_non_plan_charges
|
@@ -19,7 +19,7 @@ module Recurly
|
|
19
19
|
define_attribute :description, String
|
20
20
|
|
21
21
|
# @!attribute payment_method
|
22
|
-
# @return [String] Payment method used for
|
22
|
+
# @return [String] Payment method used for external transaction.
|
23
23
|
define_attribute :payment_method, String
|
24
24
|
end
|
25
25
|
end
|
@@ -35,7 +35,7 @@ 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.
|
38
|
+
# @return [String] Unique code to identify an item. Available when the Credit Invoices and Subscription Billing Terms features are enabled.
|
39
39
|
define_attribute :item_code, String
|
40
40
|
|
41
41
|
# @!attribute item_id
|
@@ -7,7 +7,7 @@ module Recurly
|
|
7
7
|
class SubscriptionAddOnCreate < Request
|
8
8
|
|
9
9
|
# @!attribute add_on_source
|
10
|
-
# @return [String] Used to determine where the associated add-on data is pulled from. If this value is set to `plan_add_on` or left blank, then
|
10
|
+
# @return [String] Used to determine where the associated add-on data is pulled from. If this value is set to `plan_add_on` or left blank, then add-on data will be pulled from the plan's add-ons. If the associated `plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then the associated add-on data will be pulled from the site's item catalog.
|
11
11
|
define_attribute :add_on_source, String
|
12
12
|
|
13
13
|
# @!attribute code
|
@@ -27,9 +27,13 @@ module Recurly
|
|
27
27
|
define_attribute :tiers, Array, { :item_type => :SubscriptionAddOnTier }
|
28
28
|
|
29
29
|
# @!attribute unit_amount
|
30
|
-
# @return [Float]
|
30
|
+
# @return [Float] Allows up to 2 decimal places. Optionally, override the add-on's default unit amount. If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount` cannot be provided.
|
31
31
|
define_attribute :unit_amount, Float
|
32
32
|
|
33
|
+
# @!attribute unit_amount_decimal
|
34
|
+
# @return [String] Allows up to 9 decimal places. Optionally, override the add-on's default unit amount. If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount_decimal` cannot be provided. Only supported when the plan add-on's `add_on_type` = `usage`. If `unit_amount_decimal` is provided, `unit_amount` cannot be provided.
|
35
|
+
define_attribute :unit_amount_decimal, String
|
36
|
+
|
33
37
|
# @!attribute usage_percentage
|
34
38
|
# @return [Float] The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is usage and `usage_type` is percentage. Must be omitted otherwise. `usage_percentage` does not support tiers. See our [Guide](https://developers.recurly.com/guides/usage-based-billing-guide.html) for an overview of how to configure usage add-ons.
|
35
39
|
define_attribute :usage_percentage, Float
|
@@ -11,8 +11,16 @@ module Recurly
|
|
11
11
|
define_attribute :ending_quantity, Integer
|
12
12
|
|
13
13
|
# @!attribute unit_amount
|
14
|
-
# @return [Float]
|
14
|
+
# @return [Float] Allows up to 2 decimal places. Optionally, override the tiers' default unit amount. If add-on's `add_on_type` is `usage` and `usage_type` is `percentage`, cannot be provided.
|
15
15
|
define_attribute :unit_amount, Float
|
16
|
+
|
17
|
+
# @!attribute unit_amount_decimal
|
18
|
+
# @return [String] Allows up to 9 decimal places. Optionally, override tiers' default unit amount. If `unit_amount_decimal` is provided, `unit_amount` cannot be provided. If add-on's `add_on_type` is `usage` and `usage_type` is `percentage`, cannot be provided.
|
19
|
+
define_attribute :unit_amount_decimal, String
|
20
|
+
|
21
|
+
# @!attribute usage_percentage
|
22
|
+
# @return [String] The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places represented as a string. A value between 0.0 and 100.0. Optionally, override tiers' default usage percentage. Required if add-on's `add_on_type` is `usage` and `usage_type` is `percentage`. Must be omitted otherwise.
|
23
|
+
define_attribute :usage_percentage, String
|
16
24
|
end
|
17
25
|
end
|
18
26
|
end
|
@@ -7,7 +7,7 @@ module Recurly
|
|
7
7
|
class SubscriptionAddOnUpdate < Request
|
8
8
|
|
9
9
|
# @!attribute add_on_source
|
10
|
-
# @return [String] Used to determine where the associated add-on data is pulled from. If this value is set to `plan_add_on` or left blank, then
|
10
|
+
# @return [String] Used to determine where the associated add-on data is pulled from. If this value is set to `plan_add_on` or left blank, then add-on data will be pulled from the plan's add-ons. If the associated `plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then the associated add-on data will be pulled from the site's item catalog.
|
11
11
|
define_attribute :add_on_source, String
|
12
12
|
|
13
13
|
# @!attribute code
|
@@ -31,9 +31,13 @@ module Recurly
|
|
31
31
|
define_attribute :tiers, Array, { :item_type => :SubscriptionAddOnTier }
|
32
32
|
|
33
33
|
# @!attribute unit_amount
|
34
|
-
# @return [Float] Optionally, override the add-on's default unit amount.
|
34
|
+
# @return [Float] Allows up to 2 decimal places. Optionally, override the add-on's default unit amount. If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount` cannot be provided.
|
35
35
|
define_attribute :unit_amount, Float
|
36
36
|
|
37
|
+
# @!attribute unit_amount_decimal
|
38
|
+
# @return [String] Allows up to 9 decimal places. Optionally, override the add-on's default unit amount. If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount_decimal` cannot be provided. Only supported when the plan add-on's `add_on_type` = `usage`. If `unit_amount_decimal` is provided, `unit_amount` cannot be provided.
|
39
|
+
define_attribute :unit_amount_decimal, String
|
40
|
+
|
37
41
|
# @!attribute usage_percentage
|
38
42
|
# @return [Float] The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if add_on_type is usage and usage_type is percentage.
|
39
43
|
define_attribute :usage_percentage, Float
|