dodopayments 2.18.0 → 2.19.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 +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/checkout_session_request.rb +5 -3
- 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/balance_create_ledger_entry_params.rb +5 -3
- data/lib/dodopayments/models/credit_entitlements/balance_list_grants_response.rb +24 -3
- data/lib/dodopayments/models/credit_entitlements/credit_ledger_entry.rb +3 -3
- data/lib/dodopayments/models/customer.rb +3 -3
- data/lib/dodopayments/models/customer_create_params.rb +3 -3
- data/lib/dodopayments/models/customer_limited_details.rb +3 -3
- data/lib/dodopayments/models/customer_list_entitlement_grants_params.rb +85 -0
- data/lib/dodopayments/models/customer_update_params.rb +5 -3
- data/lib/dodopayments/models/discount.rb +4 -3
- data/lib/dodopayments/models/discount_create_params.rb +3 -3
- data/lib/dodopayments/models/discount_detail.rb +3 -3
- data/lib/dodopayments/models/discount_update_params.rb +5 -3
- data/lib/dodopayments/models/entitlement.rb +5 -5
- data/lib/dodopayments/models/entitlement_create_params.rb +5 -5
- data/lib/dodopayments/models/entitlement_integration_type.rb +1 -0
- data/lib/dodopayments/models/entitlement_list_params.rb +1 -0
- data/lib/dodopayments/models/entitlement_update_params.rb +12 -5
- data/lib/dodopayments/models/entitlements/entitlement_grant.rb +13 -4
- data/lib/dodopayments/models/feature.rb +26 -0
- data/lib/dodopayments/models/feature_type.rb +15 -0
- data/lib/dodopayments/models/integration_config.rb +30 -1
- data/lib/dodopayments/models/integration_config_response.rb +22 -1
- data/lib/dodopayments/models/license_key_duration.rb +3 -1
- data/lib/dodopayments/models/metadata.rb +15 -1
- data/lib/dodopayments/models/payment.rb +5 -5
- data/lib/dodopayments/models/payment_create_params.rb +3 -3
- data/lib/dodopayments/models/payment_create_response.rb +3 -3
- data/lib/dodopayments/models/payment_list_response.rb +4 -3
- data/lib/dodopayments/models/product.rb +3 -3
- data/lib/dodopayments/models/product_create_params.rb +3 -3
- data/lib/dodopayments/models/product_entitlement_summary.rb +2 -2
- data/lib/dodopayments/models/product_list_response.rb +3 -3
- data/lib/dodopayments/models/product_update_params.rb +5 -3
- data/lib/dodopayments/models/refund.rb +3 -3
- data/lib/dodopayments/models/refund_create_params.rb +3 -3
- data/lib/dodopayments/models/subscription.rb +3 -3
- data/lib/dodopayments/models/subscription_charge_params.rb +5 -3
- data/lib/dodopayments/models/subscription_create_params.rb +3 -3
- data/lib/dodopayments/models/subscription_create_response.rb +3 -3
- data/lib/dodopayments/models/subscription_list_response.rb +3 -3
- data/lib/dodopayments/models/subscription_update_params.rb +18 -4
- data/lib/dodopayments/models/time_interval.rb +1 -0
- data/lib/dodopayments/models/update_subscription_plan_req.rb +5 -3
- data/lib/dodopayments/models.rb +8 -0
- data/lib/dodopayments/resources/checkout_sessions.rb +2 -2
- data/lib/dodopayments/resources/credit_entitlements/balances.rb +1 -1
- data/lib/dodopayments/resources/customers.rb +35 -2
- data/lib/dodopayments/resources/discounts.rb +2 -2
- data/lib/dodopayments/resources/entitlements.rb +4 -4
- data/lib/dodopayments/resources/payments.rb +1 -1
- data/lib/dodopayments/resources/products.rb +2 -2
- data/lib/dodopayments/resources/refunds.rb +1 -1
- data/lib/dodopayments/resources/subscriptions.rb +5 -5
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +3 -0
- data/rbi/dodopayments/models/attach_addon.rbi +6 -1
- data/rbi/dodopayments/models/checkout_session_flags.rbi +17 -0
- data/rbi/dodopayments/models/checkout_session_request.rbi +9 -3
- 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/balance_create_ledger_entry_params.rbi +11 -3
- data/rbi/dodopayments/models/credit_entitlements/balance_list_grants_response.rbi +13 -3
- data/rbi/dodopayments/models/credit_entitlements/credit_ledger_entry.rbi +3 -3
- data/rbi/dodopayments/models/customer.rbi +12 -4
- data/rbi/dodopayments/models/customer_create_params.rbi +12 -4
- data/rbi/dodopayments/models/customer_limited_details.rbi +12 -4
- data/rbi/dodopayments/models/customer_list_entitlement_grants_params.rbi +229 -0
- data/rbi/dodopayments/models/customer_update_params.rbi +9 -3
- data/rbi/dodopayments/models/discount.rbi +5 -3
- data/rbi/dodopayments/models/discount_create_params.rbi +12 -4
- data/rbi/dodopayments/models/discount_detail.rbi +3 -3
- data/rbi/dodopayments/models/discount_update_params.rbi +9 -3
- data/rbi/dodopayments/models/entitlement.rbi +4 -3
- data/rbi/dodopayments/models/entitlement_create_params.rbi +15 -4
- data/rbi/dodopayments/models/entitlement_integration_type.rbi +5 -0
- data/rbi/dodopayments/models/entitlement_list_params.rbi +5 -0
- data/rbi/dodopayments/models/entitlement_update_params.rbi +22 -3
- data/rbi/dodopayments/models/entitlements/entitlement_grant.rbi +16 -3
- data/rbi/dodopayments/models/feature.rbi +46 -0
- data/rbi/dodopayments/models/feature_type.rbi +21 -0
- data/rbi/dodopayments/models/integration_config.rbi +50 -0
- data/rbi/dodopayments/models/integration_config_response.rbi +44 -0
- data/rbi/dodopayments/models/license_key_duration.rbi +6 -1
- data/rbi/dodopayments/models/metadata.rbi +12 -1
- data/rbi/dodopayments/models/payment.rbi +5 -5
- data/rbi/dodopayments/models/payment_create_params.rbi +12 -4
- data/rbi/dodopayments/models/payment_create_response.rbi +3 -3
- data/rbi/dodopayments/models/payment_list_response.rbi +5 -3
- data/rbi/dodopayments/models/product.rbi +3 -3
- data/rbi/dodopayments/models/product_create_params.rbi +12 -4
- data/rbi/dodopayments/models/product_entitlement_summary.rbi +1 -0
- data/rbi/dodopayments/models/product_list_response.rbi +3 -3
- data/rbi/dodopayments/models/product_update_params.rbi +9 -3
- data/rbi/dodopayments/models/refund.rbi +3 -3
- data/rbi/dodopayments/models/refund_create_params.rbi +12 -4
- data/rbi/dodopayments/models/subscription.rbi +3 -3
- data/rbi/dodopayments/models/subscription_charge_params.rbi +9 -3
- data/rbi/dodopayments/models/subscription_create_params.rbi +12 -4
- data/rbi/dodopayments/models/subscription_create_response.rbi +3 -3
- data/rbi/dodopayments/models/subscription_list_response.rbi +3 -3
- data/rbi/dodopayments/models/subscription_update_params.rbi +13 -3
- data/rbi/dodopayments/models/time_interval.rbi +1 -0
- data/rbi/dodopayments/models/update_subscription_plan_req.rbi +9 -3
- data/rbi/dodopayments/models.rbi +9 -0
- data/rbi/dodopayments/resources/checkout_sessions.rbi +4 -2
- data/rbi/dodopayments/resources/credit_entitlements/balances.rbi +2 -1
- data/rbi/dodopayments/resources/customers.rbi +36 -2
- data/rbi/dodopayments/resources/discounts.rbi +3 -2
- data/rbi/dodopayments/resources/entitlements.rbi +10 -2
- data/rbi/dodopayments/resources/payments.rbi +1 -1
- data/rbi/dodopayments/resources/products.rbi +3 -2
- data/rbi/dodopayments/resources/refunds.rbi +1 -1
- data/rbi/dodopayments/resources/subscriptions.rbi +10 -5
- data/sig/dodopayments/models/checkout_session_flags.rbs +7 -0
- data/sig/dodopayments/models/customer_list_entitlement_grants_params.rbs +98 -0
- data/sig/dodopayments/models/entitlement_integration_type.rbs +2 -0
- data/sig/dodopayments/models/entitlement_list_params.rbs +2 -0
- data/sig/dodopayments/models/entitlements/entitlement_grant.rbs +5 -0
- data/sig/dodopayments/models/feature.rbs +22 -0
- data/sig/dodopayments/models/feature_type.rbs +13 -0
- data/sig/dodopayments/models/integration_config.rbs +21 -1
- data/sig/dodopayments/models/integration_config_response.rbs +21 -1
- data/sig/dodopayments/models/metadata.rbs +9 -1
- data/sig/dodopayments/models.rbs +8 -0
- data/sig/dodopayments/resources/customers.rbs +9 -0
- metadata +11 -2
|
@@ -43,7 +43,7 @@ module Dodopayments
|
|
|
43
43
|
attr_accessor :integration_type
|
|
44
44
|
|
|
45
45
|
# Arbitrary key-value metadata recorded on the grant.
|
|
46
|
-
sig { returns(T::Hash[Symbol,
|
|
46
|
+
sig { returns(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]) }
|
|
47
47
|
attr_accessor :metadata
|
|
48
48
|
|
|
49
49
|
# Lifecycle status of the grant.
|
|
@@ -83,6 +83,14 @@ module Dodopayments
|
|
|
83
83
|
sig { returns(T.nilable(String)) }
|
|
84
84
|
attr_accessor :error_message
|
|
85
85
|
|
|
86
|
+
# Typed feature payload, present only when the entitlement integration is
|
|
87
|
+
# `feature_flag`; `null` for every other integration type.
|
|
88
|
+
sig { returns(T.nilable(Dodopayments::Feature)) }
|
|
89
|
+
attr_reader :feature
|
|
90
|
+
|
|
91
|
+
sig { params(feature: T.nilable(Dodopayments::Feature::OrHash)).void }
|
|
92
|
+
attr_writer :feature
|
|
93
|
+
|
|
86
94
|
# License-key delivery payload, present when the entitlement integration is
|
|
87
95
|
# `license_key`.
|
|
88
96
|
sig { returns(T.nilable(Dodopayments::Entitlements::LicenseKeyGrant)) }
|
|
@@ -134,7 +142,7 @@ module Dodopayments
|
|
|
134
142
|
entitlement_id: String,
|
|
135
143
|
integration_type:
|
|
136
144
|
Dodopayments::EntitlementIntegrationType::OrSymbol,
|
|
137
|
-
metadata: T::Hash[Symbol,
|
|
145
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
138
146
|
status:
|
|
139
147
|
Dodopayments::Entitlements::EntitlementGrant::Status::OrSymbol,
|
|
140
148
|
updated_at: Time,
|
|
@@ -143,6 +151,7 @@ module Dodopayments
|
|
|
143
151
|
T.nilable(Dodopayments::DigitalProductDelivery::OrHash),
|
|
144
152
|
error_code: T.nilable(String),
|
|
145
153
|
error_message: T.nilable(String),
|
|
154
|
+
feature: T.nilable(Dodopayments::Feature::OrHash),
|
|
146
155
|
license_key:
|
|
147
156
|
T.nilable(Dodopayments::Entitlements::LicenseKeyGrant::OrHash),
|
|
148
157
|
oauth_expires_at: T.nilable(Time),
|
|
@@ -183,6 +192,9 @@ module Dodopayments
|
|
|
183
192
|
error_code: nil,
|
|
184
193
|
# Human-readable message reported when delivery failed, when applicable.
|
|
185
194
|
error_message: nil,
|
|
195
|
+
# Typed feature payload, present only when the entitlement integration is
|
|
196
|
+
# `feature_flag`; `null` for every other integration type.
|
|
197
|
+
feature: nil,
|
|
186
198
|
# License-key delivery payload, present when the entitlement integration is
|
|
187
199
|
# `license_key`.
|
|
188
200
|
license_key: nil,
|
|
@@ -214,7 +226,7 @@ module Dodopayments
|
|
|
214
226
|
entitlement_id: String,
|
|
215
227
|
integration_type:
|
|
216
228
|
Dodopayments::EntitlementIntegrationType::TaggedSymbol,
|
|
217
|
-
metadata: T::Hash[Symbol,
|
|
229
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
218
230
|
status:
|
|
219
231
|
Dodopayments::Entitlements::EntitlementGrant::Status::TaggedSymbol,
|
|
220
232
|
updated_at: Time,
|
|
@@ -223,6 +235,7 @@ module Dodopayments
|
|
|
223
235
|
T.nilable(Dodopayments::DigitalProductDelivery),
|
|
224
236
|
error_code: T.nilable(String),
|
|
225
237
|
error_message: T.nilable(String),
|
|
238
|
+
feature: T.nilable(Dodopayments::Feature),
|
|
226
239
|
license_key:
|
|
227
240
|
T.nilable(Dodopayments::Entitlements::LicenseKeyGrant),
|
|
228
241
|
oauth_expires_at: T.nilable(Time),
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class Feature < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Dodopayments::Feature, Dodopayments::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Identifier of the capability this grant confers.
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
attr_accessor :feature_id
|
|
14
|
+
|
|
15
|
+
# Type of capability conferred.
|
|
16
|
+
sig { returns(Dodopayments::FeatureType::TaggedSymbol) }
|
|
17
|
+
attr_accessor :feature_type
|
|
18
|
+
|
|
19
|
+
# Capability conferred by a `feature_flag` grant.
|
|
20
|
+
sig do
|
|
21
|
+
params(
|
|
22
|
+
feature_id: String,
|
|
23
|
+
feature_type: Dodopayments::FeatureType::OrSymbol
|
|
24
|
+
).returns(T.attached_class)
|
|
25
|
+
end
|
|
26
|
+
def self.new(
|
|
27
|
+
# Identifier of the capability this grant confers.
|
|
28
|
+
feature_id:,
|
|
29
|
+
# Type of capability conferred.
|
|
30
|
+
feature_type:
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
override.returns(
|
|
36
|
+
{
|
|
37
|
+
feature_id: String,
|
|
38
|
+
feature_type: Dodopayments::FeatureType::TaggedSymbol
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
def to_hash
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
# Type of capability a `feature_flag` entitlement confers.
|
|
6
|
+
module FeatureType
|
|
7
|
+
extend Dodopayments::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
TaggedSymbol = T.type_alias { T.all(Symbol, Dodopayments::FeatureType) }
|
|
10
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
11
|
+
|
|
12
|
+
BOOLEAN = T.let(:boolean, Dodopayments::FeatureType::TaggedSymbol)
|
|
13
|
+
|
|
14
|
+
sig do
|
|
15
|
+
override.returns(T::Array[Dodopayments::FeatureType::TaggedSymbol])
|
|
16
|
+
end
|
|
17
|
+
def self.values
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -4,12 +4,17 @@ module Dodopayments
|
|
|
4
4
|
module Models
|
|
5
5
|
# Integration-specific configuration supplied when creating or updating an
|
|
6
6
|
# entitlement. The shape required matches the entitlement's `integration_type`.
|
|
7
|
+
#
|
|
8
|
+
# Untagged enum: variants are matched in order. `FeatureFlag` must precede
|
|
9
|
+
# `LicenseKey`, whose fields are all optional and would otherwise match a
|
|
10
|
+
# `feature_flag` config.
|
|
7
11
|
module IntegrationConfig
|
|
8
12
|
extend Dodopayments::Internal::Type::Union
|
|
9
13
|
|
|
10
14
|
Variants =
|
|
11
15
|
T.type_alias do
|
|
12
16
|
T.any(
|
|
17
|
+
Dodopayments::IntegrationConfig::FeatureFlagConfig,
|
|
13
18
|
Dodopayments::IntegrationConfig::GitHubConfig,
|
|
14
19
|
Dodopayments::IntegrationConfig::DiscordConfig,
|
|
15
20
|
Dodopayments::IntegrationConfig::TelegramConfig,
|
|
@@ -21,6 +26,51 @@ module Dodopayments
|
|
|
21
26
|
)
|
|
22
27
|
end
|
|
23
28
|
|
|
29
|
+
class FeatureFlagConfig < Dodopayments::Internal::Type::BaseModel
|
|
30
|
+
OrHash =
|
|
31
|
+
T.type_alias do
|
|
32
|
+
T.any(
|
|
33
|
+
Dodopayments::IntegrationConfig::FeatureFlagConfig,
|
|
34
|
+
Dodopayments::Internal::AnyHash
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Merchant-chosen identifier for the capability this entitlement unlocks. Not
|
|
39
|
+
# unique across entitlements.
|
|
40
|
+
sig { returns(String) }
|
|
41
|
+
attr_accessor :feature_id
|
|
42
|
+
|
|
43
|
+
# Type of capability conferred.
|
|
44
|
+
sig { returns(Dodopayments::FeatureType::OrSymbol) }
|
|
45
|
+
attr_accessor :feature_type
|
|
46
|
+
|
|
47
|
+
sig do
|
|
48
|
+
params(
|
|
49
|
+
feature_id: String,
|
|
50
|
+
feature_type: Dodopayments::FeatureType::OrSymbol
|
|
51
|
+
).returns(T.attached_class)
|
|
52
|
+
end
|
|
53
|
+
def self.new(
|
|
54
|
+
# Merchant-chosen identifier for the capability this entitlement unlocks. Not
|
|
55
|
+
# unique across entitlements.
|
|
56
|
+
feature_id:,
|
|
57
|
+
# Type of capability conferred.
|
|
58
|
+
feature_type:
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
sig do
|
|
63
|
+
override.returns(
|
|
64
|
+
{
|
|
65
|
+
feature_id: String,
|
|
66
|
+
feature_type: Dodopayments::FeatureType::OrSymbol
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
end
|
|
70
|
+
def to_hash
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
24
74
|
class GitHubConfig < Dodopayments::Internal::Type::BaseModel
|
|
25
75
|
OrHash =
|
|
26
76
|
T.type_alias do
|
|
@@ -12,6 +12,7 @@ module Dodopayments
|
|
|
12
12
|
Variants =
|
|
13
13
|
T.type_alias do
|
|
14
14
|
T.any(
|
|
15
|
+
Dodopayments::IntegrationConfigResponse::FeatureFlagConfig,
|
|
15
16
|
Dodopayments::IntegrationConfigResponse::GitHubConfig,
|
|
16
17
|
Dodopayments::IntegrationConfigResponse::DiscordConfig,
|
|
17
18
|
Dodopayments::IntegrationConfigResponse::TelegramConfig,
|
|
@@ -23,6 +24,49 @@ module Dodopayments
|
|
|
23
24
|
)
|
|
24
25
|
end
|
|
25
26
|
|
|
27
|
+
class FeatureFlagConfig < Dodopayments::Internal::Type::BaseModel
|
|
28
|
+
OrHash =
|
|
29
|
+
T.type_alias do
|
|
30
|
+
T.any(
|
|
31
|
+
Dodopayments::IntegrationConfigResponse::FeatureFlagConfig,
|
|
32
|
+
Dodopayments::Internal::AnyHash
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Merchant-chosen identifier for the capability this entitlement unlocks.
|
|
37
|
+
sig { returns(String) }
|
|
38
|
+
attr_accessor :feature_id
|
|
39
|
+
|
|
40
|
+
# Type of capability conferred. Only `boolean` is supported today.
|
|
41
|
+
sig { returns(Dodopayments::FeatureType::TaggedSymbol) }
|
|
42
|
+
attr_accessor :feature_type
|
|
43
|
+
|
|
44
|
+
sig do
|
|
45
|
+
params(
|
|
46
|
+
feature_id: String,
|
|
47
|
+
feature_type: Dodopayments::FeatureType::OrSymbol
|
|
48
|
+
).returns(T.attached_class)
|
|
49
|
+
end
|
|
50
|
+
def self.new(
|
|
51
|
+
# Merchant-chosen identifier for the capability this entitlement unlocks.
|
|
52
|
+
feature_id:,
|
|
53
|
+
# Type of capability conferred. Only `boolean` is supported today.
|
|
54
|
+
feature_type:
|
|
55
|
+
)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
sig do
|
|
59
|
+
override.returns(
|
|
60
|
+
{
|
|
61
|
+
feature_id: String,
|
|
62
|
+
feature_type: Dodopayments::FeatureType::TaggedSymbol
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
end
|
|
66
|
+
def to_hash
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
26
70
|
class GitHubConfig < Dodopayments::Internal::Type::BaseModel
|
|
27
71
|
OrHash =
|
|
28
72
|
T.type_alias do
|
|
@@ -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
|
|
@@ -2,9 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
module Dodopayments
|
|
4
4
|
module Models
|
|
5
|
+
# Metadata value can be a string, integer, number, or boolean
|
|
6
|
+
module MetadataItem
|
|
7
|
+
extend Dodopayments::Internal::Type::Union
|
|
8
|
+
|
|
9
|
+
Variants = T.type_alias { T.any(String, Float, T::Boolean) }
|
|
10
|
+
|
|
11
|
+
sig { override.returns(T::Array[Dodopayments::MetadataItem::Variants]) }
|
|
12
|
+
def self.variants
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
5
16
|
Metadata =
|
|
6
17
|
T.let(
|
|
7
|
-
Dodopayments::Internal::Type::HashOf[
|
|
18
|
+
Dodopayments::Internal::Type::HashOf[union: Dodopayments::MetadataItem],
|
|
8
19
|
Dodopayments::Internal::Type::Converter
|
|
9
20
|
)
|
|
10
21
|
end
|
|
@@ -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
|
|
|
@@ -49,7 +49,7 @@ module Dodopayments
|
|
|
49
49
|
attr_accessor :disputes
|
|
50
50
|
|
|
51
51
|
# Additional custom data associated with the payment
|
|
52
|
-
sig { returns(T::Hash[Symbol,
|
|
52
|
+
sig { returns(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]) }
|
|
53
53
|
attr_accessor :metadata
|
|
54
54
|
|
|
55
55
|
# Unique identifier for the payment
|
|
@@ -198,7 +198,7 @@ module Dodopayments
|
|
|
198
198
|
customer: Dodopayments::CustomerLimitedDetails::OrHash,
|
|
199
199
|
digital_products_delivered: T::Boolean,
|
|
200
200
|
disputes: T::Array[Dodopayments::Dispute::OrHash],
|
|
201
|
-
metadata: T::Hash[Symbol,
|
|
201
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
202
202
|
payment_id: String,
|
|
203
203
|
payment_provider: Dodopayments::Payment::PaymentProvider::OrSymbol,
|
|
204
204
|
refunds: T::Array[Dodopayments::RefundListItem::OrHash],
|
|
@@ -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:,
|
|
@@ -340,7 +340,7 @@ module Dodopayments
|
|
|
340
340
|
customer: Dodopayments::CustomerLimitedDetails,
|
|
341
341
|
digital_products_delivered: T::Boolean,
|
|
342
342
|
disputes: T::Array[Dodopayments::Dispute],
|
|
343
|
-
metadata: T::Hash[Symbol,
|
|
343
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
344
344
|
payment_id: String,
|
|
345
345
|
payment_provider:
|
|
346
346
|
Dodopayments::Payment::PaymentProvider::TaggedSymbol,
|
|
@@ -76,10 +76,18 @@ module Dodopayments
|
|
|
76
76
|
|
|
77
77
|
# Additional metadata associated with the payment. Defaults to empty if not
|
|
78
78
|
# provided.
|
|
79
|
-
sig
|
|
79
|
+
sig do
|
|
80
|
+
returns(
|
|
81
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants])
|
|
82
|
+
)
|
|
83
|
+
end
|
|
80
84
|
attr_reader :metadata
|
|
81
85
|
|
|
82
|
-
sig
|
|
86
|
+
sig do
|
|
87
|
+
params(
|
|
88
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants]
|
|
89
|
+
).void
|
|
90
|
+
end
|
|
83
91
|
attr_writer :metadata
|
|
84
92
|
|
|
85
93
|
# Whether to generate a payment link. Defaults to false if not specified.
|
|
@@ -147,7 +155,7 @@ module Dodopayments
|
|
|
147
155
|
discount_code: T.nilable(String),
|
|
148
156
|
discount_codes: T.nilable(T::Array[String]),
|
|
149
157
|
force_3ds: T.nilable(T::Boolean),
|
|
150
|
-
metadata: T::Hash[Symbol,
|
|
158
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
151
159
|
payment_link: T.nilable(T::Boolean),
|
|
152
160
|
payment_method_id: T.nilable(String),
|
|
153
161
|
redirect_immediately: T::Boolean,
|
|
@@ -239,7 +247,7 @@ module Dodopayments
|
|
|
239
247
|
discount_code: T.nilable(String),
|
|
240
248
|
discount_codes: T.nilable(T::Array[String]),
|
|
241
249
|
force_3ds: T.nilable(T::Boolean),
|
|
242
|
-
metadata: T::Hash[Symbol,
|
|
250
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
243
251
|
payment_link: T.nilable(T::Boolean),
|
|
244
252
|
payment_method_id: T.nilable(String),
|
|
245
253
|
redirect_immediately: T::Boolean,
|
|
@@ -26,7 +26,7 @@ module Dodopayments
|
|
|
26
26
|
attr_writer :customer
|
|
27
27
|
|
|
28
28
|
# Additional metadata associated with the payment
|
|
29
|
-
sig { returns(T::Hash[Symbol,
|
|
29
|
+
sig { returns(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]) }
|
|
30
30
|
attr_accessor :metadata
|
|
31
31
|
|
|
32
32
|
# Unique identifier for the payment
|
|
@@ -63,7 +63,7 @@ module Dodopayments
|
|
|
63
63
|
params(
|
|
64
64
|
client_secret: String,
|
|
65
65
|
customer: Dodopayments::CustomerLimitedDetails::OrHash,
|
|
66
|
-
metadata: T::Hash[Symbol,
|
|
66
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
67
67
|
payment_id: String,
|
|
68
68
|
total_amount: Integer,
|
|
69
69
|
discount_id: T.nilable(String),
|
|
@@ -106,7 +106,7 @@ module Dodopayments
|
|
|
106
106
|
{
|
|
107
107
|
client_secret: String,
|
|
108
108
|
customer: Dodopayments::CustomerLimitedDetails,
|
|
109
|
-
metadata: T::Hash[Symbol,
|
|
109
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
110
110
|
payment_id: String,
|
|
111
111
|
total_amount: Integer,
|
|
112
112
|
discount_id: T.nilable(String),
|
|
@@ -34,7 +34,8 @@ module Dodopayments
|
|
|
34
34
|
sig { returns(T::Boolean) }
|
|
35
35
|
attr_accessor :has_license_key
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
# Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
|
|
38
|
+
sig { returns(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]) }
|
|
38
39
|
attr_accessor :metadata
|
|
39
40
|
|
|
40
41
|
sig { returns(String) }
|
|
@@ -99,7 +100,7 @@ module Dodopayments
|
|
|
99
100
|
customer: Dodopayments::CustomerLimitedDetails::OrHash,
|
|
100
101
|
digital_products_delivered: T::Boolean,
|
|
101
102
|
has_license_key: T::Boolean,
|
|
102
|
-
metadata: T::Hash[Symbol,
|
|
103
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
103
104
|
payment_id: String,
|
|
104
105
|
payment_provider:
|
|
105
106
|
Dodopayments::Models::PaymentListResponse::PaymentProvider::OrSymbol,
|
|
@@ -123,6 +124,7 @@ module Dodopayments
|
|
|
123
124
|
customer:,
|
|
124
125
|
digital_products_delivered:,
|
|
125
126
|
has_license_key:,
|
|
127
|
+
# Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
|
|
126
128
|
metadata:,
|
|
127
129
|
payment_id:,
|
|
128
130
|
# Which processor handled this payment. `stripe` / `adyen` for BYOP routes (the
|
|
@@ -158,7 +160,7 @@ module Dodopayments
|
|
|
158
160
|
customer: Dodopayments::CustomerLimitedDetails,
|
|
159
161
|
digital_products_delivered: T::Boolean,
|
|
160
162
|
has_license_key: T::Boolean,
|
|
161
|
-
metadata: T::Hash[Symbol,
|
|
163
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
162
164
|
payment_id: String,
|
|
163
165
|
payment_provider:
|
|
164
166
|
Dodopayments::Models::PaymentListResponse::PaymentProvider::TaggedSymbol,
|
|
@@ -36,7 +36,7 @@ module Dodopayments
|
|
|
36
36
|
attr_accessor :license_key_enabled
|
|
37
37
|
|
|
38
38
|
# Additional custom data associated with the product
|
|
39
|
-
sig { returns(T::Hash[Symbol,
|
|
39
|
+
sig { returns(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]) }
|
|
40
40
|
attr_accessor :metadata
|
|
41
41
|
|
|
42
42
|
# Pricing information for the product.
|
|
@@ -126,7 +126,7 @@ module Dodopayments
|
|
|
126
126
|
T::Array[Dodopayments::ProductEntitlementSummary::OrHash],
|
|
127
127
|
is_recurring: T::Boolean,
|
|
128
128
|
license_key_enabled: T::Boolean,
|
|
129
|
-
metadata: T::Hash[Symbol,
|
|
129
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
130
130
|
price:
|
|
131
131
|
T.any(
|
|
132
132
|
Dodopayments::Price::OneTimePrice::OrHash,
|
|
@@ -211,7 +211,7 @@ module Dodopayments
|
|
|
211
211
|
entitlements: T::Array[Dodopayments::ProductEntitlementSummary],
|
|
212
212
|
is_recurring: T::Boolean,
|
|
213
213
|
license_key_enabled: T::Boolean,
|
|
214
|
-
metadata: T::Hash[Symbol,
|
|
214
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
215
215
|
price: Dodopayments::Price::Variants,
|
|
216
216
|
product_id: String,
|
|
217
217
|
tax_category: Dodopayments::TaxCategory::TaggedSymbol,
|
|
@@ -118,10 +118,18 @@ module Dodopayments
|
|
|
118
118
|
attr_accessor :license_key_enabled
|
|
119
119
|
|
|
120
120
|
# Additional metadata for the product
|
|
121
|
-
sig
|
|
121
|
+
sig do
|
|
122
|
+
returns(
|
|
123
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants])
|
|
124
|
+
)
|
|
125
|
+
end
|
|
122
126
|
attr_reader :metadata
|
|
123
127
|
|
|
124
|
-
sig
|
|
128
|
+
sig do
|
|
129
|
+
params(
|
|
130
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants]
|
|
131
|
+
).void
|
|
132
|
+
end
|
|
125
133
|
attr_writer :metadata
|
|
126
134
|
|
|
127
135
|
# Pricing mode for localized pricing. When set, rules from
|
|
@@ -156,7 +164,7 @@ module Dodopayments
|
|
|
156
164
|
license_key_duration:
|
|
157
165
|
T.nilable(Dodopayments::LicenseKeyDuration::OrHash),
|
|
158
166
|
license_key_enabled: T.nilable(T::Boolean),
|
|
159
|
-
metadata: T::Hash[Symbol,
|
|
167
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
160
168
|
pricing_mode:
|
|
161
169
|
T.nilable(Dodopayments::Products::PricingMode::OrSymbol),
|
|
162
170
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
@@ -242,7 +250,7 @@ module Dodopayments
|
|
|
242
250
|
license_key_activations_limit: T.nilable(Integer),
|
|
243
251
|
license_key_duration: T.nilable(Dodopayments::LicenseKeyDuration),
|
|
244
252
|
license_key_enabled: T.nilable(T::Boolean),
|
|
245
|
-
metadata: T::Hash[Symbol,
|
|
253
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
246
254
|
pricing_mode:
|
|
247
255
|
T.nilable(Dodopayments::Products::PricingMode::OrSymbol),
|
|
248
256
|
request_options: Dodopayments::RequestOptions
|
|
@@ -41,6 +41,7 @@ module Dodopayments
|
|
|
41
41
|
id: String,
|
|
42
42
|
integration_config:
|
|
43
43
|
T.any(
|
|
44
|
+
Dodopayments::IntegrationConfigResponse::FeatureFlagConfig::OrHash,
|
|
44
45
|
Dodopayments::IntegrationConfigResponse::GitHubConfig::OrHash,
|
|
45
46
|
Dodopayments::IntegrationConfigResponse::DiscordConfig::OrHash,
|
|
46
47
|
Dodopayments::IntegrationConfigResponse::TelegramConfig::OrHash,
|
|
@@ -28,7 +28,7 @@ module Dodopayments
|
|
|
28
28
|
attr_accessor :is_recurring
|
|
29
29
|
|
|
30
30
|
# Additional custom data associated with the product
|
|
31
|
-
sig { returns(T::Hash[Symbol,
|
|
31
|
+
sig { returns(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]) }
|
|
32
32
|
attr_accessor :metadata
|
|
33
33
|
|
|
34
34
|
# Unique identifier for the product.
|
|
@@ -94,7 +94,7 @@ module Dodopayments
|
|
|
94
94
|
entitlements:
|
|
95
95
|
T::Array[Dodopayments::ProductEntitlementSummary::OrHash],
|
|
96
96
|
is_recurring: T::Boolean,
|
|
97
|
-
metadata: T::Hash[Symbol,
|
|
97
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
98
98
|
product_id: String,
|
|
99
99
|
tax_category: Dodopayments::TaxCategory::OrSymbol,
|
|
100
100
|
updated_at: Time,
|
|
@@ -169,7 +169,7 @@ module Dodopayments
|
|
|
169
169
|
created_at: Time,
|
|
170
170
|
entitlements: T::Array[Dodopayments::ProductEntitlementSummary],
|
|
171
171
|
is_recurring: T::Boolean,
|
|
172
|
-
metadata: T::Hash[Symbol,
|
|
172
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
173
173
|
product_id: String,
|
|
174
174
|
tax_category: Dodopayments::TaxCategory::TaggedSymbol,
|
|
175
175
|
updated_at: Time,
|
|
@@ -111,7 +111,11 @@ module Dodopayments
|
|
|
111
111
|
attr_accessor :license_key_enabled
|
|
112
112
|
|
|
113
113
|
# Additional metadata for the product
|
|
114
|
-
sig
|
|
114
|
+
sig do
|
|
115
|
+
returns(
|
|
116
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants])
|
|
117
|
+
)
|
|
118
|
+
end
|
|
115
119
|
attr_accessor :metadata
|
|
116
120
|
|
|
117
121
|
# Name of the product, optional and must be at most 100 characters.
|
|
@@ -162,7 +166,8 @@ module Dodopayments
|
|
|
162
166
|
license_key_duration:
|
|
163
167
|
T.nilable(Dodopayments::LicenseKeyDuration::OrHash),
|
|
164
168
|
license_key_enabled: T.nilable(T::Boolean),
|
|
165
|
-
metadata:
|
|
169
|
+
metadata:
|
|
170
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
166
171
|
name: T.nilable(String),
|
|
167
172
|
price:
|
|
168
173
|
T.nilable(
|
|
@@ -261,7 +266,8 @@ module Dodopayments
|
|
|
261
266
|
license_key_activations_limit: T.nilable(Integer),
|
|
262
267
|
license_key_duration: T.nilable(Dodopayments::LicenseKeyDuration),
|
|
263
268
|
license_key_enabled: T.nilable(T::Boolean),
|
|
264
|
-
metadata:
|
|
269
|
+
metadata:
|
|
270
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
265
271
|
name: T.nilable(String),
|
|
266
272
|
price:
|
|
267
273
|
T.nilable(
|
|
@@ -34,7 +34,7 @@ module Dodopayments
|
|
|
34
34
|
attr_accessor :is_partial
|
|
35
35
|
|
|
36
36
|
# Additional metadata stored with the refund.
|
|
37
|
-
sig { returns(T::Hash[Symbol,
|
|
37
|
+
sig { returns(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]) }
|
|
38
38
|
attr_accessor :metadata
|
|
39
39
|
|
|
40
40
|
# The unique identifier of the payment associated with the refund.
|
|
@@ -68,7 +68,7 @@ module Dodopayments
|
|
|
68
68
|
created_at: Time,
|
|
69
69
|
customer: Dodopayments::CustomerLimitedDetails::OrHash,
|
|
70
70
|
is_partial: T::Boolean,
|
|
71
|
-
metadata: T::Hash[Symbol,
|
|
71
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
72
72
|
payment_id: String,
|
|
73
73
|
refund_id: String,
|
|
74
74
|
status: Dodopayments::RefundStatus::OrSymbol,
|
|
@@ -113,7 +113,7 @@ module Dodopayments
|
|
|
113
113
|
created_at: Time,
|
|
114
114
|
customer: Dodopayments::CustomerLimitedDetails,
|
|
115
115
|
is_partial: T::Boolean,
|
|
116
|
-
metadata: T::Hash[Symbol,
|
|
116
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
117
117
|
payment_id: String,
|
|
118
118
|
refund_id: String,
|
|
119
119
|
status: Dodopayments::RefundStatus::TaggedSymbol,
|
|
@@ -25,10 +25,18 @@ module Dodopayments
|
|
|
25
25
|
attr_accessor :items
|
|
26
26
|
|
|
27
27
|
# Additional metadata associated with the refund.
|
|
28
|
-
sig
|
|
28
|
+
sig do
|
|
29
|
+
returns(
|
|
30
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants])
|
|
31
|
+
)
|
|
32
|
+
end
|
|
29
33
|
attr_reader :metadata
|
|
30
34
|
|
|
31
|
-
sig
|
|
35
|
+
sig do
|
|
36
|
+
params(
|
|
37
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants]
|
|
38
|
+
).void
|
|
39
|
+
end
|
|
32
40
|
attr_writer :metadata
|
|
33
41
|
|
|
34
42
|
# The reason for the refund, if any. Maximum length is 3000 characters. Optional.
|
|
@@ -40,7 +48,7 @@ module Dodopayments
|
|
|
40
48
|
payment_id: String,
|
|
41
49
|
items:
|
|
42
50
|
T.nilable(T::Array[Dodopayments::RefundCreateParams::Item::OrHash]),
|
|
43
|
-
metadata: T::Hash[Symbol,
|
|
51
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
44
52
|
reason: T.nilable(String),
|
|
45
53
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
46
54
|
).returns(T.attached_class)
|
|
@@ -63,7 +71,7 @@ module Dodopayments
|
|
|
63
71
|
{
|
|
64
72
|
payment_id: String,
|
|
65
73
|
items: T.nilable(T::Array[Dodopayments::RefundCreateParams::Item]),
|
|
66
|
-
metadata: T::Hash[Symbol,
|
|
74
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
67
75
|
reason: T.nilable(String),
|
|
68
76
|
request_options: Dodopayments::RequestOptions
|
|
69
77
|
}
|