dodopayments 2.10.0 → 2.11.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 +10 -0
- data/README.md +9 -9
- data/lib/dodopayments/client.rb +4 -0
- data/lib/dodopayments/models/checkout_session_flags.rb +15 -1
- data/lib/dodopayments/models/checkout_session_request.rb +11 -1
- data/lib/dodopayments/models/checkout_session_response.rb +33 -1
- data/lib/dodopayments/models/discount_detail.rb +143 -0
- data/lib/dodopayments/models/filter_type.rb +71 -0
- data/lib/dodopayments/models/github_permission.rb +19 -0
- data/lib/dodopayments/models/integration_config.rb +3 -19
- data/lib/dodopayments/models/integration_config_response.rb +3 -19
- data/lib/dodopayments/models/invoices/payment_retrieve_payout_params.rb +22 -0
- data/lib/dodopayments/models/meter_filter.rb +3 -331
- data/lib/dodopayments/models/payment.rb +3 -141
- data/lib/dodopayments/models/payment_create_params.rb +11 -1
- data/lib/dodopayments/models/payment_method_types.rb +1 -0
- data/lib/dodopayments/models/product_collection.rb +74 -0
- data/lib/dodopayments/models/product_collection_create_params.rb +47 -0
- data/lib/dodopayments/models/product_collection_delete_params.rb +20 -0
- data/lib/dodopayments/models/product_collection_list_params.rb +46 -0
- data/lib/dodopayments/models/product_collection_list_response.rb +65 -0
- data/lib/dodopayments/models/product_collection_retrieve_params.rb +20 -0
- data/lib/dodopayments/models/product_collection_unarchive_params.rb +20 -0
- data/lib/dodopayments/models/product_collection_unarchive_response.rb +33 -0
- data/lib/dodopayments/models/product_collection_update_images_params.rb +29 -0
- data/lib/dodopayments/models/product_collection_update_images_response.rb +25 -0
- data/lib/dodopayments/models/product_collection_update_params.rb +61 -0
- data/lib/dodopayments/models/product_collections/group_create_params.rb +22 -0
- data/lib/dodopayments/models/product_collections/group_delete_params.rb +28 -0
- data/lib/dodopayments/models/product_collections/group_product.rb +26 -0
- data/lib/dodopayments/models/product_collections/group_update_params.rb +59 -0
- data/lib/dodopayments/models/product_collections/groups/item_create_params.rb +41 -0
- data/lib/dodopayments/models/product_collections/groups/item_create_response.rb +15 -0
- data/lib/dodopayments/models/product_collections/groups/item_delete_params.rb +36 -0
- data/lib/dodopayments/models/product_collections/groups/item_update_params.rb +47 -0
- data/lib/dodopayments/models/product_collections/groups/product_collection_product.rb +132 -0
- data/lib/dodopayments/models/product_collections/product_collection_group_details.rb +42 -0
- data/lib/dodopayments/models/product_collections/product_collection_group_response.rb +39 -0
- data/lib/dodopayments/models/subscription.rb +13 -142
- data/lib/dodopayments/models/subscription_create_params.rb +11 -1
- data/lib/dodopayments/models/subscription_list_response.rb +10 -1
- data/lib/dodopayments/models/subscription_update_params.rb +12 -1
- data/lib/dodopayments/models/subscription_update_payment_method_params.rb +9 -9
- data/lib/dodopayments/models/webhook_event_type.rb +1 -5
- data/lib/dodopayments/models.rb +24 -0
- data/lib/dodopayments/resources/checkout_sessions.rb +6 -2
- data/lib/dodopayments/resources/invoices/payments.rb +18 -0
- data/lib/dodopayments/resources/payments.rb +3 -1
- data/lib/dodopayments/resources/product_collections/groups/items.rb +111 -0
- data/lib/dodopayments/resources/product_collections/groups.rb +109 -0
- data/lib/dodopayments/resources/product_collections.rb +179 -0
- data/lib/dodopayments/resources/subscriptions.rb +9 -5
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +29 -0
- data/rbi/dodopayments/client.rbi +3 -0
- data/rbi/dodopayments/models/checkout_session_flags.rbi +23 -0
- data/rbi/dodopayments/models/checkout_session_request.rbi +12 -0
- data/rbi/dodopayments/models/checkout_session_response.rbi +43 -5
- data/rbi/dodopayments/models/discount_detail.rbi +161 -0
- data/rbi/dodopayments/models/filter_type.rbi +112 -0
- data/rbi/dodopayments/models/github_permission.rbi +26 -0
- data/rbi/dodopayments/models/integration_config.rbi +3 -59
- data/rbi/dodopayments/models/integration_config_response.rbi +3 -59
- data/rbi/dodopayments/models/invoices/payment_retrieve_payout_params.rbi +40 -0
- data/rbi/dodopayments/models/meter_filter.rbi +3 -572
- data/rbi/dodopayments/models/payment.rbi +3 -163
- data/rbi/dodopayments/models/payment_create_params.rbi +12 -0
- data/rbi/dodopayments/models/payment_method_types.rbi +1 -0
- data/rbi/dodopayments/models/product_collection.rbi +108 -0
- data/rbi/dodopayments/models/product_collection_create_params.rbi +82 -0
- data/rbi/dodopayments/models/product_collection_delete_params.rbi +38 -0
- data/rbi/dodopayments/models/product_collection_list_params.rbi +82 -0
- data/rbi/dodopayments/models/product_collection_list_response.rbi +88 -0
- data/rbi/dodopayments/models/product_collection_retrieve_params.rbi +38 -0
- data/rbi/dodopayments/models/product_collection_unarchive_params.rbi +38 -0
- data/rbi/dodopayments/models/product_collection_unarchive_response.rbi +56 -0
- data/rbi/dodopayments/models/product_collection_update_images_params.rbi +52 -0
- data/rbi/dodopayments/models/product_collection_update_images_response.rbi +40 -0
- data/rbi/dodopayments/models/product_collection_update_params.rbi +84 -0
- data/rbi/dodopayments/models/product_collections/group_create_params.rbi +40 -0
- data/rbi/dodopayments/models/product_collections/group_delete_params.rbi +48 -0
- data/rbi/dodopayments/models/product_collections/group_product.rbi +46 -0
- data/rbi/dodopayments/models/product_collections/group_update_params.rbi +80 -0
- data/rbi/dodopayments/models/product_collections/groups/item_create_params.rbi +68 -0
- data/rbi/dodopayments/models/product_collections/groups/item_create_response.rbi +17 -0
- data/rbi/dodopayments/models/product_collections/groups/item_delete_params.rbi +55 -0
- data/rbi/dodopayments/models/product_collections/groups/item_update_params.rbi +68 -0
- data/rbi/dodopayments/models/product_collections/groups/product_collection_product.rbi +148 -0
- data/rbi/dodopayments/models/product_collections/product_collection_group_details.rbi +67 -0
- data/rbi/dodopayments/models/product_collections/product_collection_group_response.rbi +68 -0
- data/rbi/dodopayments/models/subscription.rbi +13 -164
- data/rbi/dodopayments/models/subscription_create_params.rbi +12 -0
- data/rbi/dodopayments/models/subscription_list_response.rbi +10 -0
- data/rbi/dodopayments/models/subscription_update_params.rbi +14 -0
- data/rbi/dodopayments/models/subscription_update_payment_method_params.rbi +16 -16
- data/rbi/dodopayments/models/webhook_event_type.rbi +4 -18
- data/rbi/dodopayments/models.rbi +31 -0
- data/rbi/dodopayments/resources/checkout_sessions.rbi +10 -0
- data/rbi/dodopayments/resources/invoices/payments.rbi +9 -0
- data/rbi/dodopayments/resources/payments.rbi +5 -0
- data/rbi/dodopayments/resources/product_collections/groups/items.rbi +83 -0
- data/rbi/dodopayments/resources/product_collections/groups.rbi +88 -0
- data/rbi/dodopayments/resources/product_collections.rbi +149 -0
- data/rbi/dodopayments/resources/subscriptions.rbi +15 -4
- data/sig/dodopayments/client.rbs +2 -0
- data/sig/dodopayments/models/checkout_session_flags.rbs +7 -0
- data/sig/dodopayments/models/checkout_session_request.rbs +5 -0
- data/sig/dodopayments/models/checkout_session_response.rbs +27 -3
- data/sig/dodopayments/models/discount_detail.rbs +95 -0
- data/sig/dodopayments/models/filter_type.rbs +52 -0
- data/sig/dodopayments/models/github_permission.rbs +17 -0
- data/sig/dodopayments/models/integration_config.rbs +4 -18
- data/sig/dodopayments/models/integration_config_response.rbs +4 -18
- data/sig/dodopayments/models/invoices/payment_retrieve_payout_params.rbs +25 -0
- data/sig/dodopayments/models/meter_filter.rbs +4 -252
- data/sig/dodopayments/models/payment.rbs +4 -96
- data/sig/dodopayments/models/payment_create_params.rbs +5 -0
- data/sig/dodopayments/models/payment_method_types.rbs +2 -0
- data/sig/dodopayments/models/product_collection.rbs +55 -0
- data/sig/dodopayments/models/product_collection_create_params.rbs +41 -0
- data/sig/dodopayments/models/product_collection_delete_params.rbs +23 -0
- data/sig/dodopayments/models/product_collection_list_params.rbs +49 -0
- data/sig/dodopayments/models/product_collection_list_response.rbs +50 -0
- data/sig/dodopayments/models/product_collection_retrieve_params.rbs +23 -0
- data/sig/dodopayments/models/product_collection_unarchive_params.rbs +23 -0
- data/sig/dodopayments/models/product_collection_unarchive_response.rbs +30 -0
- data/sig/dodopayments/models/product_collection_update_images_params.rbs +28 -0
- data/sig/dodopayments/models/product_collection_update_images_response.rbs +16 -0
- data/sig/dodopayments/models/product_collection_update_params.rbs +51 -0
- data/sig/dodopayments/models/product_collections/group_create_params.rbs +27 -0
- data/sig/dodopayments/models/product_collections/group_delete_params.rbs +30 -0
- data/sig/dodopayments/models/product_collections/group_product.rbs +17 -0
- data/sig/dodopayments/models/product_collections/group_update_params.rbs +48 -0
- data/sig/dodopayments/models/product_collections/groups/item_create_params.rbs +40 -0
- data/sig/dodopayments/models/product_collections/groups/item_create_response.rbs +12 -0
- data/sig/dodopayments/models/product_collections/groups/item_delete_params.rbs +36 -0
- data/sig/dodopayments/models/product_collections/groups/item_update_params.rbs +40 -0
- data/sig/dodopayments/models/product_collections/groups/product_collection_product.rbs +99 -0
- data/sig/dodopayments/models/product_collections/product_collection_group_details.rbs +34 -0
- data/sig/dodopayments/models/product_collections/product_collection_group_response.rbs +39 -0
- data/sig/dodopayments/models/subscription.rbs +9 -96
- data/sig/dodopayments/models/subscription_create_params.rbs +5 -0
- data/sig/dodopayments/models/subscription_list_response.rbs +5 -0
- data/sig/dodopayments/models/subscription_update_params.rbs +5 -0
- data/sig/dodopayments/models/subscription_update_payment_method_params.rbs +9 -9
- data/sig/dodopayments/models/webhook_event_type.rbs +2 -10
- data/sig/dodopayments/models.rbs +24 -0
- data/sig/dodopayments/resources/checkout_sessions.rbs +2 -0
- data/sig/dodopayments/resources/invoices/payments.rbs +5 -0
- data/sig/dodopayments/resources/payments.rbs +1 -0
- data/sig/dodopayments/resources/product_collections/groups/items.rbs +33 -0
- data/sig/dodopayments/resources/product_collections/groups.rbs +34 -0
- data/sig/dodopayments/resources/product_collections.rbs +56 -0
- data/sig/dodopayments/resources/subscriptions.rbs +3 -1
- metadata +89 -2
|
@@ -20,35 +20,35 @@ module Dodopayments
|
|
|
20
20
|
sig do
|
|
21
21
|
returns(
|
|
22
22
|
T.any(
|
|
23
|
-
Dodopayments::SubscriptionUpdatePaymentMethodParams::
|
|
24
|
-
Dodopayments::SubscriptionUpdatePaymentMethodParams::
|
|
23
|
+
Dodopayments::SubscriptionUpdatePaymentMethodParams::PaymentMethod::New,
|
|
24
|
+
Dodopayments::SubscriptionUpdatePaymentMethodParams::PaymentMethod::Existing
|
|
25
25
|
)
|
|
26
26
|
)
|
|
27
27
|
end
|
|
28
|
-
attr_accessor :
|
|
28
|
+
attr_accessor :payment_method
|
|
29
29
|
|
|
30
30
|
sig do
|
|
31
31
|
params(
|
|
32
32
|
subscription_id: String,
|
|
33
|
-
|
|
33
|
+
payment_method:
|
|
34
34
|
T.any(
|
|
35
|
-
Dodopayments::SubscriptionUpdatePaymentMethodParams::
|
|
36
|
-
Dodopayments::SubscriptionUpdatePaymentMethodParams::
|
|
35
|
+
Dodopayments::SubscriptionUpdatePaymentMethodParams::PaymentMethod::New::OrHash,
|
|
36
|
+
Dodopayments::SubscriptionUpdatePaymentMethodParams::PaymentMethod::Existing::OrHash
|
|
37
37
|
),
|
|
38
38
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
39
39
|
).returns(T.attached_class)
|
|
40
40
|
end
|
|
41
|
-
def self.new(subscription_id:,
|
|
41
|
+
def self.new(subscription_id:, payment_method:, request_options: {})
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
sig do
|
|
45
45
|
override.returns(
|
|
46
46
|
{
|
|
47
47
|
subscription_id: String,
|
|
48
|
-
|
|
48
|
+
payment_method:
|
|
49
49
|
T.any(
|
|
50
|
-
Dodopayments::SubscriptionUpdatePaymentMethodParams::
|
|
51
|
-
Dodopayments::SubscriptionUpdatePaymentMethodParams::
|
|
50
|
+
Dodopayments::SubscriptionUpdatePaymentMethodParams::PaymentMethod::New,
|
|
51
|
+
Dodopayments::SubscriptionUpdatePaymentMethodParams::PaymentMethod::Existing
|
|
52
52
|
),
|
|
53
53
|
request_options: Dodopayments::RequestOptions
|
|
54
54
|
}
|
|
@@ -57,14 +57,14 @@ module Dodopayments
|
|
|
57
57
|
def to_hash
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
-
module
|
|
60
|
+
module PaymentMethod
|
|
61
61
|
extend Dodopayments::Internal::Type::Union
|
|
62
62
|
|
|
63
63
|
Variants =
|
|
64
64
|
T.type_alias do
|
|
65
65
|
T.any(
|
|
66
|
-
Dodopayments::SubscriptionUpdatePaymentMethodParams::
|
|
67
|
-
Dodopayments::SubscriptionUpdatePaymentMethodParams::
|
|
66
|
+
Dodopayments::SubscriptionUpdatePaymentMethodParams::PaymentMethod::New,
|
|
67
|
+
Dodopayments::SubscriptionUpdatePaymentMethodParams::PaymentMethod::Existing
|
|
68
68
|
)
|
|
69
69
|
end
|
|
70
70
|
|
|
@@ -72,7 +72,7 @@ module Dodopayments
|
|
|
72
72
|
OrHash =
|
|
73
73
|
T.type_alias do
|
|
74
74
|
T.any(
|
|
75
|
-
Dodopayments::SubscriptionUpdatePaymentMethodParams::
|
|
75
|
+
Dodopayments::SubscriptionUpdatePaymentMethodParams::PaymentMethod::New,
|
|
76
76
|
Dodopayments::Internal::AnyHash
|
|
77
77
|
)
|
|
78
78
|
end
|
|
@@ -102,7 +102,7 @@ module Dodopayments
|
|
|
102
102
|
OrHash =
|
|
103
103
|
T.type_alias do
|
|
104
104
|
T.any(
|
|
105
|
-
Dodopayments::SubscriptionUpdatePaymentMethodParams::
|
|
105
|
+
Dodopayments::SubscriptionUpdatePaymentMethodParams::PaymentMethod::Existing,
|
|
106
106
|
Dodopayments::Internal::AnyHash
|
|
107
107
|
)
|
|
108
108
|
end
|
|
@@ -129,7 +129,7 @@ module Dodopayments
|
|
|
129
129
|
sig do
|
|
130
130
|
override.returns(
|
|
131
131
|
T::Array[
|
|
132
|
-
Dodopayments::SubscriptionUpdatePaymentMethodParams::
|
|
132
|
+
Dodopayments::SubscriptionUpdatePaymentMethodParams::PaymentMethod::Variants
|
|
133
133
|
]
|
|
134
134
|
)
|
|
135
135
|
end
|
|
@@ -66,24 +66,14 @@ module Dodopayments
|
|
|
66
66
|
:"subscription.on_hold",
|
|
67
67
|
Dodopayments::WebhookEventType::TaggedSymbol
|
|
68
68
|
)
|
|
69
|
-
|
|
70
|
-
T.let(
|
|
71
|
-
:"subscription.cancelled",
|
|
72
|
-
Dodopayments::WebhookEventType::TaggedSymbol
|
|
73
|
-
)
|
|
74
|
-
SUBSCRIPTION_CANCELLATION_SCHEDULED =
|
|
69
|
+
SUBSCRIPTION_PAUSED =
|
|
75
70
|
T.let(
|
|
76
|
-
:"subscription.
|
|
71
|
+
:"subscription.paused",
|
|
77
72
|
Dodopayments::WebhookEventType::TaggedSymbol
|
|
78
73
|
)
|
|
79
|
-
|
|
80
|
-
T.let(
|
|
81
|
-
:"subscription.trial_ending",
|
|
82
|
-
Dodopayments::WebhookEventType::TaggedSymbol
|
|
83
|
-
)
|
|
84
|
-
SUBSCRIPTION_UPCOMING_RENEWAL =
|
|
74
|
+
SUBSCRIPTION_CANCELLED =
|
|
85
75
|
T.let(
|
|
86
|
-
:"subscription.
|
|
76
|
+
:"subscription.cancelled",
|
|
87
77
|
Dodopayments::WebhookEventType::TaggedSymbol
|
|
88
78
|
)
|
|
89
79
|
SUBSCRIPTION_FAILED =
|
|
@@ -180,10 +170,6 @@ module Dodopayments
|
|
|
180
170
|
:"dunning.recovered",
|
|
181
171
|
Dodopayments::WebhookEventType::TaggedSymbol
|
|
182
172
|
)
|
|
183
|
-
ACR_EMAIL =
|
|
184
|
-
T.let(:"acr.email", Dodopayments::WebhookEventType::TaggedSymbol)
|
|
185
|
-
DUNNING_EMAIL =
|
|
186
|
-
T.let(:"dunning.email", Dodopayments::WebhookEventType::TaggedSymbol)
|
|
187
173
|
ENTITLEMENT_GRANT_CREATED =
|
|
188
174
|
T.let(
|
|
189
175
|
:"entitlement_grant.created",
|
data/rbi/dodopayments/models.rbi
CHANGED
|
@@ -183,6 +183,8 @@ module Dodopayments
|
|
|
183
183
|
|
|
184
184
|
DiscountDeleteParams = Dodopayments::Models::DiscountDeleteParams
|
|
185
185
|
|
|
186
|
+
DiscountDetail = Dodopayments::Models::DiscountDetail
|
|
187
|
+
|
|
186
188
|
DiscountListParams = Dodopayments::Models::DiscountListParams
|
|
187
189
|
|
|
188
190
|
DiscountRetrieveByCodeParams =
|
|
@@ -260,8 +262,12 @@ module Dodopayments
|
|
|
260
262
|
|
|
261
263
|
FilterOperator = Dodopayments::Models::FilterOperator
|
|
262
264
|
|
|
265
|
+
FilterType = Dodopayments::Models::FilterType
|
|
266
|
+
|
|
263
267
|
GetDispute = Dodopayments::Models::GetDispute
|
|
264
268
|
|
|
269
|
+
GitHubPermission = Dodopayments::Models::GitHubPermission
|
|
270
|
+
|
|
265
271
|
IntegrationConfig = Dodopayments::Models::IntegrationConfig
|
|
266
272
|
|
|
267
273
|
IntegrationConfigResponse = Dodopayments::Models::IntegrationConfigResponse
|
|
@@ -370,6 +376,31 @@ module Dodopayments
|
|
|
370
376
|
|
|
371
377
|
ProductArchiveParams = Dodopayments::Models::ProductArchiveParams
|
|
372
378
|
|
|
379
|
+
ProductCollection = Dodopayments::Models::ProductCollection
|
|
380
|
+
|
|
381
|
+
ProductCollectionCreateParams =
|
|
382
|
+
Dodopayments::Models::ProductCollectionCreateParams
|
|
383
|
+
|
|
384
|
+
ProductCollectionDeleteParams =
|
|
385
|
+
Dodopayments::Models::ProductCollectionDeleteParams
|
|
386
|
+
|
|
387
|
+
ProductCollectionListParams =
|
|
388
|
+
Dodopayments::Models::ProductCollectionListParams
|
|
389
|
+
|
|
390
|
+
ProductCollectionRetrieveParams =
|
|
391
|
+
Dodopayments::Models::ProductCollectionRetrieveParams
|
|
392
|
+
|
|
393
|
+
ProductCollections = Dodopayments::Models::ProductCollections
|
|
394
|
+
|
|
395
|
+
ProductCollectionUnarchiveParams =
|
|
396
|
+
Dodopayments::Models::ProductCollectionUnarchiveParams
|
|
397
|
+
|
|
398
|
+
ProductCollectionUpdateImagesParams =
|
|
399
|
+
Dodopayments::Models::ProductCollectionUpdateImagesParams
|
|
400
|
+
|
|
401
|
+
ProductCollectionUpdateParams =
|
|
402
|
+
Dodopayments::Models::ProductCollectionUpdateParams
|
|
403
|
+
|
|
373
404
|
ProductCreateParams = Dodopayments::Models::ProductCreateParams
|
|
374
405
|
|
|
375
406
|
ProductEntitlementSummary = Dodopayments::Models::ProductEntitlementSummary
|
|
@@ -21,6 +21,7 @@ module Dodopayments
|
|
|
21
21
|
Dodopayments::NewCustomer::OrHash
|
|
22
22
|
)
|
|
23
23
|
),
|
|
24
|
+
customer_business_name: T.nilable(String),
|
|
24
25
|
customization: Dodopayments::CheckoutSessionCustomization::OrHash,
|
|
25
26
|
discount_code: T.nilable(String),
|
|
26
27
|
discount_codes: T.nilable(T::Array[String]),
|
|
@@ -62,6 +63,10 @@ module Dodopayments
|
|
|
62
63
|
custom_fields: nil,
|
|
63
64
|
# Customer details for the session
|
|
64
65
|
customer: nil,
|
|
66
|
+
# Optional business / legal name associated with the tax id. When provided
|
|
67
|
+
# together with a valid tax id for a B2B purchase, this name is rendered on the
|
|
68
|
+
# invoice instead of the customer's personal name.
|
|
69
|
+
customer_business_name: nil,
|
|
65
70
|
# Customization for the checkout session page
|
|
66
71
|
customization: nil,
|
|
67
72
|
# DEPRECATED: Use discount_codes instead. Cannot be used together with
|
|
@@ -132,6 +137,7 @@ module Dodopayments
|
|
|
132
137
|
Dodopayments::NewCustomer::OrHash
|
|
133
138
|
)
|
|
134
139
|
),
|
|
140
|
+
customer_business_name: T.nilable(String),
|
|
135
141
|
customization: Dodopayments::CheckoutSessionCustomization::OrHash,
|
|
136
142
|
discount_code: T.nilable(String),
|
|
137
143
|
discount_codes: T.nilable(T::Array[String]),
|
|
@@ -173,6 +179,10 @@ module Dodopayments
|
|
|
173
179
|
custom_fields: nil,
|
|
174
180
|
# Customer details for the session
|
|
175
181
|
customer: nil,
|
|
182
|
+
# Optional business / legal name associated with the tax id. When provided
|
|
183
|
+
# together with a valid tax id for a B2B purchase, this name is rendered on the
|
|
184
|
+
# invoice instead of the customer's personal name.
|
|
185
|
+
customer_business_name: nil,
|
|
176
186
|
# Customization for the checkout session page
|
|
177
187
|
customization: nil,
|
|
178
188
|
# DEPRECATED: Use discount_codes instead. Cannot be used together with
|
|
@@ -13,6 +13,15 @@ module Dodopayments
|
|
|
13
13
|
def retrieve(payment_id, request_options: {})
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
+
sig do
|
|
17
|
+
params(
|
|
18
|
+
payout_id: String,
|
|
19
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
20
|
+
).returns(StringIO)
|
|
21
|
+
end
|
|
22
|
+
def retrieve_payout(payout_id, request_options: {})
|
|
23
|
+
end
|
|
24
|
+
|
|
16
25
|
sig do
|
|
17
26
|
params(
|
|
18
27
|
refund_id: String,
|
|
@@ -16,6 +16,7 @@ module Dodopayments
|
|
|
16
16
|
allowed_payment_method_types:
|
|
17
17
|
T.nilable(T::Array[Dodopayments::PaymentMethodTypes::OrSymbol]),
|
|
18
18
|
billing_currency: T.nilable(Dodopayments::Currency::OrSymbol),
|
|
19
|
+
customer_business_name: T.nilable(String),
|
|
19
20
|
discount_code: T.nilable(String),
|
|
20
21
|
discount_codes: T.nilable(T::Array[String]),
|
|
21
22
|
force_3ds: T.nilable(T::Boolean),
|
|
@@ -51,6 +52,10 @@ module Dodopayments
|
|
|
51
52
|
# Fix the currency in which the end customer is billed. If Dodo Payments cannot
|
|
52
53
|
# support that currency for this transaction, it will not proceed
|
|
53
54
|
billing_currency: nil,
|
|
55
|
+
# Optional business / legal name associated with the tax id. When provided
|
|
56
|
+
# together with a valid tax id for a B2B purchase, this name is rendered on the
|
|
57
|
+
# invoice instead of the customer's personal name.
|
|
58
|
+
customer_business_name: nil,
|
|
54
59
|
# DEPRECATED: Use discount_codes instead. Cannot be used together with
|
|
55
60
|
# discount_codes.
|
|
56
61
|
discount_code: nil,
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Resources
|
|
5
|
+
class ProductCollections
|
|
6
|
+
class Groups
|
|
7
|
+
class Items
|
|
8
|
+
sig do
|
|
9
|
+
params(
|
|
10
|
+
group_id: String,
|
|
11
|
+
id: String,
|
|
12
|
+
products:
|
|
13
|
+
T::Array[
|
|
14
|
+
Dodopayments::ProductCollections::GroupProduct::OrHash
|
|
15
|
+
],
|
|
16
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
17
|
+
).returns(
|
|
18
|
+
T::Array[
|
|
19
|
+
Dodopayments::ProductCollections::Groups::ProductCollectionProduct
|
|
20
|
+
]
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
def create(
|
|
24
|
+
# Path param: Product Collection Group Id
|
|
25
|
+
group_id,
|
|
26
|
+
# Path param: Product Collection Id
|
|
27
|
+
id:,
|
|
28
|
+
# Body param: Products to add to the group
|
|
29
|
+
products:,
|
|
30
|
+
request_options: {}
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
params(
|
|
36
|
+
item_id: String,
|
|
37
|
+
id: String,
|
|
38
|
+
group_id: String,
|
|
39
|
+
status: T::Boolean,
|
|
40
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
41
|
+
).void
|
|
42
|
+
end
|
|
43
|
+
def update(
|
|
44
|
+
# Path param: Collection item Id (product membership in group)
|
|
45
|
+
item_id,
|
|
46
|
+
# Path param: Product Collection Id
|
|
47
|
+
id:,
|
|
48
|
+
# Path param: Product Collection Group Id
|
|
49
|
+
group_id:,
|
|
50
|
+
# Body param: Status of the product in the group
|
|
51
|
+
status:,
|
|
52
|
+
request_options: {}
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
sig do
|
|
57
|
+
params(
|
|
58
|
+
item_id: String,
|
|
59
|
+
id: String,
|
|
60
|
+
group_id: String,
|
|
61
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
62
|
+
).void
|
|
63
|
+
end
|
|
64
|
+
def delete(
|
|
65
|
+
# Collection item Id (product membership in group)
|
|
66
|
+
item_id,
|
|
67
|
+
# Product Collection Id
|
|
68
|
+
id:,
|
|
69
|
+
# Product Collection Group Id
|
|
70
|
+
group_id:,
|
|
71
|
+
request_options: {}
|
|
72
|
+
)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# @api private
|
|
76
|
+
sig { params(client: Dodopayments::Client).returns(T.attached_class) }
|
|
77
|
+
def self.new(client:)
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Resources
|
|
5
|
+
class ProductCollections
|
|
6
|
+
class Groups
|
|
7
|
+
sig do
|
|
8
|
+
returns(Dodopayments::Resources::ProductCollections::Groups::Items)
|
|
9
|
+
end
|
|
10
|
+
attr_reader :items
|
|
11
|
+
|
|
12
|
+
sig do
|
|
13
|
+
params(
|
|
14
|
+
id: String,
|
|
15
|
+
products:
|
|
16
|
+
T::Array[Dodopayments::ProductCollections::GroupProduct::OrHash],
|
|
17
|
+
group_name: T.nilable(String),
|
|
18
|
+
status: T.nilable(T::Boolean),
|
|
19
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
20
|
+
).returns(
|
|
21
|
+
Dodopayments::ProductCollections::ProductCollectionGroupResponse
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
def create(
|
|
25
|
+
# Product Collection Id
|
|
26
|
+
id,
|
|
27
|
+
# Products in this group
|
|
28
|
+
products:,
|
|
29
|
+
# Optional group name. Multiple groups can have null names, but named groups must
|
|
30
|
+
# be unique per collection
|
|
31
|
+
group_name: nil,
|
|
32
|
+
# Status of the group (defaults to true if not provided)
|
|
33
|
+
status: nil,
|
|
34
|
+
request_options: {}
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
sig do
|
|
39
|
+
params(
|
|
40
|
+
group_id: String,
|
|
41
|
+
id: String,
|
|
42
|
+
group_name: T.nilable(String),
|
|
43
|
+
product_order: T.nilable(T::Array[String]),
|
|
44
|
+
status: T.nilable(T::Boolean),
|
|
45
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
46
|
+
).void
|
|
47
|
+
end
|
|
48
|
+
def update(
|
|
49
|
+
# Path param: Product Collection Group Id
|
|
50
|
+
group_id,
|
|
51
|
+
# Path param: Product Collection Id
|
|
52
|
+
id:,
|
|
53
|
+
# Body param: Optional group name update: Some(Some(name)) = set name, Some(None)
|
|
54
|
+
# = clear name, None = no change
|
|
55
|
+
group_name: nil,
|
|
56
|
+
# Body param: Optional new order for products in this group (array of
|
|
57
|
+
# product_collection_group_pdts UUIDs)
|
|
58
|
+
product_order: nil,
|
|
59
|
+
# Body param: Optional status update
|
|
60
|
+
status: nil,
|
|
61
|
+
request_options: {}
|
|
62
|
+
)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
sig do
|
|
66
|
+
params(
|
|
67
|
+
group_id: String,
|
|
68
|
+
id: String,
|
|
69
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
70
|
+
).void
|
|
71
|
+
end
|
|
72
|
+
def delete(
|
|
73
|
+
# Product Collection Group Id
|
|
74
|
+
group_id,
|
|
75
|
+
# Product Collection Id
|
|
76
|
+
id:,
|
|
77
|
+
request_options: {}
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# @api private
|
|
82
|
+
sig { params(client: Dodopayments::Client).returns(T.attached_class) }
|
|
83
|
+
def self.new(client:)
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Resources
|
|
5
|
+
class ProductCollections
|
|
6
|
+
sig { returns(Dodopayments::Resources::ProductCollections::Groups) }
|
|
7
|
+
attr_reader :groups
|
|
8
|
+
|
|
9
|
+
sig do
|
|
10
|
+
params(
|
|
11
|
+
groups:
|
|
12
|
+
T::Array[
|
|
13
|
+
Dodopayments::ProductCollections::ProductCollectionGroupDetails::OrHash
|
|
14
|
+
],
|
|
15
|
+
name: String,
|
|
16
|
+
brand_id: T.nilable(String),
|
|
17
|
+
description: T.nilable(String),
|
|
18
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
19
|
+
).returns(Dodopayments::ProductCollection)
|
|
20
|
+
end
|
|
21
|
+
def create(
|
|
22
|
+
# Groups of products in this collection
|
|
23
|
+
groups:,
|
|
24
|
+
# Name of the product collection
|
|
25
|
+
name:,
|
|
26
|
+
# Brand id for the collection, if not provided will default to primary brand
|
|
27
|
+
brand_id: nil,
|
|
28
|
+
# Optional description of the product collection
|
|
29
|
+
description: nil,
|
|
30
|
+
request_options: {}
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
params(
|
|
36
|
+
id: String,
|
|
37
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
38
|
+
).returns(Dodopayments::ProductCollection)
|
|
39
|
+
end
|
|
40
|
+
def retrieve(
|
|
41
|
+
# Product Collection Id
|
|
42
|
+
id,
|
|
43
|
+
request_options: {}
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
sig do
|
|
48
|
+
params(
|
|
49
|
+
id: String,
|
|
50
|
+
brand_id: T.nilable(String),
|
|
51
|
+
description: T.nilable(String),
|
|
52
|
+
group_order: T.nilable(T::Array[String]),
|
|
53
|
+
image_id: T.nilable(String),
|
|
54
|
+
name: T.nilable(String),
|
|
55
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
56
|
+
).void
|
|
57
|
+
end
|
|
58
|
+
def update(
|
|
59
|
+
# Product Collection Id
|
|
60
|
+
id,
|
|
61
|
+
# Optional brand_id update
|
|
62
|
+
brand_id: nil,
|
|
63
|
+
# Optional description update - pass null to remove, omit to keep unchanged
|
|
64
|
+
description: nil,
|
|
65
|
+
# Optional new order for groups (array of group UUIDs in desired order)
|
|
66
|
+
group_order: nil,
|
|
67
|
+
# Optional image update - pass null to remove, omit to keep unchanged
|
|
68
|
+
image_id: nil,
|
|
69
|
+
# Optional new name for the collection
|
|
70
|
+
name: nil,
|
|
71
|
+
request_options: {}
|
|
72
|
+
)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
sig do
|
|
76
|
+
params(
|
|
77
|
+
archived: T::Boolean,
|
|
78
|
+
brand_id: String,
|
|
79
|
+
page_number: Integer,
|
|
80
|
+
page_size: Integer,
|
|
81
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
82
|
+
).returns(
|
|
83
|
+
Dodopayments::Internal::DefaultPageNumberPagination[
|
|
84
|
+
Dodopayments::Models::ProductCollectionListResponse
|
|
85
|
+
]
|
|
86
|
+
)
|
|
87
|
+
end
|
|
88
|
+
def list(
|
|
89
|
+
# List archived collections
|
|
90
|
+
archived: nil,
|
|
91
|
+
# Filter by Brand id
|
|
92
|
+
brand_id: nil,
|
|
93
|
+
# Page number default is 0
|
|
94
|
+
page_number: nil,
|
|
95
|
+
# Page size default is 10 max is 100
|
|
96
|
+
page_size: nil,
|
|
97
|
+
request_options: {}
|
|
98
|
+
)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
sig do
|
|
102
|
+
params(
|
|
103
|
+
id: String,
|
|
104
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
105
|
+
).void
|
|
106
|
+
end
|
|
107
|
+
def delete(
|
|
108
|
+
# Product Collection Id
|
|
109
|
+
id,
|
|
110
|
+
request_options: {}
|
|
111
|
+
)
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
sig do
|
|
115
|
+
params(
|
|
116
|
+
id: String,
|
|
117
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
118
|
+
).returns(Dodopayments::Models::ProductCollectionUnarchiveResponse)
|
|
119
|
+
end
|
|
120
|
+
def unarchive(
|
|
121
|
+
# Product Collection Id
|
|
122
|
+
id,
|
|
123
|
+
request_options: {}
|
|
124
|
+
)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
sig do
|
|
128
|
+
params(
|
|
129
|
+
id: String,
|
|
130
|
+
force_update: T.nilable(T::Boolean),
|
|
131
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
132
|
+
).returns(Dodopayments::Models::ProductCollectionUpdateImagesResponse)
|
|
133
|
+
end
|
|
134
|
+
def update_images(
|
|
135
|
+
# Product Collection Id
|
|
136
|
+
id,
|
|
137
|
+
# If true, generates a new image ID to force cache invalidation
|
|
138
|
+
force_update: nil,
|
|
139
|
+
request_options: {}
|
|
140
|
+
)
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# @api private
|
|
144
|
+
sig { params(client: Dodopayments::Client).returns(T.attached_class) }
|
|
145
|
+
def self.new(client:)
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
@@ -17,6 +17,7 @@ module Dodopayments
|
|
|
17
17
|
allowed_payment_method_types:
|
|
18
18
|
T.nilable(T::Array[Dodopayments::PaymentMethodTypes::OrSymbol]),
|
|
19
19
|
billing_currency: T.nilable(Dodopayments::Currency::OrSymbol),
|
|
20
|
+
customer_business_name: T.nilable(String),
|
|
20
21
|
discount_code: T.nilable(String),
|
|
21
22
|
discount_codes: T.nilable(T::Array[String]),
|
|
22
23
|
force_3ds: T.nilable(T::Boolean),
|
|
@@ -58,6 +59,10 @@ module Dodopayments
|
|
|
58
59
|
# Fix the currency in which the end customer is billed. If Dodo Payments cannot
|
|
59
60
|
# support that currency for this transaction, it will not proceed
|
|
60
61
|
billing_currency: nil,
|
|
62
|
+
# Optional business / legal name associated with the tax id. When provided
|
|
63
|
+
# together with a valid tax id for a B2B purchase, this name is rendered on the
|
|
64
|
+
# invoice instead of the customer's personal name.
|
|
65
|
+
customer_business_name: nil,
|
|
61
66
|
# DEPRECATED: Use discount_codes instead. Cannot be used together with
|
|
62
67
|
# discount_codes.
|
|
63
68
|
discount_code: nil,
|
|
@@ -139,6 +144,7 @@ module Dodopayments
|
|
|
139
144
|
Dodopayments::SubscriptionUpdateParams::CreditEntitlementCart::OrHash
|
|
140
145
|
]
|
|
141
146
|
),
|
|
147
|
+
customer_business_name: T.nilable(String),
|
|
142
148
|
customer_name: T.nilable(String),
|
|
143
149
|
disable_on_demand:
|
|
144
150
|
T.nilable(
|
|
@@ -166,6 +172,11 @@ module Dodopayments
|
|
|
166
172
|
cancellation_feedback: nil,
|
|
167
173
|
# Update credit entitlement cart settings
|
|
168
174
|
credit_entitlement_cart: nil,
|
|
175
|
+
# Optional business / legal name associated with the tax id. When provided
|
|
176
|
+
# together with a valid tax id for a B2B subscription, this name is rendered on
|
|
177
|
+
# the invoice instead of the customer's personal name. Send `null` to explicitly
|
|
178
|
+
# clear the business name.
|
|
179
|
+
customer_business_name: nil,
|
|
169
180
|
customer_name: nil,
|
|
170
181
|
disable_on_demand: nil,
|
|
171
182
|
metadata: nil,
|
|
@@ -485,10 +496,10 @@ module Dodopayments
|
|
|
485
496
|
sig do
|
|
486
497
|
params(
|
|
487
498
|
subscription_id: String,
|
|
488
|
-
|
|
499
|
+
payment_method:
|
|
489
500
|
T.any(
|
|
490
|
-
Dodopayments::SubscriptionUpdatePaymentMethodParams::
|
|
491
|
-
Dodopayments::SubscriptionUpdatePaymentMethodParams::
|
|
501
|
+
Dodopayments::SubscriptionUpdatePaymentMethodParams::PaymentMethod::New::OrHash,
|
|
502
|
+
Dodopayments::SubscriptionUpdatePaymentMethodParams::PaymentMethod::Existing::OrHash
|
|
492
503
|
),
|
|
493
504
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
494
505
|
).returns(Dodopayments::Models::SubscriptionUpdatePaymentMethodResponse)
|
|
@@ -496,7 +507,7 @@ module Dodopayments
|
|
|
496
507
|
def update_payment_method(
|
|
497
508
|
# Subscription Id
|
|
498
509
|
subscription_id,
|
|
499
|
-
|
|
510
|
+
payment_method:,
|
|
500
511
|
request_options: {}
|
|
501
512
|
)
|
|
502
513
|
end
|
data/sig/dodopayments/client.rbs
CHANGED
|
@@ -3,6 +3,7 @@ module Dodopayments
|
|
|
3
3
|
type checkout_session_flags =
|
|
4
4
|
{
|
|
5
5
|
allow_currency_selection: bool,
|
|
6
|
+
allow_customer_editing_business_name: bool,
|
|
6
7
|
allow_customer_editing_city: bool,
|
|
7
8
|
allow_customer_editing_country: bool,
|
|
8
9
|
allow_customer_editing_email: bool,
|
|
@@ -24,6 +25,10 @@ module Dodopayments
|
|
|
24
25
|
|
|
25
26
|
def allow_currency_selection=: (bool) -> bool
|
|
26
27
|
|
|
28
|
+
attr_reader allow_customer_editing_business_name: bool?
|
|
29
|
+
|
|
30
|
+
def allow_customer_editing_business_name=: (bool) -> bool
|
|
31
|
+
|
|
27
32
|
attr_reader allow_customer_editing_city: bool?
|
|
28
33
|
|
|
29
34
|
def allow_customer_editing_city=: (bool) -> bool
|
|
@@ -82,6 +87,7 @@ module Dodopayments
|
|
|
82
87
|
|
|
83
88
|
def initialize: (
|
|
84
89
|
?allow_currency_selection: bool,
|
|
90
|
+
?allow_customer_editing_business_name: bool,
|
|
85
91
|
?allow_customer_editing_city: bool,
|
|
86
92
|
?allow_customer_editing_country: bool,
|
|
87
93
|
?allow_customer_editing_email: bool,
|
|
@@ -100,6 +106,7 @@ module Dodopayments
|
|
|
100
106
|
|
|
101
107
|
def to_hash: -> {
|
|
102
108
|
allow_currency_selection: bool,
|
|
109
|
+
allow_customer_editing_business_name: bool,
|
|
103
110
|
allow_customer_editing_city: bool,
|
|
104
111
|
allow_customer_editing_country: bool,
|
|
105
112
|
allow_customer_editing_email: bool,
|