recurly 4.12.0 → 4.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.bumpversion.cfg +1 -1
- data/CHANGELOG.md +34 -0
- data/GETTING_STARTED.md +9 -1
- data/lib/recurly/client/operations.rb +209 -136
- data/lib/recurly/client.rb +14 -2
- data/lib/recurly/errors/api_errors.rb +2 -0
- data/lib/recurly/requests/account_create.rb +1 -1
- data/lib/recurly/requests/account_purchase.rb +1 -1
- data/lib/recurly/requests/account_update.rb +1 -1
- data/lib/recurly/requests/add_on_create.rb +5 -1
- data/lib/recurly/requests/add_on_update.rb +5 -1
- data/lib/recurly/requests/billing_info_create.rb +8 -0
- data/lib/recurly/requests/percentage_tier.rb +18 -0
- data/lib/recurly/requests/percentage_tiers_by_currency.rb +18 -0
- data/lib/recurly/requests/plan_create.rb +1 -1
- data/lib/recurly/requests/plan_update.rb +1 -1
- data/lib/recurly/requests/subscription_add_on_create.rb +5 -1
- data/lib/recurly/requests/subscription_add_on_percentage_tier.rb +18 -0
- data/lib/recurly/requests/subscription_add_on_tier.rb +1 -1
- data/lib/recurly/requests/subscription_update.rb +1 -1
- data/lib/recurly/requests/tier.rb +2 -2
- data/lib/recurly/resources/account.rb +4 -4
- data/lib/recurly/resources/account_mini.rb +1 -1
- data/lib/recurly/resources/add_on.rb +4 -0
- data/lib/recurly/resources/invoice.rb +5 -1
- data/lib/recurly/resources/invoice_template.rb +34 -0
- data/lib/recurly/resources/percentage_tier.rb +18 -0
- data/lib/recurly/resources/{account_invoice_template.rb → percentage_tiers_by_currency.rb} +7 -7
- data/lib/recurly/resources/plan.rb +1 -1
- data/lib/recurly/resources/subscription_add_on.rb +5 -1
- data/lib/recurly/resources/subscription_add_on_percentage_tier.rb +18 -0
- data/lib/recurly/resources/subscription_add_on_tier.rb +1 -1
- data/lib/recurly/resources/tier.rb +2 -2
- data/lib/recurly/resources/usage.rb +5 -1
- data/lib/recurly/version.rb +1 -1
- data/openapi/api.yaml +552 -71
- metadata +10 -4
data/lib/recurly/client.rb
CHANGED
@@ -11,7 +11,11 @@ module Recurly
|
|
11
11
|
class Client
|
12
12
|
require_relative "./client/operations"
|
13
13
|
|
14
|
-
|
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,13 +56,18 @@ 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"
|
55
60
|
# @param base_url [String] The base URL for the API. Defaults to "https://v3.recurly.com"
|
56
61
|
# @param ca_file [String] The CA bundle to use when connecting to the API. Defaults to "data/ca-certificates.crt"
|
57
62
|
# @param api_key [String] The private API key
|
58
63
|
# @param logger [Logger] A logger to use. Defaults to creating a new STDOUT logger with level WARN.
|
59
|
-
def initialize(base_url:
|
64
|
+
def initialize(region: REGION, base_url: API_HOSTS[:us], ca_file: CA_FILE, api_key:, logger: nil)
|
60
65
|
raise ArgumentError, "'api_key' must be set to a non-nil value" if api_key.nil?
|
61
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
|
+
|
62
71
|
set_api_key(api_key)
|
63
72
|
set_connection_options(base_url, ca_file)
|
64
73
|
|
@@ -110,7 +119,9 @@ module Recurly
|
|
110
119
|
|
111
120
|
def get(path, **options)
|
112
121
|
validate_options!(**options)
|
122
|
+
|
113
123
|
request = Net::HTTP::Get.new build_url(path, options)
|
124
|
+
|
114
125
|
set_headers(request, options[:headers])
|
115
126
|
http_response = run_request(request, options)
|
116
127
|
handle_response! request, http_response
|
@@ -168,6 +179,7 @@ module Recurly
|
|
168
179
|
|
169
180
|
begin
|
170
181
|
http.start unless http.started?
|
182
|
+
|
171
183
|
log_attrs = {
|
172
184
|
method: request.method,
|
173
185
|
path: request.path,
|
@@ -39,7 +39,7 @@ module Recurly
|
|
39
39
|
define_attribute :custom_fields, Array, { :item_type => :CustomField }
|
40
40
|
|
41
41
|
# @!attribute dunning_campaign_id
|
42
|
-
# @return [String] Unique ID to identify a dunning campaign.
|
42
|
+
# @return [String] Unique ID to identify a dunning campaign. 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
43
|
define_attribute :dunning_campaign_id, String
|
44
44
|
|
45
45
|
# @!attribute email
|
@@ -39,7 +39,7 @@ module Recurly
|
|
39
39
|
define_attribute :custom_fields, Array, { :item_type => :CustomField }
|
40
40
|
|
41
41
|
# @!attribute dunning_campaign_id
|
42
|
-
# @return [String] Unique ID to identify a dunning campaign.
|
42
|
+
# @return [String] Unique ID to identify a dunning campaign. 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
43
|
define_attribute :dunning_campaign_id, String
|
44
44
|
|
45
45
|
# @!attribute email
|
@@ -31,7 +31,7 @@ module Recurly
|
|
31
31
|
define_attribute :custom_fields, Array, { :item_type => :CustomField }
|
32
32
|
|
33
33
|
# @!attribute dunning_campaign_id
|
34
|
-
# @return [String] Unique ID to identify a dunning campaign.
|
34
|
+
# @return [String] Unique ID to identify a dunning campaign. 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
35
|
define_attribute :dunning_campaign_id, String
|
36
36
|
|
37
37
|
# @!attribute email
|
@@ -62,6 +62,10 @@ module Recurly
|
|
62
62
|
# @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.
|
63
63
|
define_attribute :optional, :Boolean
|
64
64
|
|
65
|
+
# @!attribute percentage_tiers
|
66
|
+
# @return [Array[PercentageTiersByCurrency]] Array of objects which must have at least one set of tiers per currency and the currency code. The tier_type must be `volume` or `tiered`, if not, it must be absent. There must be one tier without ending_amount value.
|
67
|
+
define_attribute :percentage_tiers, Array, { :item_type => :PercentageTiersByCurrency }
|
68
|
+
|
65
69
|
# @!attribute plan_id
|
66
70
|
# @return [String] Plan ID
|
67
71
|
define_attribute :plan_id, String
|
@@ -79,7 +83,7 @@ module Recurly
|
|
79
83
|
define_attribute :tier_type, String
|
80
84
|
|
81
85
|
# @!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
|
86
|
+
# @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.
|
83
87
|
define_attribute :tiers, Array, { :item_type => :Tier }
|
84
88
|
|
85
89
|
# @!attribute usage_percentage
|
@@ -54,6 +54,10 @@ module Recurly
|
|
54
54
|
# @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.
|
55
55
|
define_attribute :optional, :Boolean
|
56
56
|
|
57
|
+
# @!attribute percentage_tiers
|
58
|
+
# @return [Array[PercentageTiersByCurrency]] `percentage_tiers` is an array of objects, which must have the set of tiers per currency and the currency code. The tier_type must be `volume` or `tiered`, if not, it must be absent.
|
59
|
+
define_attribute :percentage_tiers, Array, { :item_type => :PercentageTiersByCurrency }
|
60
|
+
|
57
61
|
# @!attribute revenue_schedule_type
|
58
62
|
# @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
63
|
define_attribute :revenue_schedule_type, String
|
@@ -63,7 +67,7 @@ module Recurly
|
|
63
67
|
define_attribute :tax_code, String
|
64
68
|
|
65
69
|
# @!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
|
70
|
+
# @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 without an `ending_quantity` value that represents the final tier.
|
67
71
|
define_attribute :tiers, Array, { :item_type => :Tier }
|
68
72
|
|
69
73
|
# @!attribute usage_percentage
|
@@ -34,6 +34,10 @@ module Recurly
|
|
34
34
|
# @return [String] *STRONGLY RECOMMENDED*
|
35
35
|
define_attribute :cvv, String
|
36
36
|
|
37
|
+
# @!attribute external_hpp_type
|
38
|
+
# @return [String] Use for Adyen HPP billing info.
|
39
|
+
define_attribute :external_hpp_type, String
|
40
|
+
|
37
41
|
# @!attribute first_name
|
38
42
|
# @return [String] First name
|
39
43
|
define_attribute :first_name, String
|
@@ -74,6 +78,10 @@ module Recurly
|
|
74
78
|
# @return [String] Credit card number, spaces and dashes are accepted.
|
75
79
|
define_attribute :number, String
|
76
80
|
|
81
|
+
# @!attribute online_banking_payment_type
|
82
|
+
# @return [String] Use for Online Banking billing info.
|
83
|
+
define_attribute :online_banking_payment_type, String
|
84
|
+
|
77
85
|
# @!attribute paypal_billing_agreement_id
|
78
86
|
# @return [String] PayPal billing agreement ID
|
79
87
|
define_attribute :paypal_billing_agreement_id, 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 PercentageTier < Request
|
8
|
+
|
9
|
+
# @!attribute ending_amount
|
10
|
+
# @return [Float] Ending amount for the tier. Allows up to 2 decimal places. The last tier ending_amount is null.
|
11
|
+
define_attribute :ending_amount, Float
|
12
|
+
|
13
|
+
# @!attribute usage_percentage
|
14
|
+
# @return [String] Decimal usage percentage.
|
15
|
+
define_attribute :usage_percentage, String
|
16
|
+
end
|
17
|
+
end
|
18
|
+
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 Requests
|
7
|
+
class PercentageTiersByCurrency < Request
|
8
|
+
|
9
|
+
# @!attribute currency
|
10
|
+
# @return [String] 3-letter ISO 4217 currency code.
|
11
|
+
define_attribute :currency, String
|
12
|
+
|
13
|
+
# @!attribute tiers
|
14
|
+
# @return [Array[PercentageTier]] Tiers
|
15
|
+
define_attribute :tiers, Array, { :item_type => :PercentageTier }
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -43,7 +43,7 @@ module Recurly
|
|
43
43
|
define_attribute :description, String
|
44
44
|
|
45
45
|
# @!attribute dunning_campaign_id
|
46
|
-
# @return [String] Unique ID to identify a dunning campaign.
|
46
|
+
# @return [String] Unique ID to identify a dunning campaign. 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
47
|
define_attribute :dunning_campaign_id, String
|
48
48
|
|
49
49
|
# @!attribute hosted_pages
|
@@ -39,7 +39,7 @@ module Recurly
|
|
39
39
|
define_attribute :description, String
|
40
40
|
|
41
41
|
# @!attribute dunning_campaign_id
|
42
|
-
# @return [String] Unique ID to identify a dunning campaign.
|
42
|
+
# @return [String] Unique ID to identify a dunning campaign. 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
43
|
define_attribute :dunning_campaign_id, String
|
44
44
|
|
45
45
|
# @!attribute hosted_pages
|
@@ -14,6 +14,10 @@ module Recurly
|
|
14
14
|
# @return [String] If `add_on_source` is set to `plan_add_on` or left blank, then plan's add-on `code` should be used. If `add_on_source` is set to `item`, then the `code` from the associated item should be used.
|
15
15
|
define_attribute :code, String
|
16
16
|
|
17
|
+
# @!attribute percentage_tiers
|
18
|
+
# @return [Array[SubscriptionAddOnPercentageTier]] If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be removed and replaced by the percentage tiers in the request. There must be one tier without ending_amount value. Use only if add_on.tier_type is tiered or volume and add_on.usage_type is percentage.
|
19
|
+
define_attribute :percentage_tiers, Array, { :item_type => :SubscriptionAddOnPercentageTier }
|
20
|
+
|
17
21
|
# @!attribute quantity
|
18
22
|
# @return [Integer] Quantity
|
19
23
|
define_attribute :quantity, Integer
|
@@ -23,7 +27,7 @@ module Recurly
|
|
23
27
|
define_attribute :revenue_schedule_type, String
|
24
28
|
|
25
29
|
# @!attribute tiers
|
26
|
-
# @return [Array[SubscriptionAddOnTier]] If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object must include one to many tiers with `ending_quantity` and `unit_amount`. There must be one tier
|
30
|
+
# @return [Array[SubscriptionAddOnTier]] If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object must include one to many tiers with `ending_quantity` and `unit_amount`. There must be one tier without ending_quantity value. See our [Guide](https://developers.recurly.com/guides/item-addon-guide.html) for an overview of how to configure quantity-based pricing models.
|
27
31
|
define_attribute :tiers, Array, { :item_type => :SubscriptionAddOnTier }
|
28
32
|
|
29
33
|
# @!attribute unit_amount
|
@@ -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 SubscriptionAddOnPercentageTier < Request
|
8
|
+
|
9
|
+
# @!attribute ending_amount
|
10
|
+
# @return [Float] Ending amount
|
11
|
+
define_attribute :ending_amount, Float
|
12
|
+
|
13
|
+
# @!attribute usage_percentage
|
14
|
+
# @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.
|
15
|
+
define_attribute :usage_percentage, String
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -19,7 +19,7 @@ module Recurly
|
|
19
19
|
define_attribute :unit_amount_decimal, String
|
20
20
|
|
21
21
|
# @!attribute usage_percentage
|
22
|
-
# @return [String]
|
22
|
+
# @return [String] (deprecated) -- Use the percentage_tiers object instead.
|
23
23
|
define_attribute :usage_percentage, String
|
24
24
|
end
|
25
25
|
end
|
@@ -59,7 +59,7 @@ module Recurly
|
|
59
59
|
define_attribute :shipping, :SubscriptionShippingUpdate
|
60
60
|
|
61
61
|
# @!attribute tax_inclusive
|
62
|
-
# @return [Boolean]
|
62
|
+
# @return [Boolean] This field is deprecated. Do not use it anymore to update a subscription's tax inclusivity. Use the POST subscription change route instead.
|
63
63
|
define_attribute :tax_inclusive, :Boolean
|
64
64
|
|
65
65
|
# @!attribute terms_and_conditions
|
@@ -11,11 +11,11 @@ module Recurly
|
|
11
11
|
define_attribute :currencies, Array, { :item_type => :TierPricing }
|
12
12
|
|
13
13
|
# @!attribute ending_quantity
|
14
|
-
# @return [Integer] Ending quantity for the tier. This represents a unit amount for unit-priced add ons
|
14
|
+
# @return [Integer] Ending quantity for the tier. This represents a unit amount for unit-priced add ons.
|
15
15
|
define_attribute :ending_quantity, Integer
|
16
16
|
|
17
17
|
# @!attribute usage_percentage
|
18
|
-
# @return [String]
|
18
|
+
# @return [String] (deprecated) -- Use the percentage_tiers object instead.
|
19
19
|
define_attribute :usage_percentage, String
|
20
20
|
end
|
21
21
|
end
|
@@ -43,7 +43,7 @@ module Recurly
|
|
43
43
|
define_attribute :deleted_at, DateTime
|
44
44
|
|
45
45
|
# @!attribute dunning_campaign_id
|
46
|
-
# @return [String] Unique ID to identify a dunning campaign.
|
46
|
+
# @return [String] Unique ID to identify a dunning campaign. 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
47
|
define_attribute :dunning_campaign_id, String
|
48
48
|
|
49
49
|
# @!attribute email
|
@@ -90,9 +90,9 @@ module Recurly
|
|
90
90
|
# @return [String]
|
91
91
|
define_attribute :id, String
|
92
92
|
|
93
|
-
# @!attribute
|
94
|
-
# @return [
|
95
|
-
define_attribute :
|
93
|
+
# @!attribute invoice_template_id
|
94
|
+
# @return [String] Unique ID to identify an invoice template. Available when the Invoice Customization feature is enabled. Used to specify if a non-default invoice template will be used to generate invoices for the account. For sites without multiple invoice templates enabled, the default template will always be used.
|
95
|
+
define_attribute :invoice_template_id, String
|
96
96
|
|
97
97
|
# @!attribute last_name
|
98
98
|
# @return [String]
|
@@ -19,7 +19,7 @@ module Recurly
|
|
19
19
|
define_attribute :company, String
|
20
20
|
|
21
21
|
# @!attribute dunning_campaign_id
|
22
|
-
# @return [String] Unique ID to identify a dunning campaign.
|
22
|
+
# @return [String] Unique ID to identify a dunning campaign. 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
23
|
define_attribute :dunning_campaign_id, String
|
24
24
|
|
25
25
|
# @!attribute email
|
@@ -74,6 +74,10 @@ module Recurly
|
|
74
74
|
# @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.
|
75
75
|
define_attribute :optional, :Boolean
|
76
76
|
|
77
|
+
# @!attribute percentage_tiers
|
78
|
+
# @return [Array[PercentageTiersByCurrency]] Percentage Tiers
|
79
|
+
define_attribute :percentage_tiers, Array, { :item_type => :PercentageTiersByCurrency }
|
80
|
+
|
77
81
|
# @!attribute plan_id
|
78
82
|
# @return [String] Plan ID
|
79
83
|
define_attribute :plan_id, String
|
@@ -55,7 +55,7 @@ module Recurly
|
|
55
55
|
define_attribute :due_at, DateTime
|
56
56
|
|
57
57
|
# @!attribute dunning_campaign_id
|
58
|
-
# @return [String] Unique ID to identify the dunning campaign used when dunning the invoice.
|
58
|
+
# @return [String] Unique ID to identify the dunning campaign used when dunning the invoice. For sites without multiple dunning campaigns enabled, this will always be the default dunning campaign.
|
59
59
|
define_attribute :dunning_campaign_id, String
|
60
60
|
|
61
61
|
# @!attribute has_more_line_items
|
@@ -146,6 +146,10 @@ module Recurly
|
|
146
146
|
# @return [DateTime] Last updated at
|
147
147
|
define_attribute :updated_at, DateTime
|
148
148
|
|
149
|
+
# @!attribute uuid
|
150
|
+
# @return [String] Invoice UUID
|
151
|
+
define_attribute :uuid, String
|
152
|
+
|
149
153
|
# @!attribute vat_number
|
150
154
|
# @return [String] VAT registration number for the customer on this invoice. This will come from the VAT Number field in the Billing Info or the Account Info depending on your tax settings and the invoice collection method.
|
151
155
|
define_attribute :vat_number, String
|
@@ -0,0 +1,34 @@
|
|
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 InvoiceTemplate < Resource
|
8
|
+
|
9
|
+
# @!attribute code
|
10
|
+
# @return [String] Invoice template code.
|
11
|
+
define_attribute :code, String
|
12
|
+
|
13
|
+
# @!attribute created_at
|
14
|
+
# @return [DateTime] When the invoice template was created in Recurly.
|
15
|
+
define_attribute :created_at, DateTime
|
16
|
+
|
17
|
+
# @!attribute description
|
18
|
+
# @return [String] Invoice template description.
|
19
|
+
define_attribute :description, String
|
20
|
+
|
21
|
+
# @!attribute id
|
22
|
+
# @return [String]
|
23
|
+
define_attribute :id, String
|
24
|
+
|
25
|
+
# @!attribute name
|
26
|
+
# @return [String] Invoice template name.
|
27
|
+
define_attribute :name, String
|
28
|
+
|
29
|
+
# @!attribute updated_at
|
30
|
+
# @return [DateTime] When the invoice template was updated in Recurly.
|
31
|
+
define_attribute :updated_at, DateTime
|
32
|
+
end
|
33
|
+
end
|
34
|
+
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 PercentageTier < Resource
|
8
|
+
|
9
|
+
# @!attribute ending_amount
|
10
|
+
# @return [Float] Ending amount for the tier. Allows up to 2 decimal places. The last tier ending_amount is null.
|
11
|
+
define_attribute :ending_amount, Float
|
12
|
+
|
13
|
+
# @!attribute usage_percentage
|
14
|
+
# @return [String] Decimal usage percentage.
|
15
|
+
define_attribute :usage_percentage, String
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -4,15 +4,15 @@
|
|
4
4
|
# need and we will usher them to the appropriate places.
|
5
5
|
module Recurly
|
6
6
|
module Resources
|
7
|
-
class
|
7
|
+
class PercentageTiersByCurrency < Resource
|
8
8
|
|
9
|
-
# @!attribute
|
10
|
-
# @return [String]
|
11
|
-
define_attribute :
|
9
|
+
# @!attribute currency
|
10
|
+
# @return [String] 3-letter ISO 4217 currency code.
|
11
|
+
define_attribute :currency, String
|
12
12
|
|
13
|
-
# @!attribute
|
14
|
-
# @return [
|
15
|
-
define_attribute :
|
13
|
+
# @!attribute tiers
|
14
|
+
# @return [Array[PercentageTier]] Tiers
|
15
|
+
define_attribute :tiers, Array, { :item_type => :PercentageTier }
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -47,7 +47,7 @@ module Recurly
|
|
47
47
|
define_attribute :description, String
|
48
48
|
|
49
49
|
# @!attribute dunning_campaign_id
|
50
|
-
# @return [String] Unique ID to identify a dunning campaign.
|
50
|
+
# @return [String] Unique ID to identify a dunning campaign. 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.
|
51
51
|
define_attribute :dunning_campaign_id, String
|
52
52
|
|
53
53
|
# @!attribute hosted_pages
|
@@ -30,6 +30,10 @@ module Recurly
|
|
30
30
|
# @return [String] Object type
|
31
31
|
define_attribute :object, String
|
32
32
|
|
33
|
+
# @!attribute percentage_tiers
|
34
|
+
# @return [Array[SubscriptionAddOnPercentageTier]] If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be removed and replaced by the percentage tiers in the request. Use only if add_on.tier_type is tiered or volume and add_on.usage_type is percentage
|
35
|
+
define_attribute :percentage_tiers, Array, { :item_type => :SubscriptionAddOnPercentageTier }
|
36
|
+
|
33
37
|
# @!attribute quantity
|
34
38
|
# @return [Integer] Add-on quantity
|
35
39
|
define_attribute :quantity, Integer
|
@@ -47,7 +51,7 @@ module Recurly
|
|
47
51
|
define_attribute :tier_type, String
|
48
52
|
|
49
53
|
# @!attribute tiers
|
50
|
-
# @return [Array[SubscriptionAddOnTier]] If tiers are provided in the request, all existing tiers on the Subscription Add-on will be removed and replaced by the tiers in the request.
|
54
|
+
# @return [Array[SubscriptionAddOnTier]] If tiers are provided in the request, all existing tiers on the Subscription Add-on will be removed and replaced by the tiers in the request. If add_on.tier_type is tiered or volume and add_on.usage_type is percentage use percentage_tiers instead.
|
51
55
|
define_attribute :tiers, Array, { :item_type => :SubscriptionAddOnTier }
|
52
56
|
|
53
57
|
# @!attribute unit_amount
|
@@ -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 SubscriptionAddOnPercentageTier < Resource
|
8
|
+
|
9
|
+
# @!attribute ending_amount
|
10
|
+
# @return [Float] Ending amount
|
11
|
+
define_attribute :ending_amount, Float
|
12
|
+
|
13
|
+
# @!attribute usage_percentage
|
14
|
+
# @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.
|
15
|
+
define_attribute :usage_percentage, String
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -19,7 +19,7 @@ module Recurly
|
|
19
19
|
define_attribute :unit_amount_decimal, String
|
20
20
|
|
21
21
|
# @!attribute usage_percentage
|
22
|
-
# @return [String]
|
22
|
+
# @return [String] (deprecated) -- Use the percentage_tiers object instead.
|
23
23
|
define_attribute :usage_percentage, String
|
24
24
|
end
|
25
25
|
end
|
@@ -11,11 +11,11 @@ module Recurly
|
|
11
11
|
define_attribute :currencies, Array, { :item_type => :TierPricing }
|
12
12
|
|
13
13
|
# @!attribute ending_quantity
|
14
|
-
# @return [Integer] Ending quantity for the tier. This represents a unit amount for unit-priced add ons
|
14
|
+
# @return [Integer] Ending quantity for the tier. This represents a unit amount for unit-priced add ons.
|
15
15
|
define_attribute :ending_quantity, Integer
|
16
16
|
|
17
17
|
# @!attribute usage_percentage
|
18
|
-
# @return [String]
|
18
|
+
# @return [String] (deprecated) -- Use the percentage_tiers object instead.
|
19
19
|
define_attribute :usage_percentage, String
|
20
20
|
end
|
21
21
|
end
|
@@ -34,6 +34,10 @@ module Recurly
|
|
34
34
|
# @return [String] Object type
|
35
35
|
define_attribute :object, String
|
36
36
|
|
37
|
+
# @!attribute percentage_tiers
|
38
|
+
# @return [Array[SubscriptionAddOnPercentageTier]] The percentage tiers of the subscription based on the usage_timestamp. If tier_type = flat, percentage_tiers = []
|
39
|
+
define_attribute :percentage_tiers, Array, { :item_type => :SubscriptionAddOnPercentageTier }
|
40
|
+
|
37
41
|
# @!attribute recording_timestamp
|
38
42
|
# @return [DateTime] When the usage was recorded in your system.
|
39
43
|
define_attribute :recording_timestamp, DateTime
|
@@ -43,7 +47,7 @@ module Recurly
|
|
43
47
|
define_attribute :tier_type, String
|
44
48
|
|
45
49
|
# @!attribute tiers
|
46
|
-
# @return [Array[SubscriptionAddOnTier]] The tiers and prices of the subscription based on the usage_timestamp. If tier_type = flat, tiers =
|
50
|
+
# @return [Array[SubscriptionAddOnTier]] The tiers and prices of the subscription based on the usage_timestamp. If tier_type = flat, tiers = []
|
47
51
|
define_attribute :tiers, Array, { :item_type => :SubscriptionAddOnTier }
|
48
52
|
|
49
53
|
# @!attribute unit_amount
|
data/lib/recurly/version.rb
CHANGED