dodopayments 2.18.1 → 2.20.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/addon_update_params.rb +6 -2
- data/lib/dodopayments/models/checkout_session_request.rb +5 -3
- 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/metadata.rb +15 -1
- data/lib/dodopayments/models/payment.rb +3 -3
- 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 +28 -4
- data/lib/dodopayments/models/update_subscription_plan_req.rb +5 -3
- data/lib/dodopayments/models.rb +8 -0
- data/lib/dodopayments/resources/addons.rb +4 -1
- 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 +10 -6
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +3 -0
- data/rbi/dodopayments/models/addon_update_params.rbi +4 -2
- data/rbi/dodopayments/models/checkout_session_request.rbi +9 -3
- 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/metadata.rbi +12 -1
- data/rbi/dodopayments/models/payment.rbi +3 -3
- 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 +39 -3
- data/rbi/dodopayments/models/update_subscription_plan_req.rbi +9 -3
- data/rbi/dodopayments/models.rbi +9 -0
- data/rbi/dodopayments/resources/addons.rbi +2 -1
- 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 +22 -5
- 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/subscription_update_params.rbs +10 -0
- data/sig/dodopayments/models.rbs +8 -0
- data/sig/dodopayments/resources/customers.rbs +9 -0
- data/sig/dodopayments/resources/subscriptions.rbs +2 -0
- metadata +11 -2
|
@@ -25,7 +25,7 @@ module Dodopayments
|
|
|
25
25
|
attr_writer :customer
|
|
26
26
|
|
|
27
27
|
# Additional metadata associated with the subscription
|
|
28
|
-
sig { returns(T::Hash[Symbol,
|
|
28
|
+
sig { returns(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]) }
|
|
29
29
|
attr_accessor :metadata
|
|
30
30
|
|
|
31
31
|
# First payment id for the subscription
|
|
@@ -79,7 +79,7 @@ module Dodopayments
|
|
|
79
79
|
params(
|
|
80
80
|
addons: T::Array[Dodopayments::AddonCartResponseItem::OrHash],
|
|
81
81
|
customer: Dodopayments::CustomerLimitedDetails::OrHash,
|
|
82
|
-
metadata: T::Hash[Symbol,
|
|
82
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
83
83
|
payment_id: String,
|
|
84
84
|
recurring_pre_tax_amount: Integer,
|
|
85
85
|
subscription_id: String,
|
|
@@ -132,7 +132,7 @@ module Dodopayments
|
|
|
132
132
|
{
|
|
133
133
|
addons: T::Array[Dodopayments::AddonCartResponseItem],
|
|
134
134
|
customer: Dodopayments::CustomerLimitedDetails,
|
|
135
|
-
metadata: T::Hash[Symbol,
|
|
135
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
136
136
|
payment_id: String,
|
|
137
137
|
recurring_pre_tax_amount: Integer,
|
|
138
138
|
subscription_id: String,
|
|
@@ -48,7 +48,7 @@ module Dodopayments
|
|
|
48
48
|
attr_accessor :discounts
|
|
49
49
|
|
|
50
50
|
# Additional custom data associated with the subscription
|
|
51
|
-
sig { returns(T::Hash[Symbol,
|
|
51
|
+
sig { returns(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]) }
|
|
52
52
|
attr_accessor :metadata
|
|
53
53
|
|
|
54
54
|
# Timestamp of the next scheduled billing. Indicates the end of current billing
|
|
@@ -161,7 +161,7 @@ module Dodopayments
|
|
|
161
161
|
T::Array[
|
|
162
162
|
Dodopayments::Models::SubscriptionListResponse::Discount::OrHash
|
|
163
163
|
],
|
|
164
|
-
metadata: T::Hash[Symbol,
|
|
164
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
165
165
|
next_billing_date: Time,
|
|
166
166
|
on_demand: T::Boolean,
|
|
167
167
|
payment_frequency_count: Integer,
|
|
@@ -264,7 +264,7 @@ module Dodopayments
|
|
|
264
264
|
T::Array[
|
|
265
265
|
Dodopayments::Models::SubscriptionListResponse::Discount
|
|
266
266
|
],
|
|
267
|
-
metadata: T::Hash[Symbol,
|
|
267
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
268
268
|
next_billing_date: Time,
|
|
269
269
|
on_demand: T::Boolean,
|
|
270
270
|
payment_frequency_count: Integer,
|
|
@@ -87,7 +87,12 @@ module Dodopayments
|
|
|
87
87
|
end
|
|
88
88
|
attr_writer :disable_on_demand
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
# Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
|
|
91
|
+
sig do
|
|
92
|
+
returns(
|
|
93
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants])
|
|
94
|
+
)
|
|
95
|
+
end
|
|
91
96
|
attr_accessor :metadata
|
|
92
97
|
|
|
93
98
|
sig { returns(T.nilable(Time)) }
|
|
@@ -96,6 +101,19 @@ module Dodopayments
|
|
|
96
101
|
sig { returns(T.nilable(Dodopayments::SubscriptionStatus::OrSymbol)) }
|
|
97
102
|
attr_accessor :status
|
|
98
103
|
|
|
104
|
+
# New number of `subscription_period_interval` units the subscription entitlement
|
|
105
|
+
# should span. Used together with `subscription_period_interval` to extend the
|
|
106
|
+
# subscription period. The resulting period must not be shorter than the current
|
|
107
|
+
# one (this endpoint only extends).
|
|
108
|
+
sig { returns(T.nilable(Integer)) }
|
|
109
|
+
attr_accessor :subscription_period_count
|
|
110
|
+
|
|
111
|
+
# New interval unit for the subscription period. When changing the period, this
|
|
112
|
+
# may be supplied alongside `subscription_period_count`; if omitted the existing
|
|
113
|
+
# interval is retained.
|
|
114
|
+
sig { returns(T.nilable(Dodopayments::TimeInterval::OrSymbol)) }
|
|
115
|
+
attr_accessor :subscription_period_interval
|
|
116
|
+
|
|
99
117
|
sig { returns(T.nilable(String)) }
|
|
100
118
|
attr_accessor :tax_id
|
|
101
119
|
|
|
@@ -123,9 +141,13 @@ module Dodopayments
|
|
|
123
141
|
T.nilable(
|
|
124
142
|
Dodopayments::SubscriptionUpdateParams::DisableOnDemand::OrHash
|
|
125
143
|
),
|
|
126
|
-
metadata:
|
|
144
|
+
metadata:
|
|
145
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
127
146
|
next_billing_date: T.nilable(Time),
|
|
128
147
|
status: T.nilable(Dodopayments::SubscriptionStatus::OrSymbol),
|
|
148
|
+
subscription_period_count: T.nilable(Integer),
|
|
149
|
+
subscription_period_interval:
|
|
150
|
+
T.nilable(Dodopayments::TimeInterval::OrSymbol),
|
|
129
151
|
tax_id: T.nilable(String),
|
|
130
152
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
131
153
|
).returns(T.attached_class)
|
|
@@ -151,9 +173,19 @@ module Dodopayments
|
|
|
151
173
|
customer_business_name: nil,
|
|
152
174
|
customer_name: nil,
|
|
153
175
|
disable_on_demand: nil,
|
|
176
|
+
# Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
|
|
154
177
|
metadata: nil,
|
|
155
178
|
next_billing_date: nil,
|
|
156
179
|
status: nil,
|
|
180
|
+
# New number of `subscription_period_interval` units the subscription entitlement
|
|
181
|
+
# should span. Used together with `subscription_period_interval` to extend the
|
|
182
|
+
# subscription period. The resulting period must not be shorter than the current
|
|
183
|
+
# one (this endpoint only extends).
|
|
184
|
+
subscription_period_count: nil,
|
|
185
|
+
# New interval unit for the subscription period. When changing the period, this
|
|
186
|
+
# may be supplied alongside `subscription_period_count`; if omitted the existing
|
|
187
|
+
# interval is retained.
|
|
188
|
+
subscription_period_interval: nil,
|
|
157
189
|
tax_id: nil,
|
|
158
190
|
request_options: {}
|
|
159
191
|
)
|
|
@@ -184,9 +216,13 @@ module Dodopayments
|
|
|
184
216
|
T.nilable(
|
|
185
217
|
Dodopayments::SubscriptionUpdateParams::DisableOnDemand
|
|
186
218
|
),
|
|
187
|
-
metadata:
|
|
219
|
+
metadata:
|
|
220
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
188
221
|
next_billing_date: T.nilable(Time),
|
|
189
222
|
status: T.nilable(Dodopayments::SubscriptionStatus::OrSymbol),
|
|
223
|
+
subscription_period_count: T.nilable(Integer),
|
|
224
|
+
subscription_period_interval:
|
|
225
|
+
T.nilable(Dodopayments::TimeInterval::OrSymbol),
|
|
190
226
|
tax_id: T.nilable(String),
|
|
191
227
|
request_options: Dodopayments::RequestOptions
|
|
192
228
|
}
|
|
@@ -72,7 +72,11 @@ module Dodopayments
|
|
|
72
72
|
|
|
73
73
|
# Metadata for the payment. If not passed, the metadata of the subscription will
|
|
74
74
|
# be taken
|
|
75
|
-
sig
|
|
75
|
+
sig do
|
|
76
|
+
returns(
|
|
77
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants])
|
|
78
|
+
)
|
|
79
|
+
end
|
|
76
80
|
attr_accessor :metadata
|
|
77
81
|
|
|
78
82
|
# Controls behavior when the plan change payment fails.
|
|
@@ -103,7 +107,8 @@ module Dodopayments
|
|
|
103
107
|
discount_codes: T.nilable(T::Array[String]),
|
|
104
108
|
effective_at:
|
|
105
109
|
Dodopayments::UpdateSubscriptionPlanReq::EffectiveAt::OrSymbol,
|
|
106
|
-
metadata:
|
|
110
|
+
metadata:
|
|
111
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
107
112
|
on_payment_failure:
|
|
108
113
|
T.nilable(
|
|
109
114
|
Dodopayments::UpdateSubscriptionPlanReq::OnPaymentFailure::OrSymbol
|
|
@@ -163,7 +168,8 @@ module Dodopayments
|
|
|
163
168
|
discount_codes: T.nilable(T::Array[String]),
|
|
164
169
|
effective_at:
|
|
165
170
|
Dodopayments::UpdateSubscriptionPlanReq::EffectiveAt::OrSymbol,
|
|
166
|
-
metadata:
|
|
171
|
+
metadata:
|
|
172
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
167
173
|
on_payment_failure:
|
|
168
174
|
T.nilable(
|
|
169
175
|
Dodopayments::UpdateSubscriptionPlanReq::OnPaymentFailure::OrSymbol
|
data/rbi/dodopayments/models.rbi
CHANGED
|
@@ -151,6 +151,9 @@ module Dodopayments
|
|
|
151
151
|
CustomerListCreditEntitlementsParams =
|
|
152
152
|
Dodopayments::Models::CustomerListCreditEntitlementsParams
|
|
153
153
|
|
|
154
|
+
CustomerListEntitlementGrantsParams =
|
|
155
|
+
Dodopayments::Models::CustomerListEntitlementGrantsParams
|
|
156
|
+
|
|
154
157
|
CustomerListEntitlementsParams =
|
|
155
158
|
Dodopayments::Models::CustomerListEntitlementsParams
|
|
156
159
|
|
|
@@ -260,6 +263,10 @@ module Dodopayments
|
|
|
260
263
|
|
|
261
264
|
EventInput = Dodopayments::Models::EventInput
|
|
262
265
|
|
|
266
|
+
Feature = Dodopayments::Models::Feature
|
|
267
|
+
|
|
268
|
+
FeatureType = Dodopayments::Models::FeatureType
|
|
269
|
+
|
|
263
270
|
FilterOperator = Dodopayments::Models::FilterOperator
|
|
264
271
|
|
|
265
272
|
FilterType = Dodopayments::Models::FilterType
|
|
@@ -316,6 +323,8 @@ module Dodopayments
|
|
|
316
323
|
Dodopayments::Internal::Type::Converter
|
|
317
324
|
)
|
|
318
325
|
|
|
326
|
+
MetadataItem = Dodopayments::Models::MetadataItem
|
|
327
|
+
|
|
319
328
|
Meter = Dodopayments::Models::Meter
|
|
320
329
|
|
|
321
330
|
MeterAggregation = Dodopayments::Models::MeterAggregation
|
|
@@ -60,7 +60,8 @@ module Dodopayments
|
|
|
60
60
|
currency: nil,
|
|
61
61
|
# Description of the Addon, optional and must be at most 1000 characters.
|
|
62
62
|
description: nil,
|
|
63
|
-
# Addon image id after its uploaded to S3
|
|
63
|
+
# Addon image id after its uploaded to S3. Pass `null` to remove the existing
|
|
64
|
+
# image, omit to keep it unchanged.
|
|
64
65
|
image_id: nil,
|
|
65
66
|
# Name of the Addon, optional and must be at most 100 characters.
|
|
66
67
|
name: nil,
|
|
@@ -28,7 +28,8 @@ module Dodopayments
|
|
|
28
28
|
feature_flags: Dodopayments::CheckoutSessionFlags::OrHash,
|
|
29
29
|
force_3ds: T.nilable(T::Boolean),
|
|
30
30
|
mandate_min_amount_inr_paise: T.nilable(Integer),
|
|
31
|
-
metadata:
|
|
31
|
+
metadata:
|
|
32
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
32
33
|
minimal_address: T::Boolean,
|
|
33
34
|
payment_method_id: T.nilable(String),
|
|
34
35
|
product_collection_id: T.nilable(String),
|
|
@@ -148,7 +149,8 @@ module Dodopayments
|
|
|
148
149
|
feature_flags: Dodopayments::CheckoutSessionFlags::OrHash,
|
|
149
150
|
force_3ds: T.nilable(T::Boolean),
|
|
150
151
|
mandate_min_amount_inr_paise: T.nilable(Integer),
|
|
151
|
-
metadata:
|
|
152
|
+
metadata:
|
|
153
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
152
154
|
minimal_address: T::Boolean,
|
|
153
155
|
payment_method_id: T.nilable(String),
|
|
154
156
|
product_collection_id: T.nilable(String),
|
|
@@ -121,7 +121,8 @@ module Dodopayments
|
|
|
121
121
|
Dodopayments::CreditEntitlements::LedgerEntryType::OrSymbol,
|
|
122
122
|
expires_at: T.nilable(Time),
|
|
123
123
|
idempotency_key: T.nilable(String),
|
|
124
|
-
metadata:
|
|
124
|
+
metadata:
|
|
125
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
125
126
|
reason: T.nilable(String),
|
|
126
127
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
127
128
|
).returns(
|
|
@@ -13,7 +13,7 @@ module Dodopayments
|
|
|
13
13
|
params(
|
|
14
14
|
email: String,
|
|
15
15
|
name: String,
|
|
16
|
-
metadata: T::Hash[Symbol,
|
|
16
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
17
17
|
phone_number: T.nilable(String),
|
|
18
18
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
19
19
|
).returns(Dodopayments::Customer)
|
|
@@ -45,7 +45,8 @@ module Dodopayments
|
|
|
45
45
|
params(
|
|
46
46
|
customer_id: String,
|
|
47
47
|
email: T.nilable(String),
|
|
48
|
-
metadata:
|
|
48
|
+
metadata:
|
|
49
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
49
50
|
name: T.nilable(String),
|
|
50
51
|
phone_number: T.nilable(String),
|
|
51
52
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
@@ -125,6 +126,39 @@ module Dodopayments
|
|
|
125
126
|
)
|
|
126
127
|
end
|
|
127
128
|
|
|
129
|
+
# List all of a customer's entitlement grants across every entitlement. One row
|
|
130
|
+
# per grant.
|
|
131
|
+
sig do
|
|
132
|
+
params(
|
|
133
|
+
customer_id: String,
|
|
134
|
+
integration_type:
|
|
135
|
+
Dodopayments::CustomerListEntitlementGrantsParams::IntegrationType::OrSymbol,
|
|
136
|
+
page_number: Integer,
|
|
137
|
+
page_size: Integer,
|
|
138
|
+
status:
|
|
139
|
+
Dodopayments::CustomerListEntitlementGrantsParams::Status::OrSymbol,
|
|
140
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
141
|
+
).returns(
|
|
142
|
+
Dodopayments::Internal::DefaultPageNumberPagination[
|
|
143
|
+
Dodopayments::Entitlements::EntitlementGrant
|
|
144
|
+
]
|
|
145
|
+
)
|
|
146
|
+
end
|
|
147
|
+
def list_entitlement_grants(
|
|
148
|
+
# Customer ID
|
|
149
|
+
customer_id,
|
|
150
|
+
# Filter by integration type (e.g. `feature_flag`)
|
|
151
|
+
integration_type: nil,
|
|
152
|
+
# Page number (default 0)
|
|
153
|
+
page_number: nil,
|
|
154
|
+
# Page size (default 10, max 100)
|
|
155
|
+
page_size: nil,
|
|
156
|
+
# Filter by grant status
|
|
157
|
+
status: nil,
|
|
158
|
+
request_options: {}
|
|
159
|
+
)
|
|
160
|
+
end
|
|
161
|
+
|
|
128
162
|
# List all entitlement grants delivered (or in flight) to a customer.
|
|
129
163
|
sig do
|
|
130
164
|
params(
|
|
@@ -11,7 +11,7 @@ module Dodopayments
|
|
|
11
11
|
type: Dodopayments::DiscountType::OrSymbol,
|
|
12
12
|
code: T.nilable(String),
|
|
13
13
|
expires_at: T.nilable(Time),
|
|
14
|
-
metadata: T::Hash[Symbol,
|
|
14
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
15
15
|
name: T.nilable(String),
|
|
16
16
|
preserve_on_plan_change: T::Boolean,
|
|
17
17
|
restricted_to: T.nilable(T::Array[String]),
|
|
@@ -74,7 +74,8 @@ module Dodopayments
|
|
|
74
74
|
amount: T.nilable(Integer),
|
|
75
75
|
code: T.nilable(String),
|
|
76
76
|
expires_at: T.nilable(Time),
|
|
77
|
-
metadata:
|
|
77
|
+
metadata:
|
|
78
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
78
79
|
name: T.nilable(String),
|
|
79
80
|
preserve_on_plan_change: T.nilable(T::Boolean),
|
|
80
81
|
restricted_to: T.nilable(T::Array[String]),
|
|
@@ -14,6 +14,7 @@ module Dodopayments
|
|
|
14
14
|
params(
|
|
15
15
|
integration_config:
|
|
16
16
|
T.any(
|
|
17
|
+
Dodopayments::IntegrationConfig::FeatureFlagConfig::OrHash,
|
|
17
18
|
Dodopayments::IntegrationConfig::GitHubConfig::OrHash,
|
|
18
19
|
Dodopayments::IntegrationConfig::DiscordConfig::OrHash,
|
|
19
20
|
Dodopayments::IntegrationConfig::TelegramConfig::OrHash,
|
|
@@ -26,7 +27,7 @@ module Dodopayments
|
|
|
26
27
|
integration_type: Dodopayments::EntitlementIntegrationType::OrSymbol,
|
|
27
28
|
name: String,
|
|
28
29
|
description: T.nilable(String),
|
|
29
|
-
metadata: T::Hash[Symbol,
|
|
30
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
30
31
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
31
32
|
).returns(Dodopayments::Entitlement)
|
|
32
33
|
end
|
|
@@ -67,6 +68,7 @@ module Dodopayments
|
|
|
67
68
|
integration_config:
|
|
68
69
|
T.nilable(
|
|
69
70
|
T.any(
|
|
71
|
+
Dodopayments::IntegrationConfig::FeatureFlagConfig::OrHash,
|
|
70
72
|
Dodopayments::IntegrationConfig::GitHubConfig::OrHash,
|
|
71
73
|
Dodopayments::IntegrationConfig::DiscordConfig::OrHash,
|
|
72
74
|
Dodopayments::IntegrationConfig::TelegramConfig::OrHash,
|
|
@@ -77,7 +79,8 @@ module Dodopayments
|
|
|
77
79
|
Dodopayments::IntegrationConfig::LicenseKeyConfig::OrHash
|
|
78
80
|
)
|
|
79
81
|
),
|
|
80
|
-
metadata:
|
|
82
|
+
metadata:
|
|
83
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
81
84
|
name: T.nilable(String),
|
|
82
85
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
83
86
|
).returns(Dodopayments::Entitlement)
|
|
@@ -88,7 +91,12 @@ module Dodopayments
|
|
|
88
91
|
description: nil,
|
|
89
92
|
# Integration-specific configuration supplied when creating or updating an
|
|
90
93
|
# entitlement. The shape required matches the entitlement's `integration_type`.
|
|
94
|
+
#
|
|
95
|
+
# Untagged enum: variants are matched in order. `FeatureFlag` must precede
|
|
96
|
+
# `LicenseKey`, whose fields are all optional and would otherwise match a
|
|
97
|
+
# `feature_flag` config.
|
|
91
98
|
integration_config: nil,
|
|
99
|
+
# Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
|
|
92
100
|
metadata: nil,
|
|
93
101
|
name: nil,
|
|
94
102
|
request_options: {}
|
|
@@ -20,7 +20,7 @@ module Dodopayments
|
|
|
20
20
|
discount_code: T.nilable(String),
|
|
21
21
|
discount_codes: T.nilable(T::Array[String]),
|
|
22
22
|
force_3ds: T.nilable(T::Boolean),
|
|
23
|
-
metadata: T::Hash[Symbol,
|
|
23
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
24
24
|
payment_link: T.nilable(T::Boolean),
|
|
25
25
|
payment_method_id: T.nilable(String),
|
|
26
26
|
redirect_immediately: T::Boolean,
|
|
@@ -38,7 +38,7 @@ module Dodopayments
|
|
|
38
38
|
license_key_duration:
|
|
39
39
|
T.nilable(Dodopayments::LicenseKeyDuration::OrHash),
|
|
40
40
|
license_key_enabled: T.nilable(T::Boolean),
|
|
41
|
-
metadata: T::Hash[Symbol,
|
|
41
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
42
42
|
pricing_mode:
|
|
43
43
|
T.nilable(Dodopayments::Products::PricingMode::OrSymbol),
|
|
44
44
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
@@ -131,7 +131,8 @@ module Dodopayments
|
|
|
131
131
|
license_key_duration:
|
|
132
132
|
T.nilable(Dodopayments::LicenseKeyDuration::OrHash),
|
|
133
133
|
license_key_enabled: T.nilable(T::Boolean),
|
|
134
|
-
metadata:
|
|
134
|
+
metadata:
|
|
135
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
135
136
|
name: T.nilable(String),
|
|
136
137
|
price:
|
|
137
138
|
T.nilable(
|
|
@@ -8,7 +8,7 @@ module Dodopayments
|
|
|
8
8
|
payment_id: String,
|
|
9
9
|
items:
|
|
10
10
|
T.nilable(T::Array[Dodopayments::RefundCreateParams::Item::OrHash]),
|
|
11
|
-
metadata: T::Hash[Symbol,
|
|
11
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
12
12
|
reason: T.nilable(String),
|
|
13
13
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
14
14
|
).returns(Dodopayments::Refund)
|
|
@@ -22,7 +22,7 @@ module Dodopayments
|
|
|
22
22
|
discount_codes: T.nilable(T::Array[String]),
|
|
23
23
|
force_3ds: T.nilable(T::Boolean),
|
|
24
24
|
mandate_min_amount_inr_paise: T.nilable(Integer),
|
|
25
|
-
metadata: T::Hash[Symbol,
|
|
25
|
+
metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
|
|
26
26
|
on_demand: T.nilable(Dodopayments::OnDemandSubscription::OrHash),
|
|
27
27
|
one_time_product_cart:
|
|
28
28
|
T.nilable(T::Array[Dodopayments::OneTimeProductCartItem::OrHash]),
|
|
@@ -150,9 +150,13 @@ module Dodopayments
|
|
|
150
150
|
T.nilable(
|
|
151
151
|
Dodopayments::SubscriptionUpdateParams::DisableOnDemand::OrHash
|
|
152
152
|
),
|
|
153
|
-
metadata:
|
|
153
|
+
metadata:
|
|
154
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
154
155
|
next_billing_date: T.nilable(Time),
|
|
155
156
|
status: T.nilable(Dodopayments::SubscriptionStatus::OrSymbol),
|
|
157
|
+
subscription_period_count: T.nilable(Integer),
|
|
158
|
+
subscription_period_interval:
|
|
159
|
+
T.nilable(Dodopayments::TimeInterval::OrSymbol),
|
|
156
160
|
tax_id: T.nilable(String),
|
|
157
161
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
158
162
|
).returns(Dodopayments::Subscription)
|
|
@@ -179,9 +183,19 @@ module Dodopayments
|
|
|
179
183
|
customer_business_name: nil,
|
|
180
184
|
customer_name: nil,
|
|
181
185
|
disable_on_demand: nil,
|
|
186
|
+
# Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
|
|
182
187
|
metadata: nil,
|
|
183
188
|
next_billing_date: nil,
|
|
184
189
|
status: nil,
|
|
190
|
+
# New number of `subscription_period_interval` units the subscription entitlement
|
|
191
|
+
# should span. Used together with `subscription_period_interval` to extend the
|
|
192
|
+
# subscription period. The resulting period must not be shorter than the current
|
|
193
|
+
# one (this endpoint only extends).
|
|
194
|
+
subscription_period_count: nil,
|
|
195
|
+
# New interval unit for the subscription period. When changing the period, this
|
|
196
|
+
# may be supplied alongside `subscription_period_count`; if omitted the existing
|
|
197
|
+
# interval is retained.
|
|
198
|
+
subscription_period_interval: nil,
|
|
185
199
|
tax_id: nil,
|
|
186
200
|
request_options: {}
|
|
187
201
|
)
|
|
@@ -251,7 +265,8 @@ module Dodopayments
|
|
|
251
265
|
discount_codes: T.nilable(T::Array[String]),
|
|
252
266
|
effective_at:
|
|
253
267
|
Dodopayments::UpdateSubscriptionPlanReq::EffectiveAt::OrSymbol,
|
|
254
|
-
metadata:
|
|
268
|
+
metadata:
|
|
269
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
255
270
|
on_payment_failure:
|
|
256
271
|
T.nilable(
|
|
257
272
|
Dodopayments::UpdateSubscriptionPlanReq::OnPaymentFailure::OrSymbol
|
|
@@ -311,7 +326,8 @@ module Dodopayments
|
|
|
311
326
|
T.nilable(
|
|
312
327
|
Dodopayments::SubscriptionChargeParams::CustomerBalanceConfig::OrHash
|
|
313
328
|
),
|
|
314
|
-
metadata:
|
|
329
|
+
metadata:
|
|
330
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
315
331
|
product_currency: T.nilable(Dodopayments::Currency::OrSymbol),
|
|
316
332
|
product_description: T.nilable(String),
|
|
317
333
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
@@ -355,7 +371,8 @@ module Dodopayments
|
|
|
355
371
|
discount_codes: T.nilable(T::Array[String]),
|
|
356
372
|
effective_at:
|
|
357
373
|
Dodopayments::UpdateSubscriptionPlanReq::EffectiveAt::OrSymbol,
|
|
358
|
-
metadata:
|
|
374
|
+
metadata:
|
|
375
|
+
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
359
376
|
on_payment_failure:
|
|
360
377
|
T.nilable(
|
|
361
378
|
Dodopayments::UpdateSubscriptionPlanReq::OnPaymentFailure::OrSymbol
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
module Dodopayments
|
|
2
|
+
module Models
|
|
3
|
+
type customer_list_entitlement_grants_params =
|
|
4
|
+
{
|
|
5
|
+
customer_id: String,
|
|
6
|
+
integration_type: Dodopayments::Models::CustomerListEntitlementGrantsParams::integration_type,
|
|
7
|
+
page_number: Integer,
|
|
8
|
+
page_size: Integer,
|
|
9
|
+
status: Dodopayments::Models::CustomerListEntitlementGrantsParams::status
|
|
10
|
+
}
|
|
11
|
+
& Dodopayments::Internal::Type::request_parameters
|
|
12
|
+
|
|
13
|
+
class CustomerListEntitlementGrantsParams < Dodopayments::Internal::Type::BaseModel
|
|
14
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
15
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
16
|
+
|
|
17
|
+
attr_accessor customer_id: String
|
|
18
|
+
|
|
19
|
+
attr_reader integration_type: Dodopayments::Models::CustomerListEntitlementGrantsParams::integration_type?
|
|
20
|
+
|
|
21
|
+
def integration_type=: (
|
|
22
|
+
Dodopayments::Models::CustomerListEntitlementGrantsParams::integration_type
|
|
23
|
+
) -> Dodopayments::Models::CustomerListEntitlementGrantsParams::integration_type
|
|
24
|
+
|
|
25
|
+
attr_reader page_number: Integer?
|
|
26
|
+
|
|
27
|
+
def page_number=: (Integer) -> Integer
|
|
28
|
+
|
|
29
|
+
attr_reader page_size: Integer?
|
|
30
|
+
|
|
31
|
+
def page_size=: (Integer) -> Integer
|
|
32
|
+
|
|
33
|
+
attr_reader status: Dodopayments::Models::CustomerListEntitlementGrantsParams::status?
|
|
34
|
+
|
|
35
|
+
def status=: (
|
|
36
|
+
Dodopayments::Models::CustomerListEntitlementGrantsParams::status
|
|
37
|
+
) -> Dodopayments::Models::CustomerListEntitlementGrantsParams::status
|
|
38
|
+
|
|
39
|
+
def initialize: (
|
|
40
|
+
customer_id: String,
|
|
41
|
+
?integration_type: Dodopayments::Models::CustomerListEntitlementGrantsParams::integration_type,
|
|
42
|
+
?page_number: Integer,
|
|
43
|
+
?page_size: Integer,
|
|
44
|
+
?status: Dodopayments::Models::CustomerListEntitlementGrantsParams::status,
|
|
45
|
+
?request_options: Dodopayments::request_opts
|
|
46
|
+
) -> void
|
|
47
|
+
|
|
48
|
+
def to_hash: -> {
|
|
49
|
+
customer_id: String,
|
|
50
|
+
integration_type: Dodopayments::Models::CustomerListEntitlementGrantsParams::integration_type,
|
|
51
|
+
page_number: Integer,
|
|
52
|
+
page_size: Integer,
|
|
53
|
+
status: Dodopayments::Models::CustomerListEntitlementGrantsParams::status,
|
|
54
|
+
request_options: Dodopayments::RequestOptions
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
type integration_type =
|
|
58
|
+
:discord
|
|
59
|
+
| :telegram
|
|
60
|
+
| :github
|
|
61
|
+
| :figma
|
|
62
|
+
| :framer
|
|
63
|
+
| :notion
|
|
64
|
+
| :digital_files
|
|
65
|
+
| :license_key
|
|
66
|
+
| :feature_flag
|
|
67
|
+
|
|
68
|
+
module IntegrationType
|
|
69
|
+
extend Dodopayments::Internal::Type::Enum
|
|
70
|
+
|
|
71
|
+
DISCORD: :discord
|
|
72
|
+
TELEGRAM: :telegram
|
|
73
|
+
GITHUB: :github
|
|
74
|
+
FIGMA: :figma
|
|
75
|
+
FRAMER: :framer
|
|
76
|
+
NOTION: :notion
|
|
77
|
+
DIGITAL_FILES: :digital_files
|
|
78
|
+
LICENSE_KEY: :license_key
|
|
79
|
+
FEATURE_FLAG: :feature_flag
|
|
80
|
+
|
|
81
|
+
def self?.values: -> ::Array[Dodopayments::Models::CustomerListEntitlementGrantsParams::integration_type]
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
type status = :Pending | :Delivered | :Failed | :Revoked
|
|
85
|
+
|
|
86
|
+
module Status
|
|
87
|
+
extend Dodopayments::Internal::Type::Enum
|
|
88
|
+
|
|
89
|
+
PENDING: :Pending
|
|
90
|
+
DELIVERED: :Delivered
|
|
91
|
+
FAILED: :Failed
|
|
92
|
+
REVOKED: :Revoked
|
|
93
|
+
|
|
94
|
+
def self?.values: -> ::Array[Dodopayments::Models::CustomerListEntitlementGrantsParams::status]
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
@@ -9,6 +9,7 @@ module Dodopayments
|
|
|
9
9
|
| :notion
|
|
10
10
|
| :digital_files
|
|
11
11
|
| :license_key
|
|
12
|
+
| :feature_flag
|
|
12
13
|
|
|
13
14
|
module EntitlementIntegrationType
|
|
14
15
|
extend Dodopayments::Internal::Type::Enum
|
|
@@ -21,6 +22,7 @@ module Dodopayments
|
|
|
21
22
|
NOTION: :notion
|
|
22
23
|
DIGITAL_FILES: :digital_files
|
|
23
24
|
LICENSE_KEY: :license_key
|
|
25
|
+
FEATURE_FLAG: :feature_flag
|
|
24
26
|
|
|
25
27
|
def self?.values: -> ::Array[Dodopayments::Models::entitlement_integration_type]
|
|
26
28
|
end
|
|
@@ -49,6 +49,7 @@ module Dodopayments
|
|
|
49
49
|
| :notion
|
|
50
50
|
| :digital_files
|
|
51
51
|
| :license_key
|
|
52
|
+
| :feature_flag
|
|
52
53
|
|
|
53
54
|
module IntegrationType
|
|
54
55
|
extend Dodopayments::Internal::Type::Enum
|
|
@@ -61,6 +62,7 @@ module Dodopayments
|
|
|
61
62
|
NOTION: :notion
|
|
62
63
|
DIGITAL_FILES: :digital_files
|
|
63
64
|
LICENSE_KEY: :license_key
|
|
65
|
+
FEATURE_FLAG: :feature_flag
|
|
64
66
|
|
|
65
67
|
def self?.values: -> ::Array[Dodopayments::Models::EntitlementListParams::integration_type]
|
|
66
68
|
end
|
|
@@ -19,6 +19,7 @@ module Dodopayments
|
|
|
19
19
|
digital_product_delivery: Dodopayments::DigitalProductDelivery?,
|
|
20
20
|
error_code: String?,
|
|
21
21
|
error_message: String?,
|
|
22
|
+
feature: Dodopayments::Feature?,
|
|
22
23
|
license_key: Dodopayments::Entitlements::LicenseKeyGrant?,
|
|
23
24
|
oauth_expires_at: Time?,
|
|
24
25
|
oauth_url: String?,
|
|
@@ -57,6 +58,8 @@ module Dodopayments
|
|
|
57
58
|
|
|
58
59
|
attr_accessor error_message: String?
|
|
59
60
|
|
|
61
|
+
attr_accessor feature: Dodopayments::Feature?
|
|
62
|
+
|
|
60
63
|
attr_accessor license_key: Dodopayments::Entitlements::LicenseKeyGrant?
|
|
61
64
|
|
|
62
65
|
attr_accessor oauth_expires_at: Time?
|
|
@@ -86,6 +89,7 @@ module Dodopayments
|
|
|
86
89
|
?digital_product_delivery: Dodopayments::DigitalProductDelivery?,
|
|
87
90
|
?error_code: String?,
|
|
88
91
|
?error_message: String?,
|
|
92
|
+
?feature: Dodopayments::Feature?,
|
|
89
93
|
?license_key: Dodopayments::Entitlements::LicenseKeyGrant?,
|
|
90
94
|
?oauth_expires_at: Time?,
|
|
91
95
|
?oauth_url: String?,
|
|
@@ -110,6 +114,7 @@ module Dodopayments
|
|
|
110
114
|
digital_product_delivery: Dodopayments::DigitalProductDelivery?,
|
|
111
115
|
error_code: String?,
|
|
112
116
|
error_message: String?,
|
|
117
|
+
feature: Dodopayments::Feature?,
|
|
113
118
|
license_key: Dodopayments::Entitlements::LicenseKeyGrant?,
|
|
114
119
|
oauth_expires_at: Time?,
|
|
115
120
|
oauth_url: String?,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module Dodopayments
|
|
2
|
+
module Models
|
|
3
|
+
type feature =
|
|
4
|
+
{ feature_id: String, feature_type: Dodopayments::Models::feature_type }
|
|
5
|
+
|
|
6
|
+
class Feature < Dodopayments::Internal::Type::BaseModel
|
|
7
|
+
attr_accessor feature_id: String
|
|
8
|
+
|
|
9
|
+
attr_accessor feature_type: Dodopayments::Models::feature_type
|
|
10
|
+
|
|
11
|
+
def initialize: (
|
|
12
|
+
feature_id: String,
|
|
13
|
+
feature_type: Dodopayments::Models::feature_type
|
|
14
|
+
) -> void
|
|
15
|
+
|
|
16
|
+
def to_hash: -> {
|
|
17
|
+
feature_id: String,
|
|
18
|
+
feature_type: Dodopayments::Models::feature_type
|
|
19
|
+
}
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|