dodopayments 2.17.1 → 2.18.1
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/CHANGELOG.md +16 -0
- data/README.md +1 -1
- data/lib/dodopayments/models/attach_addon.rb +3 -1
- data/lib/dodopayments/models/checkout_session_flags.rb +12 -1
- data/lib/dodopayments/models/credit_entitlement.rb +2 -1
- data/lib/dodopayments/models/credit_entitlement_cart_response.rb +2 -1
- data/lib/dodopayments/models/credit_entitlements/credit_ledger_entry.rb +14 -1
- data/lib/dodopayments/models/entitlements/grant_fulfill_license_key_params.rb +53 -0
- data/lib/dodopayments/models/license_key_duration.rb +3 -1
- data/lib/dodopayments/models/metadata.rb +8 -0
- data/lib/dodopayments/models/payment.rb +2 -2
- data/lib/dodopayments/models/payment_method_types.rb +1 -0
- data/lib/dodopayments/models/product.rb +3 -17
- data/lib/dodopayments/models/product_create_params.rb +3 -16
- data/lib/dodopayments/models/product_list_response.rb +3 -17
- data/lib/dodopayments/models/product_update_params.rb +3 -16
- data/lib/dodopayments/models/products/list_localized_prices_response.rb +18 -0
- data/lib/dodopayments/models/products/localized_price.rb +75 -0
- data/lib/dodopayments/models/products/localized_price_archive_params.rb +28 -0
- data/lib/dodopayments/models/products/localized_price_create_params.rb +51 -0
- data/lib/dodopayments/models/products/localized_price_list_params.rb +22 -0
- data/lib/dodopayments/models/products/localized_price_retrieve_params.rb +28 -0
- data/lib/dodopayments/models/products/localized_price_update_params.rb +42 -0
- data/lib/dodopayments/models/products/pricing_mode.rb +17 -0
- data/lib/dodopayments/models/subscription_update_params.rb +12 -1
- data/lib/dodopayments/models/time_interval.rb +1 -0
- data/lib/dodopayments/models.rb +3 -0
- data/lib/dodopayments/resources/entitlements/grants.rb +35 -0
- data/lib/dodopayments/resources/products/localized_prices.rb +144 -0
- data/lib/dodopayments/resources/products.rb +6 -2
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +11 -0
- data/rbi/dodopayments/models/attach_addon.rbi +6 -1
- data/rbi/dodopayments/models/checkout_session_flags.rbi +17 -0
- data/rbi/dodopayments/models/credit_entitlement.rbi +2 -0
- data/rbi/dodopayments/models/credit_entitlement_cart_response.rbi +2 -0
- data/rbi/dodopayments/models/credit_entitlements/credit_ledger_entry.rbi +12 -0
- data/rbi/dodopayments/models/entitlements/grant_fulfill_license_key_params.rbi +74 -0
- data/rbi/dodopayments/models/license_key_duration.rbi +6 -1
- data/rbi/dodopayments/models/metadata.rbi +11 -0
- data/rbi/dodopayments/models/payment.rbi +2 -2
- data/rbi/dodopayments/models/payment_method_types.rbi +2 -0
- data/rbi/dodopayments/models/product.rbi +4 -26
- data/rbi/dodopayments/models/product_create_params.rbi +3 -43
- data/rbi/dodopayments/models/product_list_response.rbi +3 -47
- data/rbi/dodopayments/models/product_update_params.rbi +3 -43
- data/rbi/dodopayments/models/products/list_localized_prices_response.rbi +36 -0
- data/rbi/dodopayments/models/products/localized_price.rbi +98 -0
- data/rbi/dodopayments/models/products/localized_price_archive_params.rbi +48 -0
- data/rbi/dodopayments/models/products/localized_price_create_params.rbi +72 -0
- data/rbi/dodopayments/models/products/localized_price_list_params.rbi +43 -0
- data/rbi/dodopayments/models/products/localized_price_retrieve_params.rbi +48 -0
- data/rbi/dodopayments/models/products/localized_price_update_params.rbi +62 -0
- data/rbi/dodopayments/models/products/pricing_mode.rbi +28 -0
- data/rbi/dodopayments/models/subscription_update_params.rbi +2 -0
- data/rbi/dodopayments/models/time_interval.rbi +1 -0
- data/rbi/dodopayments/models.rbi +6 -0
- data/rbi/dodopayments/resources/entitlements/grants.rbi +28 -0
- data/rbi/dodopayments/resources/products/localized_prices.rbi +103 -0
- data/rbi/dodopayments/resources/products.rbi +5 -2
- data/sig/dodopayments/models/checkout_session_flags.rbs +7 -0
- data/sig/dodopayments/models/checkout_session_request.rbs +4 -4
- data/sig/dodopayments/models/credit_entitlements/balance_create_ledger_entry_params.rbs +4 -4
- data/sig/dodopayments/models/credit_entitlements/balance_list_grants_response.rbs +4 -4
- data/sig/dodopayments/models/credit_entitlements/credit_ledger_entry.rbs +5 -0
- data/sig/dodopayments/models/customer.rbs +7 -5
- data/sig/dodopayments/models/customer_create_params.rbs +7 -5
- data/sig/dodopayments/models/customer_limited_details.rbs +7 -5
- data/sig/dodopayments/models/customer_update_params.rbs +4 -4
- data/sig/dodopayments/models/discount.rbs +4 -4
- data/sig/dodopayments/models/discount_create_params.rbs +7 -5
- data/sig/dodopayments/models/discount_detail.rbs +4 -4
- data/sig/dodopayments/models/discount_update_params.rbs +4 -4
- data/sig/dodopayments/models/entitlement.rbs +4 -4
- data/sig/dodopayments/models/entitlement_create_params.rbs +7 -5
- data/sig/dodopayments/models/entitlement_update_params.rbs +4 -4
- data/sig/dodopayments/models/entitlements/entitlement_grant.rbs +4 -4
- data/sig/dodopayments/models/entitlements/grant_fulfill_license_key_params.rbs +43 -0
- data/sig/dodopayments/models/metadata.rbs +7 -0
- data/sig/dodopayments/models/payment.rbs +4 -4
- data/sig/dodopayments/models/payment_create_params.rbs +7 -5
- data/sig/dodopayments/models/payment_create_response.rbs +4 -4
- data/sig/dodopayments/models/payment_list_response.rbs +4 -4
- data/sig/dodopayments/models/payment_method_types.rbs +2 -0
- data/sig/dodopayments/models/product.rbs +8 -19
- data/sig/dodopayments/models/product_create_params.rbs +11 -20
- data/sig/dodopayments/models/product_list_response.rbs +8 -19
- data/sig/dodopayments/models/product_update_params.rbs +8 -19
- data/sig/dodopayments/models/products/list_localized_prices_response.rbs +20 -0
- data/sig/dodopayments/models/products/localized_price.rbs +57 -0
- data/sig/dodopayments/models/products/localized_price_archive_params.rbs +30 -0
- data/sig/dodopayments/models/products/localized_price_create_params.rbs +43 -0
- data/sig/dodopayments/models/products/localized_price_list_params.rbs +26 -0
- data/sig/dodopayments/models/products/localized_price_retrieve_params.rbs +30 -0
- data/sig/dodopayments/models/products/localized_price_update_params.rbs +34 -0
- data/sig/dodopayments/models/products/pricing_mode.rbs +16 -0
- data/sig/dodopayments/models/refund.rbs +4 -4
- data/sig/dodopayments/models/refund_create_params.rbs +7 -5
- data/sig/dodopayments/models/subscription.rbs +4 -4
- data/sig/dodopayments/models/subscription_charge_params.rbs +4 -4
- data/sig/dodopayments/models/subscription_create_params.rbs +7 -5
- data/sig/dodopayments/models/subscription_create_response.rbs +4 -4
- data/sig/dodopayments/models/subscription_list_response.rbs +4 -4
- data/sig/dodopayments/models/subscription_update_params.rbs +4 -4
- data/sig/dodopayments/models/update_subscription_plan_req.rbs +4 -4
- data/sig/dodopayments/models.rbs +2 -0
- data/sig/dodopayments/resources/checkout_sessions.rbs +2 -2
- data/sig/dodopayments/resources/credit_entitlements/balances.rbs +1 -1
- data/sig/dodopayments/resources/customers.rbs +2 -2
- data/sig/dodopayments/resources/discounts.rbs +2 -2
- data/sig/dodopayments/resources/entitlements/grants.rbs +8 -0
- data/sig/dodopayments/resources/entitlements.rbs +2 -2
- data/sig/dodopayments/resources/payments.rbs +1 -1
- data/sig/dodopayments/resources/products/localized_prices.rbs +41 -0
- data/sig/dodopayments/resources/products.rbs +6 -4
- data/sig/dodopayments/resources/refunds.rbs +1 -1
- data/sig/dodopayments/resources/subscriptions.rbs +5 -5
- metadata +35 -2
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Products
|
|
6
|
+
# @see Dodopayments::Resources::Products::LocalizedPrices#update
|
|
7
|
+
class LocalizedPriceUpdateParams < Dodopayments::Internal::Type::BaseModel
|
|
8
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute product_id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :product_id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute id
|
|
17
|
+
#
|
|
18
|
+
# @return [String]
|
|
19
|
+
required :id, String
|
|
20
|
+
|
|
21
|
+
# @!attribute amount
|
|
22
|
+
# New amount in the smallest currency unit (e.g., cents). Must be greater than
|
|
23
|
+
# zero. The currency and country_code of an existing rule cannot be changed.
|
|
24
|
+
#
|
|
25
|
+
# @return [Integer, nil]
|
|
26
|
+
optional :amount, Integer, nil?: true
|
|
27
|
+
|
|
28
|
+
# @!method initialize(product_id:, id:, amount: nil, request_options: {})
|
|
29
|
+
# Some parameter documentations has been truncated, see
|
|
30
|
+
# {Dodopayments::Models::Products::LocalizedPriceUpdateParams} for more details.
|
|
31
|
+
#
|
|
32
|
+
# @param product_id [String]
|
|
33
|
+
#
|
|
34
|
+
# @param id [String]
|
|
35
|
+
#
|
|
36
|
+
# @param amount [Integer, nil] New amount in the smallest currency unit (e.g., cents). Must be greater
|
|
37
|
+
#
|
|
38
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Products
|
|
6
|
+
module PricingMode
|
|
7
|
+
extend Dodopayments::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
BY_CURRENCY = :by_currency
|
|
10
|
+
BY_COUNTRY = :by_country
|
|
11
|
+
|
|
12
|
+
# @!method self.values
|
|
13
|
+
# @return [Array<Symbol>]
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -189,22 +189,33 @@ module Dodopayments
|
|
|
189
189
|
optional :rollover_timeframe_count, Integer, nil?: true
|
|
190
190
|
|
|
191
191
|
# @!attribute rollover_timeframe_interval
|
|
192
|
+
# Unit of a duration count (e.g. license-key validity period).
|
|
192
193
|
#
|
|
193
194
|
# @return [Symbol, Dodopayments::Models::TimeInterval, nil]
|
|
194
195
|
optional :rollover_timeframe_interval, enum: -> { Dodopayments::TimeInterval }, nil?: true
|
|
195
196
|
|
|
196
197
|
# @!method initialize(credit_entitlement_id:, credits_amount: nil, expires_after_days: nil, low_balance_threshold_percent: nil, max_rollover_count: nil, overage_enabled: nil, overage_limit: nil, rollover_enabled: nil, rollover_percentage: nil, rollover_timeframe_count: nil, rollover_timeframe_interval: nil)
|
|
197
198
|
# @param credit_entitlement_id [String]
|
|
199
|
+
#
|
|
198
200
|
# @param credits_amount [String, nil]
|
|
201
|
+
#
|
|
199
202
|
# @param expires_after_days [Integer, nil]
|
|
203
|
+
#
|
|
200
204
|
# @param low_balance_threshold_percent [Integer, nil]
|
|
205
|
+
#
|
|
201
206
|
# @param max_rollover_count [Integer, nil]
|
|
207
|
+
#
|
|
202
208
|
# @param overage_enabled [Boolean, nil]
|
|
209
|
+
#
|
|
203
210
|
# @param overage_limit [String, nil]
|
|
211
|
+
#
|
|
204
212
|
# @param rollover_enabled [Boolean, nil]
|
|
213
|
+
#
|
|
205
214
|
# @param rollover_percentage [Integer, nil]
|
|
215
|
+
#
|
|
206
216
|
# @param rollover_timeframe_count [Integer, nil]
|
|
207
|
-
#
|
|
217
|
+
#
|
|
218
|
+
# @param rollover_timeframe_interval [Symbol, Dodopayments::Models::TimeInterval, nil] Unit of a duration count (e.g. license-key validity period).
|
|
208
219
|
end
|
|
209
220
|
|
|
210
221
|
class DisableOnDemand < Dodopayments::Internal::Type::BaseModel
|
data/lib/dodopayments/models.rb
CHANGED
|
@@ -309,6 +309,9 @@ module Dodopayments
|
|
|
309
309
|
|
|
310
310
|
LicenseValidateParams = Dodopayments::Models::LicenseValidateParams
|
|
311
311
|
|
|
312
|
+
# @type [Dodopayments::Internal::Type::Converter]
|
|
313
|
+
Metadata = Dodopayments::Models::Metadata
|
|
314
|
+
|
|
312
315
|
Meter = Dodopayments::Models::Meter
|
|
313
316
|
|
|
314
317
|
MeterAggregation = Dodopayments::Models::MeterAggregation
|
|
@@ -36,6 +36,41 @@ module Dodopayments
|
|
|
36
36
|
)
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
+
# Some parameter documentations has been truncated, see
|
|
40
|
+
# {Dodopayments::Models::Entitlements::GrantFulfillLicenseKeyParams} for more
|
|
41
|
+
# details.
|
|
42
|
+
#
|
|
43
|
+
# For entitlements whose license-key config uses `manual` fulfillment, grants are
|
|
44
|
+
# created in the `pending` state without a key. Call this endpoint to deliver the
|
|
45
|
+
# key: the grant moves to `delivered`, the customer is emailed the key, and the
|
|
46
|
+
# `license_key.created` and `entitlement_grant.delivered` webhook events are sent.
|
|
47
|
+
#
|
|
48
|
+
# @overload fulfill_license_key(grant_id, key:, activations_limit: nil, expires_at: nil, request_options: {})
|
|
49
|
+
#
|
|
50
|
+
# @param grant_id [String] Grant ID
|
|
51
|
+
#
|
|
52
|
+
# @param key [String] The license key value to deliver to the customer.
|
|
53
|
+
#
|
|
54
|
+
# @param activations_limit [Integer, nil] Per-key activation limit. Defaults to the entitlement's license-key configuratio
|
|
55
|
+
#
|
|
56
|
+
# @param expires_at [Time, nil] When the key expires. Defaults to the duration in the entitlement's license-key
|
|
57
|
+
#
|
|
58
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
59
|
+
#
|
|
60
|
+
# @return [Dodopayments::Models::Entitlements::EntitlementGrant]
|
|
61
|
+
#
|
|
62
|
+
# @see Dodopayments::Models::Entitlements::GrantFulfillLicenseKeyParams
|
|
63
|
+
def fulfill_license_key(grant_id, params)
|
|
64
|
+
parsed, options = Dodopayments::Entitlements::GrantFulfillLicenseKeyParams.dump_request(params)
|
|
65
|
+
@client.request(
|
|
66
|
+
method: :post,
|
|
67
|
+
path: ["grants/%1$s/license-key", grant_id],
|
|
68
|
+
body: parsed,
|
|
69
|
+
model: Dodopayments::Entitlements::EntitlementGrant,
|
|
70
|
+
options: options
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
|
|
39
74
|
# Revoke a single grant. Idempotent: re-revoking an already-revoked grant returns
|
|
40
75
|
# the grant in its current state.
|
|
41
76
|
#
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Resources
|
|
5
|
+
class Products
|
|
6
|
+
class LocalizedPrices
|
|
7
|
+
# Some parameter documentations has been truncated, see
|
|
8
|
+
# {Dodopayments::Models::Products::LocalizedPriceCreateParams} for more details.
|
|
9
|
+
#
|
|
10
|
+
# @overload create(product_id, amount:, currency:, country_code: nil, request_options: {})
|
|
11
|
+
#
|
|
12
|
+
# @param product_id [String] Product Id
|
|
13
|
+
#
|
|
14
|
+
# @param amount [Integer] Amount in the smallest currency unit (e.g., cents). Must be greater than zero.
|
|
15
|
+
#
|
|
16
|
+
# @param currency [Symbol, Dodopayments::Models::Currency] Currency to charge in. Must be a supported currency.
|
|
17
|
+
#
|
|
18
|
+
# @param country_code [Symbol, Dodopayments::Models::CountryCode, nil] Required when the product's pricing_mode is by_country; forbidden when by_curren
|
|
19
|
+
#
|
|
20
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
21
|
+
#
|
|
22
|
+
# @return [Dodopayments::Models::Products::LocalizedPrice]
|
|
23
|
+
#
|
|
24
|
+
# @see Dodopayments::Models::Products::LocalizedPriceCreateParams
|
|
25
|
+
def create(product_id, params)
|
|
26
|
+
parsed, options = Dodopayments::Products::LocalizedPriceCreateParams.dump_request(params)
|
|
27
|
+
@client.request(
|
|
28
|
+
method: :post,
|
|
29
|
+
path: ["products/%1$s/localized-prices", product_id],
|
|
30
|
+
body: parsed,
|
|
31
|
+
model: Dodopayments::Products::LocalizedPrice,
|
|
32
|
+
options: options
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# @overload retrieve(id, product_id:, request_options: {})
|
|
37
|
+
#
|
|
38
|
+
# @param id [String] Localized Price Id
|
|
39
|
+
#
|
|
40
|
+
# @param product_id [String] Product Id
|
|
41
|
+
#
|
|
42
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
43
|
+
#
|
|
44
|
+
# @return [Dodopayments::Models::Products::LocalizedPrice]
|
|
45
|
+
#
|
|
46
|
+
# @see Dodopayments::Models::Products::LocalizedPriceRetrieveParams
|
|
47
|
+
def retrieve(id, params)
|
|
48
|
+
parsed, options = Dodopayments::Products::LocalizedPriceRetrieveParams.dump_request(params)
|
|
49
|
+
product_id =
|
|
50
|
+
parsed.delete(:product_id) do
|
|
51
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
52
|
+
end
|
|
53
|
+
@client.request(
|
|
54
|
+
method: :get,
|
|
55
|
+
path: ["products/%1$s/localized-prices/%2$s", product_id, id],
|
|
56
|
+
model: Dodopayments::Products::LocalizedPrice,
|
|
57
|
+
options: options
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Some parameter documentations has been truncated, see
|
|
62
|
+
# {Dodopayments::Models::Products::LocalizedPriceUpdateParams} for more details.
|
|
63
|
+
#
|
|
64
|
+
# @overload update(id, product_id:, amount: nil, request_options: {})
|
|
65
|
+
#
|
|
66
|
+
# @param id [String] Path param: Localized Price Id
|
|
67
|
+
#
|
|
68
|
+
# @param product_id [String] Path param: Product Id
|
|
69
|
+
#
|
|
70
|
+
# @param amount [Integer, nil] Body param: New amount in the smallest currency unit (e.g., cents). Must be grea
|
|
71
|
+
#
|
|
72
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
73
|
+
#
|
|
74
|
+
# @return [Dodopayments::Models::Products::LocalizedPrice]
|
|
75
|
+
#
|
|
76
|
+
# @see Dodopayments::Models::Products::LocalizedPriceUpdateParams
|
|
77
|
+
def update(id, params)
|
|
78
|
+
parsed, options = Dodopayments::Products::LocalizedPriceUpdateParams.dump_request(params)
|
|
79
|
+
product_id =
|
|
80
|
+
parsed.delete(:product_id) do
|
|
81
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
82
|
+
end
|
|
83
|
+
@client.request(
|
|
84
|
+
method: :patch,
|
|
85
|
+
path: ["products/%1$s/localized-prices/%2$s", product_id, id],
|
|
86
|
+
body: parsed,
|
|
87
|
+
model: Dodopayments::Products::LocalizedPrice,
|
|
88
|
+
options: options
|
|
89
|
+
)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# @overload list(product_id, request_options: {})
|
|
93
|
+
#
|
|
94
|
+
# @param product_id [String] Product Id
|
|
95
|
+
#
|
|
96
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
97
|
+
#
|
|
98
|
+
# @return [Dodopayments::Models::Products::ListLocalizedPricesResponse]
|
|
99
|
+
#
|
|
100
|
+
# @see Dodopayments::Models::Products::LocalizedPriceListParams
|
|
101
|
+
def list(product_id, params = {})
|
|
102
|
+
@client.request(
|
|
103
|
+
method: :get,
|
|
104
|
+
path: ["products/%1$s/localized-prices", product_id],
|
|
105
|
+
model: Dodopayments::Products::ListLocalizedPricesResponse,
|
|
106
|
+
options: params[:request_options]
|
|
107
|
+
)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# @overload archive(id, product_id:, request_options: {})
|
|
111
|
+
#
|
|
112
|
+
# @param id [String] Localized Price Id
|
|
113
|
+
#
|
|
114
|
+
# @param product_id [String] Product Id
|
|
115
|
+
#
|
|
116
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
117
|
+
#
|
|
118
|
+
# @return [nil]
|
|
119
|
+
#
|
|
120
|
+
# @see Dodopayments::Models::Products::LocalizedPriceArchiveParams
|
|
121
|
+
def archive(id, params)
|
|
122
|
+
parsed, options = Dodopayments::Products::LocalizedPriceArchiveParams.dump_request(params)
|
|
123
|
+
product_id =
|
|
124
|
+
parsed.delete(:product_id) do
|
|
125
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
126
|
+
end
|
|
127
|
+
@client.request(
|
|
128
|
+
method: :delete,
|
|
129
|
+
path: ["products/%1$s/localized-prices/%2$s", product_id, id],
|
|
130
|
+
model: NilClass,
|
|
131
|
+
options: options
|
|
132
|
+
)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# @api private
|
|
136
|
+
#
|
|
137
|
+
# @param client [Dodopayments::Client]
|
|
138
|
+
def initialize(client:)
|
|
139
|
+
@client = client
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
end
|
|
@@ -9,6 +9,9 @@ module Dodopayments
|
|
|
9
9
|
# @return [Dodopayments::Resources::Products::ShortLinks]
|
|
10
10
|
attr_reader :short_links
|
|
11
11
|
|
|
12
|
+
# @return [Dodopayments::Resources::Products::LocalizedPrices]
|
|
13
|
+
attr_reader :localized_prices
|
|
14
|
+
|
|
12
15
|
# Some parameter documentations has been truncated, see
|
|
13
16
|
# {Dodopayments::Models::ProductCreateParams} for more details.
|
|
14
17
|
#
|
|
@@ -42,7 +45,7 @@ module Dodopayments
|
|
|
42
45
|
#
|
|
43
46
|
# @param metadata [Hash{Symbol=>String}] Additional metadata for the product
|
|
44
47
|
#
|
|
45
|
-
# @param pricing_mode [Symbol, Dodopayments::Models::
|
|
48
|
+
# @param pricing_mode [Symbol, Dodopayments::Models::Products::PricingMode, nil] Pricing mode for localized pricing. When set, rules from
|
|
46
49
|
#
|
|
47
50
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
48
51
|
#
|
|
@@ -113,7 +116,7 @@ module Dodopayments
|
|
|
113
116
|
#
|
|
114
117
|
# @param price [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice, Dodopayments::Models::Price::UsageBasedPrice, nil] Price details of the product.
|
|
115
118
|
#
|
|
116
|
-
# @param pricing_mode [Symbol, Dodopayments::Models::
|
|
119
|
+
# @param pricing_mode [Symbol, Dodopayments::Models::Products::PricingMode, nil] Update the pricing mode. Omit to leave unchanged; set to null to clear
|
|
117
120
|
#
|
|
118
121
|
# @param tax_category [Symbol, Dodopayments::Models::TaxCategory, nil] Tax category of the product.
|
|
119
122
|
#
|
|
@@ -231,6 +234,7 @@ module Dodopayments
|
|
|
231
234
|
@client = client
|
|
232
235
|
@images = Dodopayments::Resources::Products::Images.new(client: client)
|
|
233
236
|
@short_links = Dodopayments::Resources::Products::ShortLinks.new(client: client)
|
|
237
|
+
@localized_prices = Dodopayments::Resources::Products::LocalizedPrices.new(client: client)
|
|
234
238
|
end
|
|
235
239
|
end
|
|
236
240
|
end
|
data/lib/dodopayments/version.rb
CHANGED
data/lib/dodopayments.rb
CHANGED
|
@@ -197,6 +197,7 @@ require_relative "dodopayments/models/entitlement_retrieve_params"
|
|
|
197
197
|
require_relative "dodopayments/models/entitlements/file_delete_params"
|
|
198
198
|
require_relative "dodopayments/models/entitlements/file_upload_params"
|
|
199
199
|
require_relative "dodopayments/models/entitlements/file_upload_response"
|
|
200
|
+
require_relative "dodopayments/models/entitlements/grant_fulfill_license_key_params"
|
|
200
201
|
require_relative "dodopayments/models/entitlements/grant_list_params"
|
|
201
202
|
require_relative "dodopayments/models/entitlements/grant_revoke_params"
|
|
202
203
|
require_relative "dodopayments/models/entitlements/license_key_grant"
|
|
@@ -228,6 +229,7 @@ require_relative "dodopayments/models/license_key_status"
|
|
|
228
229
|
require_relative "dodopayments/models/license_key_update_params"
|
|
229
230
|
require_relative "dodopayments/models/license_validate_params"
|
|
230
231
|
require_relative "dodopayments/models/license_validate_response"
|
|
232
|
+
require_relative "dodopayments/models/metadata"
|
|
231
233
|
require_relative "dodopayments/models/meter"
|
|
232
234
|
require_relative "dodopayments/models/meter_aggregation"
|
|
233
235
|
require_relative "dodopayments/models/meter_archive_params"
|
|
@@ -295,6 +297,14 @@ require_relative "dodopayments/models/product_list_response"
|
|
|
295
297
|
require_relative "dodopayments/models/product_retrieve_params"
|
|
296
298
|
require_relative "dodopayments/models/products/image_update_params"
|
|
297
299
|
require_relative "dodopayments/models/products/image_update_response"
|
|
300
|
+
require_relative "dodopayments/models/products/list_localized_prices_response"
|
|
301
|
+
require_relative "dodopayments/models/products/localized_price"
|
|
302
|
+
require_relative "dodopayments/models/products/localized_price_archive_params"
|
|
303
|
+
require_relative "dodopayments/models/products/localized_price_create_params"
|
|
304
|
+
require_relative "dodopayments/models/products/localized_price_list_params"
|
|
305
|
+
require_relative "dodopayments/models/products/localized_price_retrieve_params"
|
|
306
|
+
require_relative "dodopayments/models/products/localized_price_update_params"
|
|
307
|
+
require_relative "dodopayments/models/products/pricing_mode"
|
|
298
308
|
require_relative "dodopayments/models/products/short_link_create_params"
|
|
299
309
|
require_relative "dodopayments/models/products/short_link_create_response"
|
|
300
310
|
require_relative "dodopayments/models/products/short_link_list_params"
|
|
@@ -396,6 +406,7 @@ require_relative "dodopayments/resources/product_collections/groups"
|
|
|
396
406
|
require_relative "dodopayments/resources/product_collections/groups/items"
|
|
397
407
|
require_relative "dodopayments/resources/products"
|
|
398
408
|
require_relative "dodopayments/resources/products/images"
|
|
409
|
+
require_relative "dodopayments/resources/products/localized_prices"
|
|
399
410
|
require_relative "dodopayments/resources/products/short_links"
|
|
400
411
|
require_relative "dodopayments/resources/refunds"
|
|
401
412
|
require_relative "dodopayments/resources/subscriptions"
|
|
@@ -11,13 +11,18 @@ module Dodopayments
|
|
|
11
11
|
sig { returns(String) }
|
|
12
12
|
attr_accessor :addon_id
|
|
13
13
|
|
|
14
|
+
# Number of units of this addon.
|
|
14
15
|
sig { returns(Integer) }
|
|
15
16
|
attr_accessor :quantity
|
|
16
17
|
|
|
17
18
|
sig do
|
|
18
19
|
params(addon_id: String, quantity: Integer).returns(T.attached_class)
|
|
19
20
|
end
|
|
20
|
-
def self.new(
|
|
21
|
+
def self.new(
|
|
22
|
+
addon_id:,
|
|
23
|
+
# Number of units of this addon.
|
|
24
|
+
quantity:
|
|
25
|
+
)
|
|
21
26
|
end
|
|
22
27
|
|
|
23
28
|
sig { override.returns({ addon_id: String, quantity: Integer }) }
|
|
@@ -90,6 +90,16 @@ module Dodopayments
|
|
|
90
90
|
sig { params(allow_discount_code: T::Boolean).void }
|
|
91
91
|
attr_writer :allow_discount_code
|
|
92
92
|
|
|
93
|
+
# If true, the customer can add or remove addons on a subscription product during
|
|
94
|
+
# checkout.
|
|
95
|
+
#
|
|
96
|
+
# Default is false
|
|
97
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
98
|
+
attr_reader :allow_editing_addons
|
|
99
|
+
|
|
100
|
+
sig { params(allow_editing_addons: T::Boolean).void }
|
|
101
|
+
attr_writer :allow_editing_addons
|
|
102
|
+
|
|
93
103
|
# If phone number is collected from customer, set it to rue
|
|
94
104
|
#
|
|
95
105
|
# Default is true
|
|
@@ -150,6 +160,7 @@ module Dodopayments
|
|
|
150
160
|
allow_customer_editing_tax_id: T::Boolean,
|
|
151
161
|
allow_customer_editing_zipcode: T::Boolean,
|
|
152
162
|
allow_discount_code: T::Boolean,
|
|
163
|
+
allow_editing_addons: T::Boolean,
|
|
153
164
|
allow_phone_number_collection: T::Boolean,
|
|
154
165
|
allow_tax_id: T::Boolean,
|
|
155
166
|
always_create_new_customer: T::Boolean,
|
|
@@ -182,6 +193,11 @@ module Dodopayments
|
|
|
182
193
|
#
|
|
183
194
|
# Default is true
|
|
184
195
|
allow_discount_code: nil,
|
|
196
|
+
# If true, the customer can add or remove addons on a subscription product during
|
|
197
|
+
# checkout.
|
|
198
|
+
#
|
|
199
|
+
# Default is false
|
|
200
|
+
allow_editing_addons: nil,
|
|
185
201
|
# If phone number is collected from customer, set it to rue
|
|
186
202
|
#
|
|
187
203
|
# Default is true
|
|
@@ -221,6 +237,7 @@ module Dodopayments
|
|
|
221
237
|
allow_customer_editing_tax_id: T::Boolean,
|
|
222
238
|
allow_customer_editing_zipcode: T::Boolean,
|
|
223
239
|
allow_discount_code: T::Boolean,
|
|
240
|
+
allow_editing_addons: T::Boolean,
|
|
224
241
|
allow_phone_number_collection: T::Boolean,
|
|
225
242
|
allow_tax_id: T::Boolean,
|
|
226
243
|
always_create_new_customer: T::Boolean,
|
|
@@ -67,6 +67,7 @@ module Dodopayments
|
|
|
67
67
|
sig { returns(T.nilable(Integer)) }
|
|
68
68
|
attr_accessor :rollover_timeframe_count
|
|
69
69
|
|
|
70
|
+
# Unit of a duration count (e.g. license-key validity period).
|
|
70
71
|
sig { returns(T.nilable(Dodopayments::TimeInterval::TaggedSymbol)) }
|
|
71
72
|
attr_accessor :rollover_timeframe_interval
|
|
72
73
|
|
|
@@ -115,6 +116,7 @@ module Dodopayments
|
|
|
115
116
|
price_per_unit: nil,
|
|
116
117
|
rollover_percentage: nil,
|
|
117
118
|
rollover_timeframe_count: nil,
|
|
119
|
+
# Unit of a duration count (e.g. license-key validity period).
|
|
118
120
|
rollover_timeframe_interval: nil
|
|
119
121
|
)
|
|
120
122
|
end
|
|
@@ -70,6 +70,7 @@ module Dodopayments
|
|
|
70
70
|
sig { returns(T.nilable(Integer)) }
|
|
71
71
|
attr_accessor :rollover_timeframe_count
|
|
72
72
|
|
|
73
|
+
# Unit of a duration count (e.g. license-key validity period).
|
|
73
74
|
sig { returns(T.nilable(Dodopayments::TimeInterval::TaggedSymbol)) }
|
|
74
75
|
attr_accessor :rollover_timeframe_interval
|
|
75
76
|
|
|
@@ -124,6 +125,7 @@ module Dodopayments
|
|
|
124
125
|
overage_limit: nil,
|
|
125
126
|
rollover_percentage: nil,
|
|
126
127
|
rollover_timeframe_count: nil,
|
|
128
|
+
# Unit of a duration count (e.g. license-key validity period).
|
|
127
129
|
rollover_timeframe_interval: nil
|
|
128
130
|
)
|
|
129
131
|
end
|
|
@@ -43,6 +43,12 @@ module Dodopayments
|
|
|
43
43
|
sig { returns(T::Boolean) }
|
|
44
44
|
attr_accessor :is_credit
|
|
45
45
|
|
|
46
|
+
# Metadata associated with the credit grant's source (the subscription or payment
|
|
47
|
+
# created at checkout). Empty when the grant has no resolvable source (e.g.
|
|
48
|
+
# credits granted directly via the API).
|
|
49
|
+
sig { returns(T::Hash[Symbol, String]) }
|
|
50
|
+
attr_accessor :metadata
|
|
51
|
+
|
|
46
52
|
sig { returns(String) }
|
|
47
53
|
attr_accessor :overage_after
|
|
48
54
|
|
|
@@ -81,6 +87,7 @@ module Dodopayments
|
|
|
81
87
|
credit_entitlement_id: String,
|
|
82
88
|
customer_id: String,
|
|
83
89
|
is_credit: T::Boolean,
|
|
90
|
+
metadata: T::Hash[Symbol, String],
|
|
84
91
|
overage_after: String,
|
|
85
92
|
overage_before: String,
|
|
86
93
|
transaction_type:
|
|
@@ -103,6 +110,10 @@ module Dodopayments
|
|
|
103
110
|
credit_entitlement_id:,
|
|
104
111
|
customer_id:,
|
|
105
112
|
is_credit:,
|
|
113
|
+
# Metadata associated with the credit grant's source (the subscription or payment
|
|
114
|
+
# created at checkout). Empty when the grant has no resolvable source (e.g.
|
|
115
|
+
# credits granted directly via the API).
|
|
116
|
+
metadata:,
|
|
106
117
|
overage_after:,
|
|
107
118
|
overage_before:,
|
|
108
119
|
transaction_type:,
|
|
@@ -126,6 +137,7 @@ module Dodopayments
|
|
|
126
137
|
credit_entitlement_id: String,
|
|
127
138
|
customer_id: String,
|
|
128
139
|
is_credit: T::Boolean,
|
|
140
|
+
metadata: T::Hash[Symbol, String],
|
|
129
141
|
overage_after: String,
|
|
130
142
|
overage_before: String,
|
|
131
143
|
transaction_type:
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Entitlements
|
|
6
|
+
class GrantFulfillLicenseKeyParams < Dodopayments::Internal::Type::BaseModel
|
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Dodopayments::Entitlements::GrantFulfillLicenseKeyParams,
|
|
14
|
+
Dodopayments::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :grant_id
|
|
20
|
+
|
|
21
|
+
# The license key value to deliver to the customer.
|
|
22
|
+
sig { returns(String) }
|
|
23
|
+
attr_accessor :key
|
|
24
|
+
|
|
25
|
+
# Per-key activation limit. Defaults to the entitlement's license-key
|
|
26
|
+
# configuration.
|
|
27
|
+
sig { returns(T.nilable(Integer)) }
|
|
28
|
+
attr_accessor :activations_limit
|
|
29
|
+
|
|
30
|
+
# When the key expires. Defaults to the duration in the entitlement's license-key
|
|
31
|
+
# configuration.
|
|
32
|
+
sig { returns(T.nilable(Time)) }
|
|
33
|
+
attr_accessor :expires_at
|
|
34
|
+
|
|
35
|
+
sig do
|
|
36
|
+
params(
|
|
37
|
+
grant_id: String,
|
|
38
|
+
key: String,
|
|
39
|
+
activations_limit: T.nilable(Integer),
|
|
40
|
+
expires_at: T.nilable(Time),
|
|
41
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
42
|
+
).returns(T.attached_class)
|
|
43
|
+
end
|
|
44
|
+
def self.new(
|
|
45
|
+
grant_id:,
|
|
46
|
+
# The license key value to deliver to the customer.
|
|
47
|
+
key:,
|
|
48
|
+
# Per-key activation limit. Defaults to the entitlement's license-key
|
|
49
|
+
# configuration.
|
|
50
|
+
activations_limit: nil,
|
|
51
|
+
# When the key expires. Defaults to the duration in the entitlement's license-key
|
|
52
|
+
# configuration.
|
|
53
|
+
expires_at: nil,
|
|
54
|
+
request_options: {}
|
|
55
|
+
)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
sig do
|
|
59
|
+
override.returns(
|
|
60
|
+
{
|
|
61
|
+
grant_id: String,
|
|
62
|
+
key: String,
|
|
63
|
+
activations_limit: T.nilable(Integer),
|
|
64
|
+
expires_at: T.nilable(Time),
|
|
65
|
+
request_options: Dodopayments::RequestOptions
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
end
|
|
69
|
+
def to_hash
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -14,6 +14,7 @@ module Dodopayments
|
|
|
14
14
|
sig { returns(Integer) }
|
|
15
15
|
attr_accessor :count
|
|
16
16
|
|
|
17
|
+
# Unit of a duration count (e.g. license-key validity period).
|
|
17
18
|
sig { returns(Dodopayments::TimeInterval::OrSymbol) }
|
|
18
19
|
attr_accessor :interval
|
|
19
20
|
|
|
@@ -23,7 +24,11 @@ module Dodopayments
|
|
|
23
24
|
interval: Dodopayments::TimeInterval::OrSymbol
|
|
24
25
|
).returns(T.attached_class)
|
|
25
26
|
end
|
|
26
|
-
def self.new(
|
|
27
|
+
def self.new(
|
|
28
|
+
count:,
|
|
29
|
+
# Unit of a duration count (e.g. license-key validity period).
|
|
30
|
+
interval:
|
|
31
|
+
)
|
|
27
32
|
end
|
|
28
33
|
|
|
29
34
|
sig do
|
|
@@ -40,7 +40,7 @@ module Dodopayments
|
|
|
40
40
|
end
|
|
41
41
|
attr_writer :customer
|
|
42
42
|
|
|
43
|
-
#
|
|
43
|
+
# Whether the digital products purchased in this payment have been delivered.
|
|
44
44
|
sig { returns(T::Boolean) }
|
|
45
45
|
attr_accessor :digital_products_delivered
|
|
46
46
|
|
|
@@ -246,7 +246,7 @@ module Dodopayments
|
|
|
246
246
|
currency:,
|
|
247
247
|
# Details about the customer who made the payment
|
|
248
248
|
customer:,
|
|
249
|
-
#
|
|
249
|
+
# Whether the digital products purchased in this payment have been delivered.
|
|
250
250
|
digital_products_delivered:,
|
|
251
251
|
# List of disputes associated with this payment
|
|
252
252
|
disputes:,
|
|
@@ -212,6 +212,8 @@ module Dodopayments
|
|
|
212
212
|
NAVER_PAY =
|
|
213
213
|
T.let(:naver_pay, Dodopayments::PaymentMethodTypes::TaggedSymbol)
|
|
214
214
|
PAYCO = T.let(:payco, Dodopayments::PaymentMethodTypes::TaggedSymbol)
|
|
215
|
+
SATISPAY =
|
|
216
|
+
T.let(:satispay, Dodopayments::PaymentMethodTypes::TaggedSymbol)
|
|
215
217
|
|
|
216
218
|
sig do
|
|
217
219
|
override.returns(
|