dodopayments 2.17.1 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -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/metadata.rb +8 -0
- 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.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/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/metadata.rbi +11 -0
- 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.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_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,98 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Products
|
|
6
|
+
class LocalizedPrice < Dodopayments::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
Dodopayments::Products::LocalizedPrice,
|
|
11
|
+
Dodopayments::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Unique identifier for the localized price.
|
|
16
|
+
sig { returns(String) }
|
|
17
|
+
attr_accessor :id
|
|
18
|
+
|
|
19
|
+
# Amount in the smallest currency unit (e.g., cents).
|
|
20
|
+
sig { returns(Integer) }
|
|
21
|
+
attr_accessor :amount
|
|
22
|
+
|
|
23
|
+
# Timestamp when the localized price was created.
|
|
24
|
+
sig { returns(Time) }
|
|
25
|
+
attr_accessor :created_at
|
|
26
|
+
|
|
27
|
+
# Currency to charge in.
|
|
28
|
+
sig { returns(Dodopayments::Currency::TaggedSymbol) }
|
|
29
|
+
attr_accessor :currency
|
|
30
|
+
|
|
31
|
+
# Pricing mode of the rule: by_currency or by_country.
|
|
32
|
+
sig { returns(Dodopayments::Products::PricingMode::TaggedSymbol) }
|
|
33
|
+
attr_accessor :mode
|
|
34
|
+
|
|
35
|
+
# Product this localized price belongs to.
|
|
36
|
+
sig { returns(String) }
|
|
37
|
+
attr_accessor :product_id
|
|
38
|
+
|
|
39
|
+
# Timestamp when the localized price was last updated.
|
|
40
|
+
sig { returns(Time) }
|
|
41
|
+
attr_accessor :updated_at
|
|
42
|
+
|
|
43
|
+
# Country the rule applies to. Only set when mode is by_country.
|
|
44
|
+
sig { returns(T.nilable(Dodopayments::CountryCode::TaggedSymbol)) }
|
|
45
|
+
attr_accessor :country_code
|
|
46
|
+
|
|
47
|
+
sig do
|
|
48
|
+
params(
|
|
49
|
+
id: String,
|
|
50
|
+
amount: Integer,
|
|
51
|
+
created_at: Time,
|
|
52
|
+
currency: Dodopayments::Currency::OrSymbol,
|
|
53
|
+
mode: Dodopayments::Products::PricingMode::OrSymbol,
|
|
54
|
+
product_id: String,
|
|
55
|
+
updated_at: Time,
|
|
56
|
+
country_code: T.nilable(Dodopayments::CountryCode::OrSymbol)
|
|
57
|
+
).returns(T.attached_class)
|
|
58
|
+
end
|
|
59
|
+
def self.new(
|
|
60
|
+
# Unique identifier for the localized price.
|
|
61
|
+
id:,
|
|
62
|
+
# Amount in the smallest currency unit (e.g., cents).
|
|
63
|
+
amount:,
|
|
64
|
+
# Timestamp when the localized price was created.
|
|
65
|
+
created_at:,
|
|
66
|
+
# Currency to charge in.
|
|
67
|
+
currency:,
|
|
68
|
+
# Pricing mode of the rule: by_currency or by_country.
|
|
69
|
+
mode:,
|
|
70
|
+
# Product this localized price belongs to.
|
|
71
|
+
product_id:,
|
|
72
|
+
# Timestamp when the localized price was last updated.
|
|
73
|
+
updated_at:,
|
|
74
|
+
# Country the rule applies to. Only set when mode is by_country.
|
|
75
|
+
country_code: nil
|
|
76
|
+
)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
sig do
|
|
80
|
+
override.returns(
|
|
81
|
+
{
|
|
82
|
+
id: String,
|
|
83
|
+
amount: Integer,
|
|
84
|
+
created_at: Time,
|
|
85
|
+
currency: Dodopayments::Currency::TaggedSymbol,
|
|
86
|
+
mode: Dodopayments::Products::PricingMode::TaggedSymbol,
|
|
87
|
+
product_id: String,
|
|
88
|
+
updated_at: Time,
|
|
89
|
+
country_code: T.nilable(Dodopayments::CountryCode::TaggedSymbol)
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
end
|
|
93
|
+
def to_hash
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Products
|
|
6
|
+
class LocalizedPriceArchiveParams < 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::Products::LocalizedPriceArchiveParams,
|
|
14
|
+
Dodopayments::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :product_id
|
|
20
|
+
|
|
21
|
+
sig { returns(String) }
|
|
22
|
+
attr_accessor :id
|
|
23
|
+
|
|
24
|
+
sig do
|
|
25
|
+
params(
|
|
26
|
+
product_id: String,
|
|
27
|
+
id: String,
|
|
28
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
29
|
+
).returns(T.attached_class)
|
|
30
|
+
end
|
|
31
|
+
def self.new(product_id:, id:, request_options: {})
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
override.returns(
|
|
36
|
+
{
|
|
37
|
+
product_id: String,
|
|
38
|
+
id: String,
|
|
39
|
+
request_options: Dodopayments::RequestOptions
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
def to_hash
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Products
|
|
6
|
+
class LocalizedPriceCreateParams < 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::Products::LocalizedPriceCreateParams,
|
|
14
|
+
Dodopayments::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :product_id
|
|
20
|
+
|
|
21
|
+
# Amount in the smallest currency unit (e.g., cents). Must be greater than zero.
|
|
22
|
+
sig { returns(Integer) }
|
|
23
|
+
attr_accessor :amount
|
|
24
|
+
|
|
25
|
+
# Currency to charge in. Must be a supported currency.
|
|
26
|
+
sig { returns(Dodopayments::Currency::OrSymbol) }
|
|
27
|
+
attr_accessor :currency
|
|
28
|
+
|
|
29
|
+
# Required when the product's pricing_mode is by_country; forbidden when
|
|
30
|
+
# by_currency.
|
|
31
|
+
sig { returns(T.nilable(Dodopayments::CountryCode::OrSymbol)) }
|
|
32
|
+
attr_accessor :country_code
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
params(
|
|
36
|
+
product_id: String,
|
|
37
|
+
amount: Integer,
|
|
38
|
+
currency: Dodopayments::Currency::OrSymbol,
|
|
39
|
+
country_code: T.nilable(Dodopayments::CountryCode::OrSymbol),
|
|
40
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
41
|
+
).returns(T.attached_class)
|
|
42
|
+
end
|
|
43
|
+
def self.new(
|
|
44
|
+
product_id:,
|
|
45
|
+
# Amount in the smallest currency unit (e.g., cents). Must be greater than zero.
|
|
46
|
+
amount:,
|
|
47
|
+
# Currency to charge in. Must be a supported currency.
|
|
48
|
+
currency:,
|
|
49
|
+
# Required when the product's pricing_mode is by_country; forbidden when
|
|
50
|
+
# by_currency.
|
|
51
|
+
country_code: nil,
|
|
52
|
+
request_options: {}
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
sig do
|
|
57
|
+
override.returns(
|
|
58
|
+
{
|
|
59
|
+
product_id: String,
|
|
60
|
+
amount: Integer,
|
|
61
|
+
currency: Dodopayments::Currency::OrSymbol,
|
|
62
|
+
country_code: T.nilable(Dodopayments::CountryCode::OrSymbol),
|
|
63
|
+
request_options: Dodopayments::RequestOptions
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
end
|
|
67
|
+
def to_hash
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Products
|
|
6
|
+
class LocalizedPriceListParams < 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::Products::LocalizedPriceListParams,
|
|
14
|
+
Dodopayments::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :product_id
|
|
20
|
+
|
|
21
|
+
sig do
|
|
22
|
+
params(
|
|
23
|
+
product_id: String,
|
|
24
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
25
|
+
).returns(T.attached_class)
|
|
26
|
+
end
|
|
27
|
+
def self.new(product_id:, request_options: {})
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
override.returns(
|
|
32
|
+
{
|
|
33
|
+
product_id: String,
|
|
34
|
+
request_options: Dodopayments::RequestOptions
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
def to_hash
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Products
|
|
6
|
+
class LocalizedPriceRetrieveParams < 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::Products::LocalizedPriceRetrieveParams,
|
|
14
|
+
Dodopayments::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :product_id
|
|
20
|
+
|
|
21
|
+
sig { returns(String) }
|
|
22
|
+
attr_accessor :id
|
|
23
|
+
|
|
24
|
+
sig do
|
|
25
|
+
params(
|
|
26
|
+
product_id: String,
|
|
27
|
+
id: String,
|
|
28
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
29
|
+
).returns(T.attached_class)
|
|
30
|
+
end
|
|
31
|
+
def self.new(product_id:, id:, request_options: {})
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
override.returns(
|
|
36
|
+
{
|
|
37
|
+
product_id: String,
|
|
38
|
+
id: String,
|
|
39
|
+
request_options: Dodopayments::RequestOptions
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
def to_hash
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Products
|
|
6
|
+
class LocalizedPriceUpdateParams < 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::Products::LocalizedPriceUpdateParams,
|
|
14
|
+
Dodopayments::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :product_id
|
|
20
|
+
|
|
21
|
+
sig { returns(String) }
|
|
22
|
+
attr_accessor :id
|
|
23
|
+
|
|
24
|
+
# New amount in the smallest currency unit (e.g., cents). Must be greater than
|
|
25
|
+
# zero. The currency and country_code of an existing rule cannot be changed.
|
|
26
|
+
sig { returns(T.nilable(Integer)) }
|
|
27
|
+
attr_accessor :amount
|
|
28
|
+
|
|
29
|
+
sig do
|
|
30
|
+
params(
|
|
31
|
+
product_id: String,
|
|
32
|
+
id: String,
|
|
33
|
+
amount: T.nilable(Integer),
|
|
34
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
35
|
+
).returns(T.attached_class)
|
|
36
|
+
end
|
|
37
|
+
def self.new(
|
|
38
|
+
product_id:,
|
|
39
|
+
id:,
|
|
40
|
+
# New amount in the smallest currency unit (e.g., cents). Must be greater than
|
|
41
|
+
# zero. The currency and country_code of an existing rule cannot be changed.
|
|
42
|
+
amount: nil,
|
|
43
|
+
request_options: {}
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
sig do
|
|
48
|
+
override.returns(
|
|
49
|
+
{
|
|
50
|
+
product_id: String,
|
|
51
|
+
id: String,
|
|
52
|
+
amount: T.nilable(Integer),
|
|
53
|
+
request_options: Dodopayments::RequestOptions
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
end
|
|
57
|
+
def to_hash
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Products
|
|
6
|
+
module PricingMode
|
|
7
|
+
extend Dodopayments::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
TaggedSymbol =
|
|
10
|
+
T.type_alias { T.all(Symbol, Dodopayments::Products::PricingMode) }
|
|
11
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
12
|
+
|
|
13
|
+
BY_CURRENCY =
|
|
14
|
+
T.let(:by_currency, Dodopayments::Products::PricingMode::TaggedSymbol)
|
|
15
|
+
BY_COUNTRY =
|
|
16
|
+
T.let(:by_country, Dodopayments::Products::PricingMode::TaggedSymbol)
|
|
17
|
+
|
|
18
|
+
sig do
|
|
19
|
+
override.returns(
|
|
20
|
+
T::Array[Dodopayments::Products::PricingMode::TaggedSymbol]
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
def self.values
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
data/rbi/dodopayments/models.rbi
CHANGED
|
@@ -310,6 +310,12 @@ module Dodopayments
|
|
|
310
310
|
|
|
311
311
|
LicenseValidateParams = Dodopayments::Models::LicenseValidateParams
|
|
312
312
|
|
|
313
|
+
Metadata =
|
|
314
|
+
T.let(
|
|
315
|
+
Dodopayments::Models::Metadata,
|
|
316
|
+
Dodopayments::Internal::Type::Converter
|
|
317
|
+
)
|
|
318
|
+
|
|
313
319
|
Meter = Dodopayments::Models::Meter
|
|
314
320
|
|
|
315
321
|
MeterAggregation = Dodopayments::Models::MeterAggregation
|
|
@@ -35,6 +35,34 @@ module Dodopayments
|
|
|
35
35
|
)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
+
# For entitlements whose license-key config uses `manual` fulfillment, grants are
|
|
39
|
+
# created in the `pending` state without a key. Call this endpoint to deliver the
|
|
40
|
+
# key: the grant moves to `delivered`, the customer is emailed the key, and the
|
|
41
|
+
# `license_key.created` and `entitlement_grant.delivered` webhook events are sent.
|
|
42
|
+
sig do
|
|
43
|
+
params(
|
|
44
|
+
grant_id: String,
|
|
45
|
+
key: String,
|
|
46
|
+
activations_limit: T.nilable(Integer),
|
|
47
|
+
expires_at: T.nilable(Time),
|
|
48
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
49
|
+
).returns(Dodopayments::Entitlements::EntitlementGrant)
|
|
50
|
+
end
|
|
51
|
+
def fulfill_license_key(
|
|
52
|
+
# Grant ID
|
|
53
|
+
grant_id,
|
|
54
|
+
# The license key value to deliver to the customer.
|
|
55
|
+
key:,
|
|
56
|
+
# Per-key activation limit. Defaults to the entitlement's license-key
|
|
57
|
+
# configuration.
|
|
58
|
+
activations_limit: nil,
|
|
59
|
+
# When the key expires. Defaults to the duration in the entitlement's license-key
|
|
60
|
+
# configuration.
|
|
61
|
+
expires_at: nil,
|
|
62
|
+
request_options: {}
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
|
|
38
66
|
# Revoke a single grant. Idempotent: re-revoking an already-revoked grant returns
|
|
39
67
|
# the grant in its current state.
|
|
40
68
|
sig do
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Resources
|
|
5
|
+
class Products
|
|
6
|
+
class LocalizedPrices
|
|
7
|
+
sig do
|
|
8
|
+
params(
|
|
9
|
+
product_id: String,
|
|
10
|
+
amount: Integer,
|
|
11
|
+
currency: Dodopayments::Currency::OrSymbol,
|
|
12
|
+
country_code: T.nilable(Dodopayments::CountryCode::OrSymbol),
|
|
13
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
14
|
+
).returns(Dodopayments::Products::LocalizedPrice)
|
|
15
|
+
end
|
|
16
|
+
def create(
|
|
17
|
+
# Product Id
|
|
18
|
+
product_id,
|
|
19
|
+
# Amount in the smallest currency unit (e.g., cents). Must be greater than zero.
|
|
20
|
+
amount:,
|
|
21
|
+
# Currency to charge in. Must be a supported currency.
|
|
22
|
+
currency:,
|
|
23
|
+
# Required when the product's pricing_mode is by_country; forbidden when
|
|
24
|
+
# by_currency.
|
|
25
|
+
country_code: nil,
|
|
26
|
+
request_options: {}
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
params(
|
|
32
|
+
id: String,
|
|
33
|
+
product_id: String,
|
|
34
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
35
|
+
).returns(Dodopayments::Products::LocalizedPrice)
|
|
36
|
+
end
|
|
37
|
+
def retrieve(
|
|
38
|
+
# Localized Price Id
|
|
39
|
+
id,
|
|
40
|
+
# Product Id
|
|
41
|
+
product_id:,
|
|
42
|
+
request_options: {}
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
sig do
|
|
47
|
+
params(
|
|
48
|
+
id: String,
|
|
49
|
+
product_id: String,
|
|
50
|
+
amount: T.nilable(Integer),
|
|
51
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
52
|
+
).returns(Dodopayments::Products::LocalizedPrice)
|
|
53
|
+
end
|
|
54
|
+
def update(
|
|
55
|
+
# Path param: Localized Price Id
|
|
56
|
+
id,
|
|
57
|
+
# Path param: Product Id
|
|
58
|
+
product_id:,
|
|
59
|
+
# Body param: New amount in the smallest currency unit (e.g., cents). Must be
|
|
60
|
+
# greater than zero. The currency and country_code of an existing rule cannot be
|
|
61
|
+
# changed.
|
|
62
|
+
amount: nil,
|
|
63
|
+
request_options: {}
|
|
64
|
+
)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
sig do
|
|
68
|
+
params(
|
|
69
|
+
product_id: String,
|
|
70
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
71
|
+
).returns(Dodopayments::Products::ListLocalizedPricesResponse)
|
|
72
|
+
end
|
|
73
|
+
def list(
|
|
74
|
+
# Product Id
|
|
75
|
+
product_id,
|
|
76
|
+
request_options: {}
|
|
77
|
+
)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
sig do
|
|
81
|
+
params(
|
|
82
|
+
id: String,
|
|
83
|
+
product_id: String,
|
|
84
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
85
|
+
).void
|
|
86
|
+
end
|
|
87
|
+
def archive(
|
|
88
|
+
# Localized Price Id
|
|
89
|
+
id,
|
|
90
|
+
# Product Id
|
|
91
|
+
product_id:,
|
|
92
|
+
request_options: {}
|
|
93
|
+
)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# @api private
|
|
97
|
+
sig { params(client: Dodopayments::Client).returns(T.attached_class) }
|
|
98
|
+
def self.new(client:)
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
@@ -9,6 +9,9 @@ module Dodopayments
|
|
|
9
9
|
sig { returns(Dodopayments::Resources::Products::ShortLinks) }
|
|
10
10
|
attr_reader :short_links
|
|
11
11
|
|
|
12
|
+
sig { returns(Dodopayments::Resources::Products::LocalizedPrices) }
|
|
13
|
+
attr_reader :localized_prices
|
|
14
|
+
|
|
12
15
|
sig do
|
|
13
16
|
params(
|
|
14
17
|
name: String,
|
|
@@ -37,7 +40,7 @@ module Dodopayments
|
|
|
37
40
|
license_key_enabled: T.nilable(T::Boolean),
|
|
38
41
|
metadata: T::Hash[Symbol, String],
|
|
39
42
|
pricing_mode:
|
|
40
|
-
T.nilable(Dodopayments::
|
|
43
|
+
T.nilable(Dodopayments::Products::PricingMode::OrSymbol),
|
|
41
44
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
42
45
|
).returns(Dodopayments::Product)
|
|
43
46
|
end
|
|
@@ -139,7 +142,7 @@ module Dodopayments
|
|
|
139
142
|
)
|
|
140
143
|
),
|
|
141
144
|
pricing_mode:
|
|
142
|
-
T.nilable(Dodopayments::
|
|
145
|
+
T.nilable(Dodopayments::Products::PricingMode::OrSymbol),
|
|
143
146
|
tax_category: T.nilable(Dodopayments::TaxCategory::OrSymbol),
|
|
144
147
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
145
148
|
).void
|
|
@@ -17,7 +17,7 @@ module Dodopayments
|
|
|
17
17
|
feature_flags: Dodopayments::CheckoutSessionFlags,
|
|
18
18
|
:force_3ds => bool?,
|
|
19
19
|
mandate_min_amount_inr_paise: Integer?,
|
|
20
|
-
metadata: ::
|
|
20
|
+
metadata: Dodopayments::Models::metadata?,
|
|
21
21
|
minimal_address: bool,
|
|
22
22
|
payment_method_id: String?,
|
|
23
23
|
product_collection_id: String?,
|
|
@@ -69,7 +69,7 @@ module Dodopayments
|
|
|
69
69
|
|
|
70
70
|
attr_accessor mandate_min_amount_inr_paise: Integer?
|
|
71
71
|
|
|
72
|
-
attr_accessor metadata: ::
|
|
72
|
+
attr_accessor metadata: Dodopayments::Models::metadata?
|
|
73
73
|
|
|
74
74
|
attr_reader minimal_address: bool?
|
|
75
75
|
|
|
@@ -109,7 +109,7 @@ module Dodopayments
|
|
|
109
109
|
?feature_flags: Dodopayments::CheckoutSessionFlags,
|
|
110
110
|
?force_3ds: bool?,
|
|
111
111
|
?mandate_min_amount_inr_paise: Integer?,
|
|
112
|
-
?metadata: ::
|
|
112
|
+
?metadata: Dodopayments::Models::metadata?,
|
|
113
113
|
?minimal_address: bool,
|
|
114
114
|
?payment_method_id: String?,
|
|
115
115
|
?product_collection_id: String?,
|
|
@@ -136,7 +136,7 @@ module Dodopayments
|
|
|
136
136
|
feature_flags: Dodopayments::CheckoutSessionFlags,
|
|
137
137
|
:force_3ds => bool?,
|
|
138
138
|
mandate_min_amount_inr_paise: Integer?,
|
|
139
|
-
metadata: ::
|
|
139
|
+
metadata: Dodopayments::Models::metadata?,
|
|
140
140
|
minimal_address: bool,
|
|
141
141
|
payment_method_id: String?,
|
|
142
142
|
product_collection_id: String?,
|
|
@@ -9,7 +9,7 @@ module Dodopayments
|
|
|
9
9
|
entry_type: Dodopayments::Models::CreditEntitlements::ledger_entry_type,
|
|
10
10
|
expires_at: Time?,
|
|
11
11
|
idempotency_key: String?,
|
|
12
|
-
metadata: ::
|
|
12
|
+
metadata: Dodopayments::Models::metadata?,
|
|
13
13
|
reason: String?
|
|
14
14
|
}
|
|
15
15
|
& Dodopayments::Internal::Type::request_parameters
|
|
@@ -30,7 +30,7 @@ module Dodopayments
|
|
|
30
30
|
|
|
31
31
|
attr_accessor idempotency_key: String?
|
|
32
32
|
|
|
33
|
-
attr_accessor metadata: ::
|
|
33
|
+
attr_accessor metadata: Dodopayments::Models::metadata?
|
|
34
34
|
|
|
35
35
|
attr_accessor reason: String?
|
|
36
36
|
|
|
@@ -41,7 +41,7 @@ module Dodopayments
|
|
|
41
41
|
entry_type: Dodopayments::Models::CreditEntitlements::ledger_entry_type,
|
|
42
42
|
?expires_at: Time?,
|
|
43
43
|
?idempotency_key: String?,
|
|
44
|
-
?metadata: ::
|
|
44
|
+
?metadata: Dodopayments::Models::metadata?,
|
|
45
45
|
?reason: String?,
|
|
46
46
|
?request_options: Dodopayments::request_opts
|
|
47
47
|
) -> void
|
|
@@ -53,7 +53,7 @@ module Dodopayments
|
|
|
53
53
|
entry_type: Dodopayments::Models::CreditEntitlements::ledger_entry_type,
|
|
54
54
|
expires_at: Time?,
|
|
55
55
|
idempotency_key: String?,
|
|
56
|
-
metadata: ::
|
|
56
|
+
metadata: Dodopayments::Models::metadata?,
|
|
57
57
|
reason: String?,
|
|
58
58
|
request_options: Dodopayments::RequestOptions
|
|
59
59
|
}
|
|
@@ -15,7 +15,7 @@ module Dodopayments
|
|
|
15
15
|
source_type: Dodopayments::Models::CreditEntitlements::BalanceListGrantsResponse::source_type,
|
|
16
16
|
updated_at: Time,
|
|
17
17
|
expires_at: Time?,
|
|
18
|
-
metadata: ::
|
|
18
|
+
metadata: Dodopayments::Models::metadata?,
|
|
19
19
|
parent_grant_id: String?,
|
|
20
20
|
source_id: String?
|
|
21
21
|
}
|
|
@@ -45,7 +45,7 @@ module Dodopayments
|
|
|
45
45
|
|
|
46
46
|
attr_accessor expires_at: Time?
|
|
47
47
|
|
|
48
|
-
attr_accessor metadata: ::
|
|
48
|
+
attr_accessor metadata: Dodopayments::Models::metadata?
|
|
49
49
|
|
|
50
50
|
attr_accessor parent_grant_id: String?
|
|
51
51
|
|
|
@@ -64,7 +64,7 @@ module Dodopayments
|
|
|
64
64
|
source_type: Dodopayments::Models::CreditEntitlements::BalanceListGrantsResponse::source_type,
|
|
65
65
|
updated_at: Time,
|
|
66
66
|
?expires_at: Time?,
|
|
67
|
-
?metadata: ::
|
|
67
|
+
?metadata: Dodopayments::Models::metadata?,
|
|
68
68
|
?parent_grant_id: String?,
|
|
69
69
|
?source_id: String?
|
|
70
70
|
) -> void
|
|
@@ -82,7 +82,7 @@ module Dodopayments
|
|
|
82
82
|
source_type: Dodopayments::Models::CreditEntitlements::BalanceListGrantsResponse::source_type,
|
|
83
83
|
updated_at: Time,
|
|
84
84
|
expires_at: Time?,
|
|
85
|
-
metadata: ::
|
|
85
|
+
metadata: Dodopayments::Models::metadata?,
|
|
86
86
|
parent_grant_id: String?,
|
|
87
87
|
source_id: String?
|
|
88
88
|
}
|