recurly 4.14.0 → 4.18.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/.github/workflows/ci.yml +29 -0
- data/CHANGELOG.md +44 -0
- data/GETTING_STARTED.md +1 -1
- data/lib/recurly/client/operations.rb +11 -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 +9 -1
- data/lib/recurly/requests/add_on_pricing.rb +1 -1
- data/lib/recurly/requests/add_on_update.rb +5 -1
- data/lib/recurly/requests/billing_info_create.rb +2 -2
- 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_pricing.rb +1 -1
- data/lib/recurly/requests/pricing.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 +2 -2
- data/lib/recurly/requests/subscription_add_on_update.rb +5 -1
- data/lib/recurly/requests/subscription_change_create.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 +1 -1
- data/lib/recurly/resources/account_balance_amount.rb +4 -0
- data/lib/recurly/resources/add_on.rb +4 -0
- data/lib/recurly/resources/add_on_pricing.rb +1 -1
- data/lib/recurly/resources/percentage_tier.rb +2 -2
- data/lib/recurly/resources/plan_pricing.rb +1 -1
- data/lib/recurly/resources/pricing.rb +1 -1
- data/lib/recurly/resources/subscription.rb +4 -0
- data/lib/recurly/resources/subscription_add_on.rb +6 -2
- data/lib/recurly/resources/subscription_add_on_percentage_tier.rb +2 -2
- data/lib/recurly/resources/subscription_add_on_tier.rb +2 -2
- data/lib/recurly/resources/subscription_change.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 +240 -53
- metadata +7 -4
- data/.travis.yml +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6350d81107627313accb7813754e37e2e8c85156d1c0ae8d5d3c479c649347c
|
4
|
+
data.tar.gz: b7d579a7443eba62a85622ff0093ac611fee38cc9740e41755100a0d694e2cb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d73edf3e7bc58f744c6efc71a659c256453f1c46b3d0ae3c74c3784b5ecf7a720b74d438a81f66f15cc145aba13dfaf6f3c24bdd2f42f8980182e3aa607b6ba
|
7
|
+
data.tar.gz: eeadb1726e33c8f011f2ab72eb1784881550bc39426ae299c139b788ed9031e12050e0b947bfa7db44623728475025f185e58f7700dbcbc2dfcb2342f92aad5c
|
data/.bumpversion.cfg
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
name: CI
|
2
|
+
on: [push]
|
3
|
+
concurrency:
|
4
|
+
group: ${{ github.ref }}
|
5
|
+
cancel-in-progress: true
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
name: Ruby ${{ matrix.ruby }} tests
|
10
|
+
strategy:
|
11
|
+
matrix:
|
12
|
+
ruby: [2.4, 2.5, 2.6, 2.7, 3.0]
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v3
|
15
|
+
- name: Setup ruby
|
16
|
+
uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: ${{ matrix.ruby }}
|
19
|
+
- run: ./scripts/build
|
20
|
+
- run: ./scripts/test
|
21
|
+
buildall:
|
22
|
+
if: ${{ always() }}
|
23
|
+
runs-on: ubuntu-latest
|
24
|
+
name: Build (matrix)
|
25
|
+
needs: build
|
26
|
+
steps:
|
27
|
+
- name: Check build matrix status
|
28
|
+
if: ${{ needs.build.result != 'success' }}
|
29
|
+
run: exit 1
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,49 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [4.18.0](https://github.com/recurly/recurly-client-ruby/tree/4.18.0) (2022-06-16)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.17.0...4.18.0)
|
6
|
+
|
7
|
+
|
8
|
+
**Merged Pull Requests**
|
9
|
+
|
10
|
+
- Generated Latest Changes for v2021-02-25 [#776](https://github.com/recurly/recurly-client-ruby/pull/776) ([recurly-integrations](https://github.com/recurly-integrations))
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
## [4.17.0](https://github.com/recurly/recurly-client-ruby/tree/4.17.0) (2022-04-15)
|
15
|
+
|
16
|
+
[Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.16.0...4.17.0)
|
17
|
+
|
18
|
+
|
19
|
+
**Merged Pull Requests**
|
20
|
+
|
21
|
+
- Generated Latest Changes for v2021-02-25 [#766](https://github.com/recurly/recurly-client-ruby/pull/766) ([recurly-integrations](https://github.com/recurly-integrations))
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
## [4.16.0](https://github.com/recurly/recurly-client-ruby/tree/4.16.0) (2022-03-24)
|
26
|
+
|
27
|
+
[Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.15.0...4.16.0)
|
28
|
+
|
29
|
+
|
30
|
+
**Merged Pull Requests**
|
31
|
+
|
32
|
+
- Generated Latest Changes for v2021-02-25 (Percentage tiers feature) [#762](https://github.com/recurly/recurly-client-ruby/pull/762) ([recurly-integrations](https://github.com/recurly-integrations))
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
## [4.15.0](https://github.com/recurly/recurly-client-ruby/tree/4.15.0) (2022-03-14)
|
37
|
+
|
38
|
+
[Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.14.0...4.15.0)
|
39
|
+
|
40
|
+
|
41
|
+
**Merged Pull Requests**
|
42
|
+
|
43
|
+
- Generated Latest Changes for v2021-02-25 (Percentage tiers feature) [#757](https://github.com/recurly/recurly-client-ruby/pull/757) ([recurly-integrations](https://github.com/recurly-integrations))
|
44
|
+
|
45
|
+
|
46
|
+
|
3
47
|
## [4.14.0](https://github.com/recurly/recurly-client-ruby/tree/4.14.0) (2022-03-03)
|
4
48
|
|
5
49
|
[Full Changelog](https://github.com/recurly/recurly-client-ruby/compare/4.13.0...4.14.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.
|
8
|
+
gem 'recurly', '~> 4.18'
|
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.
|
@@ -3351,6 +3351,17 @@ module Recurly
|
|
3351
3351
|
# @param params [Hash] Optional query string parameters:
|
3352
3352
|
#
|
3353
3353
|
# @return [Resources::InvoiceCollection] A preview of the subscription's renewal invoice(s).
|
3354
|
+
# @example
|
3355
|
+
# begin
|
3356
|
+
# invoice_collection = @client.get_preview_renewal(
|
3357
|
+
# subscription_id: subscription_id
|
3358
|
+
# )
|
3359
|
+
# puts "Fetched Renewal Preview with total: #{invoice_collection.charge_invoice.total}"
|
3360
|
+
# rescue Recurly::Errors::NotFoundError
|
3361
|
+
# # If the resource was not found, you may want to alert the user or
|
3362
|
+
# # just return nil
|
3363
|
+
# puts "Resource Not Found"
|
3364
|
+
# end
|
3354
3365
|
#
|
3355
3366
|
def get_preview_renewal(subscription_id:, **options)
|
3356
3367
|
path = interpolate_path("/subscriptions/{subscription_id}/preview_renewal", subscription_id: subscription_id)
|
@@ -55,7 +55,7 @@ module Recurly
|
|
55
55
|
define_attribute :first_name, String
|
56
56
|
|
57
57
|
# @!attribute invoice_template_id
|
58
|
-
# @return [String] Unique ID to identify an invoice template. Available when the
|
58
|
+
# @return [String] Unique ID to identify an invoice template. Available when the site is on a Pro or Enterprise plan. Used to specify which invoice template, if any, should be used to generate invoices for the account.
|
59
59
|
define_attribute :invoice_template_id, String
|
60
60
|
|
61
61
|
# @!attribute last_name
|
@@ -59,7 +59,7 @@ module Recurly
|
|
59
59
|
define_attribute :id, String
|
60
60
|
|
61
61
|
# @!attribute invoice_template_id
|
62
|
-
# @return [String] Unique ID to identify an invoice template. Available when the
|
62
|
+
# @return [String] Unique ID to identify an invoice template. Available when the site is on a Pro or Enterprise plan. Used to specify which invoice template, if any, should be used to generate invoices for the account.
|
63
63
|
define_attribute :invoice_template_id, String
|
64
64
|
|
65
65
|
# @!attribute last_name
|
@@ -47,7 +47,7 @@ module Recurly
|
|
47
47
|
define_attribute :first_name, String
|
48
48
|
|
49
49
|
# @!attribute invoice_template_id
|
50
|
-
# @return [String] Unique ID to identify an invoice template. Available when the
|
50
|
+
# @return [String] Unique ID to identify an invoice template. Available when the site is on a Pro or Enterprise plan. Used to specify which invoice template, if any, should be used to generate invoices for the account.
|
51
51
|
define_attribute :invoice_template_id, String
|
52
52
|
|
53
53
|
# @!attribute last_name
|
@@ -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 an `ending_amount` value which represents the final tier.
|
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,13 +83,17 @@ 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 without an `ending_quantity` value which represents the final tier.
|
83
87
|
define_attribute :tiers, Array, { :item_type => :Tier }
|
84
88
|
|
85
89
|
# @!attribute usage_percentage
|
86
90
|
# @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
91
|
define_attribute :usage_percentage, Float
|
88
92
|
|
93
|
+
# @!attribute usage_timeframe
|
94
|
+
# @return [String] The time at which usage totals are reset for billing purposes. Allows for `tiered` add-ons to accumulate usage over the course of multiple billing periods.
|
95
|
+
define_attribute :usage_timeframe, String
|
96
|
+
|
89
97
|
# @!attribute usage_type
|
90
98
|
# @return [String] Type of usage, required if `add_on_type` is `usage`. See our [Guide](https://developers.recurly.com/guides/usage-based-billing-guide.html) for an overview of how to configure usage add-ons.
|
91
99
|
define_attribute :usage_type, String
|
@@ -11,7 +11,7 @@ module Recurly
|
|
11
11
|
define_attribute :currency, String
|
12
12
|
|
13
13
|
# @!attribute tax_inclusive
|
14
|
-
# @return [Boolean]
|
14
|
+
# @return [Boolean] This field is deprecated. Please do not use it.
|
15
15
|
define_attribute :tax_inclusive, :Boolean
|
16
16
|
|
17
17
|
# @!attribute unit_amount
|
@@ -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. There must be one tier without an `ending_amount` value which represents the final tier.
|
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 which represents the final tier.
|
67
71
|
define_attribute :tiers, Array, { :item_type => :Tier }
|
68
72
|
|
69
73
|
# @!attribute usage_percentage
|
@@ -99,11 +99,11 @@ module Recurly
|
|
99
99
|
define_attribute :sort_code, String
|
100
100
|
|
101
101
|
# @!attribute tax_identifier
|
102
|
-
# @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.
|
102
|
+
# @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/CNPJ (Brazil) and CUIT (Argentina). CPF, CNPJ and CUIT are tax identifiers for all residents who pay taxes in Brazil and Argentina respectively.
|
103
103
|
define_attribute :tax_identifier, String
|
104
104
|
|
105
105
|
# @!attribute tax_identifier_type
|
106
|
-
# @return [String] This field and a value of `cpf` or `cuit` are required if adding a billing info that is an elo or hipercard type in Brazil or in Argentina.
|
106
|
+
# @return [String] This field and a value of `cpf`, `cnpj` or `cuit` are required if adding a billing info that is an elo or hipercard type in Brazil or in Argentina.
|
107
107
|
define_attribute :tax_identifier_type, String
|
108
108
|
|
109
109
|
# @!attribute three_d_secure_action_result_token_id
|
@@ -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. Must be left empty if it is the final tier.
|
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.
|
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
|
@@ -15,7 +15,7 @@ module Recurly
|
|
15
15
|
define_attribute :setup_fee, Float
|
16
16
|
|
17
17
|
# @!attribute tax_inclusive
|
18
|
-
# @return [Boolean]
|
18
|
+
# @return [Boolean] This field is deprecated. Please do not use it.
|
19
19
|
define_attribute :tax_inclusive, :Boolean
|
20
20
|
|
21
21
|
# @!attribute unit_amount
|
@@ -11,7 +11,7 @@ module Recurly
|
|
11
11
|
define_attribute :currency, String
|
12
12
|
|
13
13
|
# @!attribute tax_inclusive
|
14
|
-
# @return [Boolean]
|
14
|
+
# @return [Boolean] This field is deprecated. Please do not use it.
|
15
15
|
define_attribute :tax_inclusive, :Boolean
|
16
16
|
|
17
17
|
# @!attribute unit_amount
|
@@ -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 which represents the final tier. 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 an `ending_quantity` value which represents the final tier. 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 for the tier. Allows up to 2 decimal places. Must be left empty if it is the final tier.
|
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.
|
15
|
+
define_attribute :usage_percentage, String
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -7,7 +7,7 @@ module Recurly
|
|
7
7
|
class SubscriptionAddOnTier < Request
|
8
8
|
|
9
9
|
# @!attribute ending_quantity
|
10
|
-
# @return [Integer] Ending quantity
|
10
|
+
# @return [Integer] Ending quantity for the tier. This represents a unit amount for unit-priced add ons. Must be left empty if it is the final tier.
|
11
11
|
define_attribute :ending_quantity, Integer
|
12
12
|
|
13
13
|
# @!attribute unit_amount
|
@@ -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
|
@@ -18,6 +18,10 @@ module Recurly
|
|
18
18
|
# @return [String] When an id is provided, the existing subscription add-on attributes will persist unless overridden in the request.
|
19
19
|
define_attribute :id, String
|
20
20
|
|
21
|
+
# @!attribute percentage_tiers
|
22
|
+
# @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. There must be one tier without an `ending_amount` value which represents the final tier.
|
23
|
+
define_attribute :percentage_tiers, Array, { :item_type => :SubscriptionAddOnPercentageTier }
|
24
|
+
|
21
25
|
# @!attribute quantity
|
22
26
|
# @return [Integer] Quantity
|
23
27
|
define_attribute :quantity, Integer
|
@@ -27,7 +31,7 @@ module Recurly
|
|
27
31
|
define_attribute :revenue_schedule_type, String
|
28
32
|
|
29
33
|
# @!attribute tiers
|
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
|
34
|
+
# @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 an `ending_quantity` value which represents the final tier.
|
31
35
|
define_attribute :tiers, Array, { :item_type => :SubscriptionAddOnTier }
|
32
36
|
|
33
37
|
# @!attribute unit_amount
|
@@ -55,7 +55,7 @@ module Recurly
|
|
55
55
|
define_attribute :shipping, :SubscriptionChangeShippingCreate
|
56
56
|
|
57
57
|
# @!attribute tax_inclusive
|
58
|
-
# @return [Boolean]
|
58
|
+
# @return [Boolean] This field is deprecated. Please do not use it.
|
59
59
|
define_attribute :tax_inclusive, :Boolean
|
60
60
|
|
61
61
|
# @!attribute timeframe
|
@@ -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. Please do not use it.
|
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. Must be left empty if it is the final tier.
|
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
|
@@ -91,7 +91,7 @@ module Recurly
|
|
91
91
|
define_attribute :id, String
|
92
92
|
|
93
93
|
# @!attribute invoice_template_id
|
94
|
-
# @return [String] Unique ID to identify an invoice template. Available when the
|
94
|
+
# @return [String] Unique ID to identify an invoice template. Available when the site is on a Pro or Enterprise plan. 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
95
|
define_attribute :invoice_template_id, String
|
96
96
|
|
97
97
|
# @!attribute last_name
|
@@ -13,6 +13,10 @@ module Recurly
|
|
13
13
|
# @!attribute currency
|
14
14
|
# @return [String] 3-letter ISO 4217 currency code.
|
15
15
|
define_attribute :currency, String
|
16
|
+
|
17
|
+
# @!attribute processing_prepayment_amount
|
18
|
+
# @return [Float] Total amount for the prepayment credit invoices in a `processing` state on the account.
|
19
|
+
define_attribute :processing_prepayment_amount, Float
|
16
20
|
end
|
17
21
|
end
|
18
22
|
end
|
@@ -110,6 +110,10 @@ module Recurly
|
|
110
110
|
# @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.
|
111
111
|
define_attribute :usage_percentage, Float
|
112
112
|
|
113
|
+
# @!attribute usage_timeframe
|
114
|
+
# @return [String] The time at which usage totals are reset for billing purposes.
|
115
|
+
define_attribute :usage_timeframe, String
|
116
|
+
|
113
117
|
# @!attribute usage_type
|
114
118
|
# @return [String] Type of usage, returns usage type if `add_on_type` is `usage`.
|
115
119
|
define_attribute :usage_type, String
|
@@ -11,7 +11,7 @@ module Recurly
|
|
11
11
|
define_attribute :currency, String
|
12
12
|
|
13
13
|
# @!attribute tax_inclusive
|
14
|
-
# @return [Boolean]
|
14
|
+
# @return [Boolean] This field is deprecated. Please do not use it.
|
15
15
|
define_attribute :tax_inclusive, :Boolean
|
16
16
|
|
17
17
|
# @!attribute unit_amount
|
@@ -7,11 +7,11 @@ module Recurly
|
|
7
7
|
class PercentageTier < Resource
|
8
8
|
|
9
9
|
# @!attribute ending_amount
|
10
|
-
# @return [Float] Ending amount for the tier. Allows up to 2 decimal places.
|
10
|
+
# @return [Float] Ending amount for the tier. Allows up to 2 decimal places. Must be left empty if it is the final tier.
|
11
11
|
define_attribute :ending_amount, Float
|
12
12
|
|
13
13
|
# @!attribute usage_percentage
|
14
|
-
# @return [String]
|
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.
|
15
15
|
define_attribute :usage_percentage, String
|
16
16
|
end
|
17
17
|
end
|
@@ -15,7 +15,7 @@ module Recurly
|
|
15
15
|
define_attribute :setup_fee, Float
|
16
16
|
|
17
17
|
# @!attribute tax_inclusive
|
18
|
-
# @return [Boolean]
|
18
|
+
# @return [Boolean] This field is deprecated. Please do not use it.
|
19
19
|
define_attribute :tax_inclusive, :Boolean
|
20
20
|
|
21
21
|
# @!attribute unit_amount
|
@@ -11,7 +11,7 @@ module Recurly
|
|
11
11
|
define_attribute :currency, String
|
12
12
|
|
13
13
|
# @!attribute tax_inclusive
|
14
|
-
# @return [Boolean]
|
14
|
+
# @return [Boolean] This field is deprecated. Please do not use it.
|
15
15
|
define_attribute :tax_inclusive, :Boolean
|
16
16
|
|
17
17
|
# @!attribute unit_amount
|
@@ -14,6 +14,10 @@ module Recurly
|
|
14
14
|
# @return [DateTime] Activated at
|
15
15
|
define_attribute :activated_at, DateTime
|
16
16
|
|
17
|
+
# @!attribute active_invoice_id
|
18
|
+
# @return [String] The invoice ID of the latest invoice created for an active subscription.
|
19
|
+
define_attribute :active_invoice_id, String
|
20
|
+
|
17
21
|
# @!attribute add_ons
|
18
22
|
# @return [Array[SubscriptionAddOn]] Add-ons
|
19
23
|
define_attribute :add_ons, Array, { :item_type => :SubscriptionAddOn }
|
@@ -31,7 +31,7 @@ module Recurly
|
|
31
31
|
define_attribute :object, String
|
32
32
|
|
33
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.
|
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. There must be one tier without an `ending_amount` value which represents the final tier.
|
35
35
|
define_attribute :percentage_tiers, Array, { :item_type => :SubscriptionAddOnPercentageTier }
|
36
36
|
|
37
37
|
# @!attribute quantity
|
@@ -51,7 +51,7 @@ module Recurly
|
|
51
51
|
define_attribute :tier_type, String
|
52
52
|
|
53
53
|
# @!attribute tiers
|
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.
|
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. There must be one tier without an `ending_quantity` value which represents the final tier.
|
55
55
|
define_attribute :tiers, Array, { :item_type => :SubscriptionAddOnTier }
|
56
56
|
|
57
57
|
# @!attribute unit_amount
|
@@ -69,6 +69,10 @@ module Recurly
|
|
69
69
|
# @!attribute usage_percentage
|
70
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.
|
71
71
|
define_attribute :usage_percentage, Float
|
72
|
+
|
73
|
+
# @!attribute usage_timeframe
|
74
|
+
# @return [String] The time at which usage totals are reset for billing purposes.
|
75
|
+
define_attribute :usage_timeframe, String
|
72
76
|
end
|
73
77
|
end
|
74
78
|
end
|
@@ -7,11 +7,11 @@ module Recurly
|
|
7
7
|
class SubscriptionAddOnPercentageTier < Resource
|
8
8
|
|
9
9
|
# @!attribute ending_amount
|
10
|
-
# @return [Float] Ending amount
|
10
|
+
# @return [Float] Ending amount for the tier. Allows up to 2 decimal places. Must be left empty if it is the final tier.
|
11
11
|
define_attribute :ending_amount, Float
|
12
12
|
|
13
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.
|
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.
|
15
15
|
define_attribute :usage_percentage, String
|
16
16
|
end
|
17
17
|
end
|
@@ -7,7 +7,7 @@ module Recurly
|
|
7
7
|
class SubscriptionAddOnTier < Resource
|
8
8
|
|
9
9
|
# @!attribute ending_quantity
|
10
|
-
# @return [Integer] Ending quantity
|
10
|
+
# @return [Integer] Ending quantity for the tier. This represents a unit amount for unit-priced add ons. Must be left empty if it is the final tier.
|
11
11
|
define_attribute :ending_quantity, Integer
|
12
12
|
|
13
13
|
# @!attribute unit_amount
|
@@ -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
|
@@ -67,7 +67,7 @@ module Recurly
|
|
67
67
|
define_attribute :subscription_id, String
|
68
68
|
|
69
69
|
# @!attribute tax_inclusive
|
70
|
-
# @return [Boolean]
|
70
|
+
# @return [Boolean] This field is deprecated. Please do not use it.
|
71
71
|
define_attribute :tax_inclusive, :Boolean
|
72
72
|
|
73
73
|
# @!attribute unit_amount
|
@@ -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. Must be left empty if it is the final tier.
|
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
data/openapi/api.yaml
CHANGED
@@ -12519,7 +12519,97 @@ paths:
|
|
12519
12519
|
application/json:
|
12520
12520
|
schema:
|
12521
12521
|
"$ref": "#/components/schemas/Error"
|
12522
|
-
x-code-samples:
|
12522
|
+
x-code-samples:
|
12523
|
+
- lang: Node.js
|
12524
|
+
source: |
|
12525
|
+
try {
|
12526
|
+
const invoiceCollection = await client.getPreviewRenewal(subscriptionId)
|
12527
|
+
console.log('Fetched Renewal Preview with total: ', invoiceCollection.chargeInvoice.total)
|
12528
|
+
} catch (err) {
|
12529
|
+
if (err instanceof recurly.errors.NotFoundError) {
|
12530
|
+
// If the request was not found, you may want to alert the user or
|
12531
|
+
// just return null
|
12532
|
+
console.log('Resource Not Found')
|
12533
|
+
} else {
|
12534
|
+
// If we don't know what to do with the err, we should
|
12535
|
+
// probably re-raise and let our web framework and logger handle it
|
12536
|
+
console.log('Unknown Error: ', err)
|
12537
|
+
}
|
12538
|
+
}
|
12539
|
+
- lang: Python
|
12540
|
+
source: |
|
12541
|
+
try:
|
12542
|
+
invoice_collection = client.get_preview_renewal(subscription_id)
|
12543
|
+
print("Fetched Renewal Preview with total: %s" % invoice_collection.charge_invoice.total)
|
12544
|
+
except recurly.errors.NotFoundError:
|
12545
|
+
# If the resource was not found, you may want to alert the user or
|
12546
|
+
# just return nil
|
12547
|
+
print("Resource Not Found")
|
12548
|
+
- lang: ".NET"
|
12549
|
+
source: |
|
12550
|
+
try
|
12551
|
+
{
|
12552
|
+
InvoiceCollection invoiceCollection = client.GetPreviewRenewal(subscriptionId);
|
12553
|
+
Console.WriteLine($"Fetched Renewal Preview with total {invoiceCollection.ChargeInvoice.Total}");
|
12554
|
+
}
|
12555
|
+
catch (Recurly.Errors.NotFound ex)
|
12556
|
+
{
|
12557
|
+
// If the resource was not found
|
12558
|
+
// we may want to alert the user or just return null
|
12559
|
+
Console.WriteLine($"Resource Not Found: {ex.Error.Message}");
|
12560
|
+
}
|
12561
|
+
catch (Recurly.Errors.ApiError ex)
|
12562
|
+
{
|
12563
|
+
// Use ApiError to catch a generic error from the API
|
12564
|
+
Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}");
|
12565
|
+
}
|
12566
|
+
- lang: Ruby
|
12567
|
+
source: |
|
12568
|
+
begin
|
12569
|
+
invoice_collection = @client.get_preview_renewal(
|
12570
|
+
subscription_id: subscription_id
|
12571
|
+
)
|
12572
|
+
puts "Fetched Renewal Preview with total: #{invoice_collection.charge_invoice.total}"
|
12573
|
+
rescue Recurly::Errors::NotFoundError
|
12574
|
+
# If the resource was not found, you may want to alert the user or
|
12575
|
+
# just return nil
|
12576
|
+
puts "Resource Not Found"
|
12577
|
+
end
|
12578
|
+
- lang: Java
|
12579
|
+
source: |
|
12580
|
+
try {
|
12581
|
+
final InvoiceCollection invoiceCollection = client.getPreviewRenewal(subscriptionId);
|
12582
|
+
System.out.println("Fetched Renewal Preview with total: " + invoiceCollection.getChargeInvoice().getTotal());
|
12583
|
+
} catch (ValidationException e) {
|
12584
|
+
// If the request was not valid, you may want to tell your user
|
12585
|
+
// why. You can find the invalid params and reasons in e.getError().getParams()
|
12586
|
+
System.out.println("Failed validation: " + e.getError().getMessage());
|
12587
|
+
} catch (ApiException e) {
|
12588
|
+
// Use ApiException to catch a generic error from the API
|
12589
|
+
System.out.println("Unexpected Recurly Error: " + e.getError().getMessage());
|
12590
|
+
}
|
12591
|
+
- lang: PHP
|
12592
|
+
source: |
|
12593
|
+
try {
|
12594
|
+
$invoiceCollection = $client->getPreviewRenewal($subscription_id);
|
12595
|
+
|
12596
|
+
echo 'Fetched Renewal Preview with total: ' . $invoiceCollection->getChargeInvoice()->getTotal() . PHP_EOL;
|
12597
|
+
var_dump($invoiceCollection);
|
12598
|
+
} catch (\Recurly\Errors\NotFound $e) {
|
12599
|
+
// Could not find the resource, you may want to inform the user
|
12600
|
+
// or just return a NULL
|
12601
|
+
echo 'Could not find resource.' . PHP_EOL;
|
12602
|
+
var_dump($e);
|
12603
|
+
} catch (\Recurly\RecurlyError $e) {
|
12604
|
+
// Something bad happened... tell the user so that they can fix it?
|
12605
|
+
echo 'Some unexpected Recurly error happened. Try again later.' . PHP_EOL;
|
12606
|
+
}
|
12607
|
+
- lang: Go
|
12608
|
+
source: "invoiceCollection, err := client.GetPreviewRenewal(subID)\nif e,
|
12609
|
+
ok := err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeNotFound
|
12610
|
+
{\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected
|
12611
|
+
Recurly error: %v\", e)\n\treturn nil, err\n}\nfmt.Printf(\"Fetched Renewal
|
12612
|
+
Preview with total: %f\", invoiceCollection.ChargeInvoice.Total)"
|
12523
12613
|
"/subscriptions/{subscription_id}/change":
|
12524
12614
|
get:
|
12525
12615
|
tags:
|
@@ -15852,7 +15942,7 @@ components:
|
|
15852
15942
|
type: string
|
15853
15943
|
title: Invoice Template ID
|
15854
15944
|
description: Unique ID to identify an invoice template. Available when
|
15855
|
-
the
|
15945
|
+
the site is on a Pro or Enterprise plan. Used to specify which invoice
|
15856
15946
|
template, if any, should be used to generate invoices for the account.
|
15857
15947
|
address:
|
15858
15948
|
"$ref": "#/components/schemas/Address"
|
@@ -15935,7 +16025,7 @@ components:
|
|
15935
16025
|
type: string
|
15936
16026
|
title: Invoice Template ID
|
15937
16027
|
description: Unique ID to identify an invoice template. Available when the
|
15938
|
-
|
16028
|
+
site is on a Pro or Enterprise plan. Used to specify if a non-default
|
15939
16029
|
invoice template will be used to generate invoices for the account. For
|
15940
16030
|
sites without multiple invoice templates enabled, the default template
|
15941
16031
|
will always be used.
|
@@ -16040,6 +16130,12 @@ components:
|
|
16040
16130
|
format: float
|
16041
16131
|
title: Amount
|
16042
16132
|
description: Total amount the account is past due.
|
16133
|
+
processing_prepayment_amount:
|
16134
|
+
type: number
|
16135
|
+
format: float
|
16136
|
+
title: Amount
|
16137
|
+
description: Total amount for the prepayment credit invoices in a `processing`
|
16138
|
+
state on the account.
|
16043
16139
|
InvoiceAddress:
|
16044
16140
|
allOf:
|
16045
16141
|
- "$ref": "#/components/schemas/Address"
|
@@ -16265,6 +16361,8 @@ components:
|
|
16265
16361
|
readOnly: true
|
16266
16362
|
tier_type:
|
16267
16363
|
"$ref": "#/components/schemas/TierTypeEnum"
|
16364
|
+
usage_timeframe:
|
16365
|
+
"$ref": "#/components/schemas/UsageTimeframeEnum"
|
16268
16366
|
tiers:
|
16269
16367
|
type: array
|
16270
16368
|
title: Tiers
|
@@ -16443,6 +16541,8 @@ components:
|
|
16443
16541
|
* Must be absent if `add_on_type` is `usage` and `usage_type` is `percentage`.
|
16444
16542
|
tier_type:
|
16445
16543
|
"$ref": "#/components/schemas/TierTypeEnum"
|
16544
|
+
usage_timeframe:
|
16545
|
+
"$ref": "#/components/schemas/UsageTimeframeCreateEnum"
|
16446
16546
|
tiers:
|
16447
16547
|
type: array
|
16448
16548
|
title: Tiers
|
@@ -16451,8 +16551,18 @@ components:
|
|
16451
16551
|
description: |
|
16452
16552
|
If the tier_type is `flat`, then `tiers` must be absent. The `tiers` object
|
16453
16553
|
must include one to many tiers with `ending_quantity` and `unit_amount` for
|
16454
|
-
the desired `currencies
|
16455
|
-
|
16554
|
+
the desired `currencies`. There must be one tier without an `ending_quantity` value
|
16555
|
+
which represents the final tier.
|
16556
|
+
percentage_tiers:
|
16557
|
+
type: array
|
16558
|
+
title: Percentage Tiers By Currency
|
16559
|
+
items:
|
16560
|
+
"$ref": "#/components/schemas/PercentageTiersByCurrency"
|
16561
|
+
description: |
|
16562
|
+
Array of objects which must have at least one set of tiers
|
16563
|
+
per currency and the currency code. The tier_type must be `volume` or `tiered`,
|
16564
|
+
if not, it must be absent. There must be one tier without an `ending_amount` value
|
16565
|
+
which represents the final tier.
|
16456
16566
|
required:
|
16457
16567
|
- code
|
16458
16568
|
- name
|
@@ -16580,8 +16690,18 @@ components:
|
|
16580
16690
|
description: |
|
16581
16691
|
If the tier_type is `flat`, then `tiers` must be absent. The `tiers` object
|
16582
16692
|
must include one to many tiers with `ending_quantity` and `unit_amount` for
|
16583
|
-
the desired `currencies
|
16584
|
-
|
16693
|
+
the desired `currencies`. There must be one tier without an `ending_quantity` value
|
16694
|
+
which represents the final tier.
|
16695
|
+
percentage_tiers:
|
16696
|
+
type: array
|
16697
|
+
title: Percentage Tiers By Currency
|
16698
|
+
items:
|
16699
|
+
"$ref": "#/components/schemas/PercentageTiersByCurrency"
|
16700
|
+
description: |
|
16701
|
+
`percentage_tiers` is an array of objects, which must have the set of tiers
|
16702
|
+
per currency and the currency code. The tier_type must be `volume` or `tiered`,
|
16703
|
+
if not, it must be absent. There must be one tier without an `ending_amount` value
|
16704
|
+
which represents the final tier.
|
16585
16705
|
BillingInfo:
|
16586
16706
|
type: object
|
16587
16707
|
properties:
|
@@ -16781,11 +16901,12 @@ components:
|
|
16781
16901
|
type: string
|
16782
16902
|
description: Tax identifier is required if adding a billing info that is
|
16783
16903
|
a consumer card in Brazil or in Argentina. This would be the customer's
|
16784
|
-
CPF (Brazil) and CUIT (Argentina). CPF and CUIT are tax identifiers
|
16785
|
-
all residents who pay taxes in Brazil and Argentina respectively.
|
16904
|
+
CPF/CNPJ (Brazil) and CUIT (Argentina). CPF, CNPJ and CUIT are tax identifiers
|
16905
|
+
for all residents who pay taxes in Brazil and Argentina respectively.
|
16786
16906
|
tax_identifier_type:
|
16787
|
-
description: This field and a value of `cpf` or `cuit` are required
|
16788
|
-
a billing info that is an elo or hipercard type in Brazil or
|
16907
|
+
description: This field and a value of `cpf`, `cnpj` or `cuit` are required
|
16908
|
+
if adding a billing info that is an elo or hipercard type in Brazil or
|
16909
|
+
in Argentina.
|
16789
16910
|
"$ref": "#/components/schemas/TaxIdentifierTypeEnum"
|
16790
16911
|
primary_payment_method:
|
16791
16912
|
type: boolean
|
@@ -19119,9 +19240,8 @@ components:
|
|
19119
19240
|
type: boolean
|
19120
19241
|
title: Tax Inclusive?
|
19121
19242
|
default: false
|
19122
|
-
description:
|
19123
|
-
|
19124
|
-
feature) must be enabled to use this flag.
|
19243
|
+
description: This field is deprecated. Please do not use it.
|
19244
|
+
deprecated: true
|
19125
19245
|
PlanUpdate:
|
19126
19246
|
type: object
|
19127
19247
|
properties:
|
@@ -19283,9 +19403,8 @@ components:
|
|
19283
19403
|
type: boolean
|
19284
19404
|
title: Tax Inclusive?
|
19285
19405
|
default: false
|
19286
|
-
description:
|
19287
|
-
|
19288
|
-
feature) must be enabled to use this flag.
|
19406
|
+
description: This field is deprecated. Please do not use it.
|
19407
|
+
deprecated: true
|
19289
19408
|
required:
|
19290
19409
|
- currency
|
19291
19410
|
TierPricing:
|
@@ -19332,9 +19451,8 @@ components:
|
|
19332
19451
|
type: boolean
|
19333
19452
|
title: Tax Inclusive?
|
19334
19453
|
default: false
|
19335
|
-
description:
|
19336
|
-
|
19337
|
-
feature) must be enabled to use this flag.
|
19454
|
+
description: This field is deprecated. Please do not use it.
|
19455
|
+
deprecated: true
|
19338
19456
|
required:
|
19339
19457
|
- currency
|
19340
19458
|
- unit_amount
|
@@ -19344,17 +19462,15 @@ components:
|
|
19344
19462
|
ending_quantity:
|
19345
19463
|
type: integer
|
19346
19464
|
title: Ending quantity
|
19347
|
-
description: Ending quantity for the tier. This represents a unit amount
|
19348
|
-
for unit-priced add ons, but for percentage type usage add ons, represents
|
19349
|
-
the site default currency in its minimum divisible unit.
|
19350
19465
|
minimum: 1
|
19351
19466
|
maximum: 999999999
|
19352
|
-
default:
|
19467
|
+
default:
|
19468
|
+
description: Ending quantity for the tier. This represents a unit amount
|
19469
|
+
for unit-priced add ons. Must be left empty if it is the final tier.
|
19353
19470
|
usage_percentage:
|
19354
19471
|
type: string
|
19355
19472
|
title: Usage Percentage
|
19356
|
-
description:
|
19357
|
-
tiers add ons. Use the percentage_tiers object instead.
|
19473
|
+
description: "(deprecated) -- Use the percentage_tiers object instead."
|
19358
19474
|
deprecated: true
|
19359
19475
|
currencies:
|
19360
19476
|
type: array
|
@@ -19383,14 +19499,19 @@ components:
|
|
19383
19499
|
type: number
|
19384
19500
|
format: float
|
19385
19501
|
title: Ending amount
|
19386
|
-
minimum: 0.
|
19387
|
-
maximum: 9999999999999
|
19502
|
+
minimum: 0.01
|
19503
|
+
maximum: 9999999999999.99
|
19504
|
+
default:
|
19388
19505
|
description: Ending amount for the tier. Allows up to 2 decimal places.
|
19389
|
-
|
19506
|
+
Must be left empty if it is the final tier.
|
19390
19507
|
usage_percentage:
|
19391
19508
|
type: string
|
19392
19509
|
title: Usage Percentage
|
19393
|
-
|
19510
|
+
minimum: 0
|
19511
|
+
maximum: 100
|
19512
|
+
description: |
|
19513
|
+
The percentage taken of the monetary amount of usage tracked.
|
19514
|
+
This can be up to 4 decimal places represented as a string.
|
19394
19515
|
Settings:
|
19395
19516
|
type: object
|
19396
19517
|
properties:
|
@@ -20036,6 +20157,13 @@ components:
|
|
20036
20157
|
type: string
|
20037
20158
|
title: Billing Info ID
|
20038
20159
|
description: Billing Info ID.
|
20160
|
+
active_invoice_id:
|
20161
|
+
type: string
|
20162
|
+
title: Active invoice ID
|
20163
|
+
description: The invoice ID of the latest invoice created for an active
|
20164
|
+
subscription.
|
20165
|
+
maxLength: 13
|
20166
|
+
readOnly: true
|
20039
20167
|
SubscriptionAddOn:
|
20040
20168
|
type: object
|
20041
20169
|
title: Subscription Add-on
|
@@ -20075,15 +20203,19 @@ components:
|
|
20075
20203
|
"$ref": "#/components/schemas/RevenueScheduleTypeEnum"
|
20076
20204
|
tier_type:
|
20077
20205
|
"$ref": "#/components/schemas/TierTypeEnum"
|
20206
|
+
usage_timeframe:
|
20207
|
+
"$ref": "#/components/schemas/UsageTimeframeEnum"
|
20078
20208
|
tiers:
|
20079
20209
|
type: array
|
20080
20210
|
title: Tiers
|
20081
20211
|
items:
|
20082
20212
|
"$ref": "#/components/schemas/SubscriptionAddOnTier"
|
20083
20213
|
minItems: 1
|
20084
|
-
description:
|
20085
|
-
|
20086
|
-
|
20214
|
+
description: "If tiers are provided in the request, all existing tiers on
|
20215
|
+
the Subscription Add-on will be\nremoved and replaced by the tiers in
|
20216
|
+
the request. If add_on.tier_type is tiered or volume and\nadd_on.usage_type
|
20217
|
+
is percentage use percentage_tiers instead. \nThere must be one tier without
|
20218
|
+
an `ending_quantity` value which represents the final tier.\n"
|
20087
20219
|
percentage_tiers:
|
20088
20220
|
type: array
|
20089
20221
|
title: Percentage Tiers
|
@@ -20092,7 +20224,9 @@ components:
|
|
20092
20224
|
minItems: 1
|
20093
20225
|
description: |
|
20094
20226
|
If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be
|
20095
|
-
removed and replaced by the percentage tiers in the request.
|
20227
|
+
removed and replaced by the percentage tiers in the request. Use only if add_on.tier_type is tiered or volume and
|
20228
|
+
add_on.usage_type is percentage.
|
20229
|
+
There must be one tier without an `ending_amount` value which represents the final tier.
|
20096
20230
|
usage_percentage:
|
20097
20231
|
type: number
|
20098
20232
|
format: float
|
@@ -20158,13 +20292,25 @@ components:
|
|
20158
20292
|
description: |
|
20159
20293
|
If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object
|
20160
20294
|
must include one to many tiers with `ending_quantity` and `unit_amount`.
|
20161
|
-
There must be one tier
|
20162
|
-
|
20295
|
+
There must be one tier without an `ending_quantity` value which represents the final tier.
|
20296
|
+
See our [Guide](https://developers.recurly.com/guides/item-addon-guide.html)
|
20163
20297
|
for an overview of how to configure quantity-based pricing models.
|
20298
|
+
percentage_tiers:
|
20299
|
+
type: array
|
20300
|
+
title: Percentage Tiers
|
20301
|
+
items:
|
20302
|
+
"$ref": "#/components/schemas/SubscriptionAddOnPercentageTier"
|
20303
|
+
minItems: 1
|
20304
|
+
description: |
|
20305
|
+
If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be
|
20306
|
+
removed and replaced by the percentage tiers in the request. There must be one tier without ending_amount value which represents the final tier.
|
20307
|
+
Use only if add_on.tier_type is tiered or volume and add_on.usage_type is percentage.
|
20164
20308
|
usage_percentage:
|
20165
20309
|
type: number
|
20166
20310
|
format: float
|
20167
20311
|
title: Usage Percentage
|
20312
|
+
minimum: 0
|
20313
|
+
maximum: 100
|
20168
20314
|
description: The percentage taken of the monetary amount of usage tracked.
|
20169
20315
|
This can be up to 4 decimal places. A value between 0.0 and 100.0. Required
|
20170
20316
|
if `add_on_type` is usage and `usage_type` is percentage. Must be omitted
|
@@ -20227,8 +20373,18 @@ components:
|
|
20227
20373
|
description: |
|
20228
20374
|
If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object
|
20229
20375
|
must include one to many tiers with `ending_quantity` and `unit_amount`.
|
20230
|
-
There must be one tier
|
20231
|
-
|
20376
|
+
There must be one tier without an `ending_quantity` value which represents the final tier.
|
20377
|
+
percentage_tiers:
|
20378
|
+
type: array
|
20379
|
+
title: Percentage Tiers
|
20380
|
+
items:
|
20381
|
+
"$ref": "#/components/schemas/SubscriptionAddOnPercentageTier"
|
20382
|
+
minItems: 1
|
20383
|
+
description: |
|
20384
|
+
If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be
|
20385
|
+
removed and replaced by the percentage tiers in the request. Use only if add_on.tier_type is tiered or volume and
|
20386
|
+
add_on.usage_type is percentage.
|
20387
|
+
There must be one tier without an `ending_amount` value which represents the final tier.
|
20232
20388
|
usage_percentage:
|
20233
20389
|
type: number
|
20234
20390
|
format: float
|
@@ -20247,7 +20403,9 @@ components:
|
|
20247
20403
|
title: Ending quantity
|
20248
20404
|
minimum: 1
|
20249
20405
|
maximum: 999999999
|
20250
|
-
default:
|
20406
|
+
default:
|
20407
|
+
description: Ending quantity for the tier. This represents a unit amount
|
20408
|
+
for unit-priced add ons. Must be left empty if it is the final tier.
|
20251
20409
|
unit_amount:
|
20252
20410
|
type: number
|
20253
20411
|
format: float
|
@@ -20267,8 +20425,7 @@ components:
|
|
20267
20425
|
usage_percentage:
|
20268
20426
|
type: string
|
20269
20427
|
title: Usage Percentage
|
20270
|
-
description:
|
20271
|
-
tiers subscription add ons. Use the percentage_tiers object instead.
|
20428
|
+
description: "(deprecated) -- Use the percentage_tiers object instead."
|
20272
20429
|
deprecated: true
|
20273
20430
|
SubscriptionAddOnPercentageTier:
|
20274
20431
|
type: object
|
@@ -20280,13 +20437,16 @@ components:
|
|
20280
20437
|
minimum: 1
|
20281
20438
|
maximum: 9999999999999.99
|
20282
20439
|
default:
|
20440
|
+
description: Ending amount for the tier. Allows up to 2 decimal places.
|
20441
|
+
Must be left empty if it is the final tier.
|
20283
20442
|
usage_percentage:
|
20284
20443
|
type: string
|
20285
20444
|
title: Usage Percentage
|
20445
|
+
minimum: 0
|
20446
|
+
maximum: 100
|
20286
20447
|
description: |
|
20287
20448
|
The percentage taken of the monetary amount of usage tracked.
|
20288
|
-
This can be up to 4 decimal places represented as a string.
|
20289
|
-
0.0 and 100.0.
|
20449
|
+
This can be up to 4 decimal places represented as a string.
|
20290
20450
|
SubscriptionCancel:
|
20291
20451
|
type: object
|
20292
20452
|
properties:
|
@@ -20331,9 +20491,8 @@ components:
|
|
20331
20491
|
type: boolean
|
20332
20492
|
title: Tax Inclusive?
|
20333
20493
|
default: false
|
20334
|
-
description:
|
20335
|
-
|
20336
|
-
feature) must be enabled to use this flag.
|
20494
|
+
description: This field is deprecated. Please do not use it.
|
20495
|
+
deprecated: true
|
20337
20496
|
quantity:
|
20338
20497
|
type: integer
|
20339
20498
|
title: Subscription quantity
|
@@ -20425,9 +20584,8 @@ components:
|
|
20425
20584
|
type: boolean
|
20426
20585
|
title: Tax Inclusive?
|
20427
20586
|
default: false
|
20428
|
-
description:
|
20429
|
-
|
20430
|
-
feature) must be enabled to use this flag.
|
20587
|
+
description: This field is deprecated. Please do not use it.
|
20588
|
+
deprecated: true
|
20431
20589
|
quantity:
|
20432
20590
|
type: integer
|
20433
20591
|
title: Quantity
|
@@ -20866,9 +21024,8 @@ components:
|
|
20866
21024
|
type: boolean
|
20867
21025
|
title: Tax Inclusive?
|
20868
21026
|
default: false
|
20869
|
-
description:
|
20870
|
-
|
20871
|
-
feature) must be enabled to use this flag.
|
21027
|
+
description: This field is deprecated. Please do not use it.
|
21028
|
+
deprecated: true
|
20872
21029
|
shipping:
|
20873
21030
|
"$ref": "#/components/schemas/SubscriptionShippingUpdate"
|
20874
21031
|
billing_info_id:
|
@@ -21349,7 +21506,14 @@ components:
|
|
21349
21506
|
items:
|
21350
21507
|
"$ref": "#/components/schemas/SubscriptionAddOnTier"
|
21351
21508
|
description: The tiers and prices of the subscription based on the usage_timestamp.
|
21352
|
-
If tier_type = flat, tiers =
|
21509
|
+
If tier_type = flat, tiers = []
|
21510
|
+
percentage_tiers:
|
21511
|
+
type: array
|
21512
|
+
title: Percentage Tiers
|
21513
|
+
items:
|
21514
|
+
"$ref": "#/components/schemas/SubscriptionAddOnPercentageTier"
|
21515
|
+
description: The percentage tiers of the subscription based on the usage_timestamp.
|
21516
|
+
If tier_type = flat, percentage_tiers = []
|
21353
21517
|
measured_unit_id:
|
21354
21518
|
type: string
|
21355
21519
|
description: The ID of the measured unit associated with the add-on the
|
@@ -22000,11 +22164,13 @@ components:
|
|
22000
22164
|
- ko-KR
|
22001
22165
|
- nl-BE
|
22002
22166
|
- nl-NL
|
22167
|
+
- pl-PL
|
22003
22168
|
- pt-BR
|
22004
22169
|
- pt-PT
|
22005
22170
|
- ro-RO
|
22006
22171
|
- ru-RU
|
22007
22172
|
- sk-SK
|
22173
|
+
- sv-SE
|
22008
22174
|
- tr-TR
|
22009
22175
|
- zh-CN
|
22010
22176
|
BillToEnum:
|
@@ -22115,6 +22281,25 @@ components:
|
|
22115
22281
|
- tiered
|
22116
22282
|
- stairstep
|
22117
22283
|
- volume
|
22284
|
+
UsageTimeframeEnum:
|
22285
|
+
type: string
|
22286
|
+
title: Usage Timeframe
|
22287
|
+
description: The time at which usage totals are reset for billing purposes.
|
22288
|
+
enum:
|
22289
|
+
- billing_period
|
22290
|
+
- subscription_term
|
22291
|
+
default: billing_period
|
22292
|
+
UsageTimeframeCreateEnum:
|
22293
|
+
type: string
|
22294
|
+
title: Usage Timeframe
|
22295
|
+
description: |
|
22296
|
+
The time at which usage totals are reset for billing purposes.
|
22297
|
+
Allows for `tiered` add-ons to accumulate usage over the course of multiple
|
22298
|
+
billing periods.
|
22299
|
+
enum:
|
22300
|
+
- billing_period
|
22301
|
+
- subscription_term
|
22302
|
+
default: billing_period
|
22118
22303
|
CreditPaymentActionEnum:
|
22119
22304
|
type: string
|
22120
22305
|
enum:
|
@@ -22597,6 +22782,7 @@ components:
|
|
22597
22782
|
- three_d_secure_connection_error
|
22598
22783
|
- three_d_secure_credential_error
|
22599
22784
|
- three_d_secure_not_supported
|
22785
|
+
- too_busy
|
22600
22786
|
- too_many_attempts
|
22601
22787
|
- total_credit_exceeds_capture
|
22602
22788
|
- transaction_already_refunded
|
@@ -22658,6 +22844,7 @@ components:
|
|
22658
22844
|
type: string
|
22659
22845
|
enum:
|
22660
22846
|
- cpf
|
22847
|
+
- cnpj
|
22661
22848
|
- cuit
|
22662
22849
|
DunningCycleTypeEnum:
|
22663
22850
|
type: string
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recurly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Recurly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -119,10 +119,10 @@ files:
|
|
119
119
|
- ".changelog_config.yaml"
|
120
120
|
- ".github/ISSUE_TEMPLATE/bug-report.md"
|
121
121
|
- ".github/ISSUE_TEMPLATE/question-or-other.md"
|
122
|
+
- ".github/workflows/ci.yml"
|
122
123
|
- ".github/workflows/docs.yml"
|
123
124
|
- ".gitignore"
|
124
125
|
- ".rspec"
|
125
|
-
- ".travis.yml"
|
126
126
|
- ".yardopts"
|
127
127
|
- CHANGELOG.md
|
128
128
|
- CODE_OF_CONDUCT.md
|
@@ -176,6 +176,8 @@ files:
|
|
176
176
|
- lib/recurly/requests/line_item_refund.rb
|
177
177
|
- lib/recurly/requests/measured_unit_create.rb
|
178
178
|
- lib/recurly/requests/measured_unit_update.rb
|
179
|
+
- lib/recurly/requests/percentage_tier.rb
|
180
|
+
- lib/recurly/requests/percentage_tiers_by_currency.rb
|
179
181
|
- lib/recurly/requests/plan_create.rb
|
180
182
|
- lib/recurly/requests/plan_hosted_pages.rb
|
181
183
|
- lib/recurly/requests/plan_pricing.rb
|
@@ -189,6 +191,7 @@ files:
|
|
189
191
|
- lib/recurly/requests/shipping_method_update.rb
|
190
192
|
- lib/recurly/requests/shipping_purchase.rb
|
191
193
|
- lib/recurly/requests/subscription_add_on_create.rb
|
194
|
+
- lib/recurly/requests/subscription_add_on_percentage_tier.rb
|
192
195
|
- lib/recurly/requests/subscription_add_on_tier.rb
|
193
196
|
- lib/recurly/requests/subscription_add_on_update.rb
|
194
197
|
- lib/recurly/requests/subscription_cancel.rb
|
@@ -306,7 +309,7 @@ metadata:
|
|
306
309
|
changelog_uri: https://github.com/recurly/recurly-client-ruby/blob/master/CHANGELOG.md
|
307
310
|
documentation_uri: https://recurly.github.io/recurly-client-ruby/
|
308
311
|
homepage_uri: https://github.com/recurly/recurly-client-ruby
|
309
|
-
source_code_uri: https://github.com/recurly/recurly-client-ruby/tree/4.
|
312
|
+
source_code_uri: https://github.com/recurly/recurly-client-ruby/tree/4.18.0
|
310
313
|
post_install_message:
|
311
314
|
rdoc_options: []
|
312
315
|
require_paths:
|
data/.travis.yml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
rvm:
|
4
|
-
- 2.4
|
5
|
-
- 2.5
|
6
|
-
- 2.6
|
7
|
-
- 2.7
|
8
|
-
- 3.0
|
9
|
-
bundler_args: --binstubs
|
10
|
-
before_install:
|
11
|
-
- sudo apt-get update && sudo apt-get install apt-transport-https ca-certificates -y && sudo update-ca-certificates
|
12
|
-
- gem update --system
|
13
|
-
- gem install bundler
|
14
|
-
dist: focal
|
15
|
-
script:
|
16
|
-
- ./scripts/test
|