dodopayments 2.29.0 → 2.31.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/client.rb +4 -0
- data/lib/dodopayments/models/balance_ledger_entry.rb +3 -0
- data/lib/dodopayments/models/balance_retrieve_ledger_params.rb +3 -0
- data/lib/dodopayments/models/checkout_session_flags.rb +14 -1
- data/lib/dodopayments/models/checkout_session_preview_response.rb +86 -4
- data/lib/dodopayments/models/checkout_session_request.rb +18 -5
- data/lib/dodopayments/models/customers/email_log_item.rb +3 -2
- data/lib/dodopayments/models/customers/email_policies.rb +7 -5
- data/lib/dodopayments/models/discount_create_params.rb +11 -8
- data/lib/dodopayments/models/discount_update_params.rb +6 -5
- data/lib/dodopayments/models/moderation_category.rb +31 -0
- data/lib/dodopayments/models/moderation_category_provenance.rb +150 -0
- data/lib/dodopayments/models/moderation_category_scores.rb +150 -0
- data/lib/dodopayments/models/moderation_decision.rb +18 -0
- data/lib/dodopayments/models/moderation_provenance.rb +18 -0
- data/lib/dodopayments/models/moderation_retrieve_usage_params.rb +14 -0
- data/lib/dodopayments/models/moderation_retrieve_usage_response.rb +61 -0
- data/lib/dodopayments/models/moderation_screen_params.rb +44 -0
- data/lib/dodopayments/models/moderation_screen_response.rb +99 -0
- data/lib/dodopayments/models/payment.rb +25 -3
- data/lib/dodopayments/models/payment_list_response.rb +21 -1
- data/lib/dodopayments/models/payouts/breakup/detail_list_response.rb +5 -4
- data/lib/dodopayments/models/payouts/breakup_retrieve_response.rb +17 -1
- data/lib/dodopayments/models/refund.rb +22 -1
- data/lib/dodopayments/models/refund_list_item.rb +22 -1
- data/lib/dodopayments/models/refund_network_reference_type.rb +19 -0
- data/lib/dodopayments/models/subscription.rb +10 -1
- data/lib/dodopayments/models/subscription_cancelled_by.rb +54 -0
- data/lib/dodopayments/models/subscription_list_response.rb +10 -1
- data/lib/dodopayments/models/subscription_preview_change_plan_response.rb +18 -7
- data/lib/dodopayments/models.rb +18 -0
- data/lib/dodopayments/resources/checkout_sessions.rb +6 -6
- data/lib/dodopayments/resources/moderation.rb +81 -0
- data/lib/dodopayments/resources/payouts/breakup/details.rb +4 -4
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +12 -0
- data/rbi/dodopayments/client.rbi +3 -0
- data/rbi/dodopayments/models/balance_ledger_entry.rbi +15 -0
- data/rbi/dodopayments/models/balance_retrieve_ledger_params.rbi +15 -0
- data/rbi/dodopayments/models/checkout_session_flags.rbi +21 -0
- data/rbi/dodopayments/models/checkout_session_preview_response.rbi +130 -6
- data/rbi/dodopayments/models/checkout_session_request.rbi +31 -8
- data/rbi/dodopayments/models/customers/email_log_item.rbi +4 -2
- data/rbi/dodopayments/models/customers/email_policies.rbi +10 -6
- data/rbi/dodopayments/models/discount_create_params.rbi +18 -12
- data/rbi/dodopayments/models/discount_update_params.rbi +8 -6
- data/rbi/dodopayments/models/moderation_category.rbi +88 -0
- data/rbi/dodopayments/models/moderation_category_provenance.rbi +184 -0
- data/rbi/dodopayments/models/moderation_category_scores.rbi +171 -0
- data/rbi/dodopayments/models/moderation_decision.rbi +27 -0
- data/rbi/dodopayments/models/moderation_provenance.rbi +28 -0
- data/rbi/dodopayments/models/moderation_retrieve_usage_params.rbi +32 -0
- data/rbi/dodopayments/models/moderation_retrieve_usage_response.rbi +104 -0
- data/rbi/dodopayments/models/moderation_screen_params.rbi +68 -0
- data/rbi/dodopayments/models/moderation_screen_response.rbi +135 -0
- data/rbi/dodopayments/models/payment.rbi +30 -2
- data/rbi/dodopayments/models/payment_list_response.rbi +24 -0
- data/rbi/dodopayments/models/payouts/breakup/detail_list_response.rbi +8 -6
- data/rbi/dodopayments/models/payouts/breakup_retrieve_response.rbi +19 -2
- data/rbi/dodopayments/models/refund.rbi +26 -0
- data/rbi/dodopayments/models/refund_list_item.rbi +26 -0
- data/rbi/dodopayments/models/refund_network_reference_type.rbi +41 -0
- data/rbi/dodopayments/models/subscription.rbi +18 -0
- data/rbi/dodopayments/models/subscription_cancelled_by.rbi +107 -0
- data/rbi/dodopayments/models/subscription_list_response.rbi +18 -0
- data/rbi/dodopayments/models/subscription_preview_change_plan_response.rbi +24 -10
- data/rbi/dodopayments/models.rbi +20 -0
- data/rbi/dodopayments/resources/checkout_sessions.rbi +30 -4
- data/rbi/dodopayments/resources/discounts.rbi +5 -3
- data/rbi/dodopayments/resources/moderation.rbi +64 -0
- data/rbi/dodopayments/resources/payouts/breakup/details.rbi +4 -4
- data/sig/dodopayments/client.rbs +2 -0
- data/sig/dodopayments/models/balance_ledger_entry.rbs +6 -0
- data/sig/dodopayments/models/balance_retrieve_ledger_params.rbs +6 -0
- data/sig/dodopayments/models/checkout_session_flags.rbs +7 -0
- data/sig/dodopayments/models/checkout_session_preview_response.rbs +52 -0
- data/sig/dodopayments/models/checkout_session_request.rbs +4 -6
- data/sig/dodopayments/models/moderation_category.rbs +46 -0
- data/sig/dodopayments/models/moderation_category_provenance.rbs +100 -0
- data/sig/dodopayments/models/moderation_category_scores.rbs +100 -0
- data/sig/dodopayments/models/moderation_decision.rbs +15 -0
- data/sig/dodopayments/models/moderation_provenance.rbs +14 -0
- data/sig/dodopayments/models/moderation_retrieve_usage_params.rbs +15 -0
- data/sig/dodopayments/models/moderation_retrieve_usage_response.rbs +42 -0
- data/sig/dodopayments/models/moderation_screen_params.rbs +32 -0
- data/sig/dodopayments/models/moderation_screen_response.rbs +65 -0
- data/sig/dodopayments/models/payment.rbs +10 -0
- data/sig/dodopayments/models/payment_list_response.rbs +10 -0
- data/sig/dodopayments/models/refund.rbs +10 -0
- data/sig/dodopayments/models/refund_list_item.rbs +10 -0
- data/sig/dodopayments/models/refund_network_reference_type.rbs +20 -0
- data/sig/dodopayments/models/subscription.rbs +5 -0
- data/sig/dodopayments/models/subscription_cancelled_by.rbs +43 -0
- data/sig/dodopayments/models/subscription_list_response.rbs +5 -0
- data/sig/dodopayments/models/subscription_preview_change_plan_response.rbs +5 -0
- data/sig/dodopayments/models.rbs +18 -0
- data/sig/dodopayments/resources/checkout_sessions.rbs +2 -2
- data/sig/dodopayments/resources/moderation.rbs +18 -0
- metadata +38 -2
|
@@ -118,6 +118,18 @@ module Dodopayments
|
|
|
118
118
|
sig { returns(T.nilable(Time)) }
|
|
119
119
|
attr_accessor :cancelled_at
|
|
120
120
|
|
|
121
|
+
# The caller that cancelled the subscription or scheduled its cancel. `null` when
|
|
122
|
+
# no caller is known, for example when the system cancelled the subscription.
|
|
123
|
+
sig { returns(T.nilable(Dodopayments::SubscriptionCancelledBy)) }
|
|
124
|
+
attr_reader :cancelled_by
|
|
125
|
+
|
|
126
|
+
sig do
|
|
127
|
+
params(
|
|
128
|
+
cancelled_by: T.nilable(Dodopayments::SubscriptionCancelledBy::OrHash)
|
|
129
|
+
).void
|
|
130
|
+
end
|
|
131
|
+
attr_writer :cancelled_by
|
|
132
|
+
|
|
121
133
|
# Business / legal name associated with the tax id (B2B). When set this is used on
|
|
122
134
|
# the invoice in place of the customer's personal name.
|
|
123
135
|
sig { returns(T.nilable(String)) }
|
|
@@ -194,6 +206,8 @@ module Dodopayments
|
|
|
194
206
|
tax_inclusive: T::Boolean,
|
|
195
207
|
trial_period_days: Integer,
|
|
196
208
|
cancelled_at: T.nilable(Time),
|
|
209
|
+
cancelled_by:
|
|
210
|
+
T.nilable(Dodopayments::SubscriptionCancelledBy::OrHash),
|
|
197
211
|
customer_business_name: T.nilable(String),
|
|
198
212
|
discount_cycles_remaining: T.nilable(Integer),
|
|
199
213
|
discount_id: T.nilable(String),
|
|
@@ -256,6 +270,9 @@ module Dodopayments
|
|
|
256
270
|
trial_period_days:,
|
|
257
271
|
# Cancelled timestamp if the subscription is cancelled
|
|
258
272
|
cancelled_at: nil,
|
|
273
|
+
# The caller that cancelled the subscription or scheduled its cancel. `null` when
|
|
274
|
+
# no caller is known, for example when the system cancelled the subscription.
|
|
275
|
+
cancelled_by: nil,
|
|
259
276
|
# Business / legal name associated with the tax id (B2B). When set this is used on
|
|
260
277
|
# the invoice in place of the customer's personal name.
|
|
261
278
|
customer_business_name: nil,
|
|
@@ -312,6 +329,7 @@ module Dodopayments
|
|
|
312
329
|
tax_inclusive: T::Boolean,
|
|
313
330
|
trial_period_days: Integer,
|
|
314
331
|
cancelled_at: T.nilable(Time),
|
|
332
|
+
cancelled_by: T.nilable(Dodopayments::SubscriptionCancelledBy),
|
|
315
333
|
customer_business_name: T.nilable(String),
|
|
316
334
|
discount_cycles_remaining: T.nilable(Integer),
|
|
317
335
|
discount_id: T.nilable(String),
|
|
@@ -477,14 +477,21 @@ module Dodopayments
|
|
|
477
477
|
sig { returns(Dodopayments::Currency::TaggedSymbol) }
|
|
478
478
|
attr_accessor :currency
|
|
479
479
|
|
|
480
|
-
# Net credit movement in the smallest
|
|
481
|
-
#
|
|
482
|
-
#
|
|
483
|
-
#
|
|
484
|
-
#
|
|
480
|
+
# Net credit movement in the smallest unit of `customer_credits_currency` (e.g.
|
|
481
|
+
# cents). Read `customer_credits_currency` for the currency. It can differ from
|
|
482
|
+
# `currency`. **Negative** – credits were deducted from the customer's balance to
|
|
483
|
+
# offset the charge (typical on upgrades). **Positive** – credits were added to
|
|
484
|
+
# the customer's balance, either from a downgrade proration refund or from
|
|
485
|
+
# topping-up the wallet to meet a gateway minimum-charge threshold. **Zero** – no
|
|
486
|
+
# credit movement occurred.
|
|
485
487
|
sig { returns(Integer) }
|
|
486
488
|
attr_accessor :customer_credits
|
|
487
489
|
|
|
490
|
+
# This field gives the currency of `customer_credits`. The credit wallet uses the
|
|
491
|
+
# subscription currency.
|
|
492
|
+
sig { returns(Dodopayments::Currency::TaggedSymbol) }
|
|
493
|
+
attr_accessor :customer_credits_currency
|
|
494
|
+
|
|
488
495
|
sig { returns(Integer) }
|
|
489
496
|
attr_accessor :settlement_amount
|
|
490
497
|
|
|
@@ -504,6 +511,7 @@ module Dodopayments
|
|
|
504
511
|
params(
|
|
505
512
|
currency: Dodopayments::Currency::OrSymbol,
|
|
506
513
|
customer_credits: Integer,
|
|
514
|
+
customer_credits_currency: Dodopayments::Currency::OrSymbol,
|
|
507
515
|
settlement_amount: Integer,
|
|
508
516
|
settlement_currency: Dodopayments::Currency::OrSymbol,
|
|
509
517
|
total_amount: Integer,
|
|
@@ -513,12 +521,17 @@ module Dodopayments
|
|
|
513
521
|
end
|
|
514
522
|
def self.new(
|
|
515
523
|
currency:,
|
|
516
|
-
# Net credit movement in the smallest
|
|
517
|
-
#
|
|
518
|
-
#
|
|
519
|
-
#
|
|
520
|
-
#
|
|
524
|
+
# Net credit movement in the smallest unit of `customer_credits_currency` (e.g.
|
|
525
|
+
# cents). Read `customer_credits_currency` for the currency. It can differ from
|
|
526
|
+
# `currency`. **Negative** – credits were deducted from the customer's balance to
|
|
527
|
+
# offset the charge (typical on upgrades). **Positive** – credits were added to
|
|
528
|
+
# the customer's balance, either from a downgrade proration refund or from
|
|
529
|
+
# topping-up the wallet to meet a gateway minimum-charge threshold. **Zero** – no
|
|
530
|
+
# credit movement occurred.
|
|
521
531
|
customer_credits:,
|
|
532
|
+
# This field gives the currency of `customer_credits`. The credit wallet uses the
|
|
533
|
+
# subscription currency.
|
|
534
|
+
customer_credits_currency:,
|
|
522
535
|
settlement_amount:,
|
|
523
536
|
settlement_currency:,
|
|
524
537
|
total_amount:,
|
|
@@ -532,6 +545,7 @@ module Dodopayments
|
|
|
532
545
|
{
|
|
533
546
|
currency: Dodopayments::Currency::TaggedSymbol,
|
|
534
547
|
customer_credits: Integer,
|
|
548
|
+
customer_credits_currency: Dodopayments::Currency::TaggedSymbol,
|
|
535
549
|
settlement_amount: Integer,
|
|
536
550
|
settlement_currency: Dodopayments::Currency::TaggedSymbol,
|
|
537
551
|
total_amount: Integer,
|
data/rbi/dodopayments/models.rbi
CHANGED
|
@@ -357,6 +357,22 @@ module Dodopayments
|
|
|
357
357
|
MiscListSupportedCountriesParams =
|
|
358
358
|
Dodopayments::Models::MiscListSupportedCountriesParams
|
|
359
359
|
|
|
360
|
+
ModerationCategory = Dodopayments::Models::ModerationCategory
|
|
361
|
+
|
|
362
|
+
ModerationCategoryProvenance =
|
|
363
|
+
Dodopayments::Models::ModerationCategoryProvenance
|
|
364
|
+
|
|
365
|
+
ModerationCategoryScores = Dodopayments::Models::ModerationCategoryScores
|
|
366
|
+
|
|
367
|
+
ModerationDecision = Dodopayments::Models::ModerationDecision
|
|
368
|
+
|
|
369
|
+
ModerationProvenance = Dodopayments::Models::ModerationProvenance
|
|
370
|
+
|
|
371
|
+
ModerationRetrieveUsageParams =
|
|
372
|
+
Dodopayments::Models::ModerationRetrieveUsageParams
|
|
373
|
+
|
|
374
|
+
ModerationScreenParams = Dodopayments::Models::ModerationScreenParams
|
|
375
|
+
|
|
360
376
|
NewCustomer = Dodopayments::Models::NewCustomer
|
|
361
377
|
|
|
362
378
|
OnDemandSubscription = Dodopayments::Models::OnDemandSubscription
|
|
@@ -468,6 +484,8 @@ module Dodopayments
|
|
|
468
484
|
|
|
469
485
|
RefundListParams = Dodopayments::Models::RefundListParams
|
|
470
486
|
|
|
487
|
+
RefundNetworkReferenceType = Dodopayments::Models::RefundNetworkReferenceType
|
|
488
|
+
|
|
471
489
|
RefundRetrieveParams = Dodopayments::Models::RefundRetrieveParams
|
|
472
490
|
|
|
473
491
|
RefundStatus = Dodopayments::Models::RefundStatus
|
|
@@ -485,6 +503,8 @@ module Dodopayments
|
|
|
485
503
|
SubscriptionCancelChangePlanParams =
|
|
486
504
|
Dodopayments::Models::SubscriptionCancelChangePlanParams
|
|
487
505
|
|
|
506
|
+
SubscriptionCancelledBy = Dodopayments::Models::SubscriptionCancelledBy
|
|
507
|
+
|
|
488
508
|
SubscriptionCancelledWebhookEvent =
|
|
489
509
|
Dodopayments::Models::SubscriptionCancelledWebhookEvent
|
|
490
510
|
|
|
@@ -30,7 +30,7 @@ module Dodopayments
|
|
|
30
30
|
mandate_min_amount_inr_paise: T.nilable(Integer),
|
|
31
31
|
metadata:
|
|
32
32
|
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
33
|
-
minimal_address: T::Boolean,
|
|
33
|
+
minimal_address: T.nilable(T::Boolean),
|
|
34
34
|
payment_method_id: T.nilable(String),
|
|
35
35
|
product_collection_id: T.nilable(String),
|
|
36
36
|
return_url: T.nilable(String),
|
|
@@ -42,6 +42,9 @@ module Dodopayments
|
|
|
42
42
|
).returns(Dodopayments::CheckoutSessionResponse)
|
|
43
43
|
end
|
|
44
44
|
def create(
|
|
45
|
+
# The products of the checkout. A cart holds at most 20 of them, one-time and
|
|
46
|
+
# subscription products together. An empty cart is valid for the
|
|
47
|
+
# product-collection flow, where the customer chooses the product later.
|
|
45
48
|
product_cart:,
|
|
46
49
|
# Customers will never see payment methods that are not in this list. However,
|
|
47
50
|
# adding a method here does not guarantee customers will see it. Availability
|
|
@@ -52,7 +55,14 @@ module Dodopayments
|
|
|
52
55
|
allowed_payment_method_types: nil,
|
|
53
56
|
# Billing address information for the session
|
|
54
57
|
billing_address: nil,
|
|
55
|
-
#
|
|
58
|
+
# The currency to charge the customer in.
|
|
59
|
+
#
|
|
60
|
+
# Adaptive pricing must be enabled for the business. The customer then pays in
|
|
61
|
+
# this currency. If you do not set it, the currency comes from the billing
|
|
62
|
+
# country.
|
|
63
|
+
#
|
|
64
|
+
# If adaptive pricing is disabled, the API discards this field. The currency then
|
|
65
|
+
# comes from the product price, or from the billing country.
|
|
56
66
|
billing_currency: nil,
|
|
57
67
|
# The URL to redirect the customer if they cancel or go back from the checkout. If
|
|
58
68
|
# not provided, the back button will not be displayed.
|
|
@@ -91,6 +101,9 @@ module Dodopayments
|
|
|
91
101
|
metadata: nil,
|
|
92
102
|
# If true, only zipcode is required when confirm is true; other address fields
|
|
93
103
|
# remain optional
|
|
104
|
+
#
|
|
105
|
+
# Default is true when `feature_flags.single_page` is true. Otherwise, default is
|
|
106
|
+
# false.
|
|
94
107
|
minimal_address: nil,
|
|
95
108
|
# Optional payment method ID to use for this checkout session. Only allowed when
|
|
96
109
|
# `confirm` is true. If provided, existing customer id must also be provided.
|
|
@@ -151,7 +164,7 @@ module Dodopayments
|
|
|
151
164
|
mandate_min_amount_inr_paise: T.nilable(Integer),
|
|
152
165
|
metadata:
|
|
153
166
|
T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
|
|
154
|
-
minimal_address: T::Boolean,
|
|
167
|
+
minimal_address: T.nilable(T::Boolean),
|
|
155
168
|
payment_method_id: T.nilable(String),
|
|
156
169
|
product_collection_id: T.nilable(String),
|
|
157
170
|
return_url: T.nilable(String),
|
|
@@ -163,6 +176,9 @@ module Dodopayments
|
|
|
163
176
|
).returns(Dodopayments::Models::CheckoutSessionPreviewResponse)
|
|
164
177
|
end
|
|
165
178
|
def preview(
|
|
179
|
+
# The products of the checkout. A cart holds at most 20 of them, one-time and
|
|
180
|
+
# subscription products together. An empty cart is valid for the
|
|
181
|
+
# product-collection flow, where the customer chooses the product later.
|
|
166
182
|
product_cart:,
|
|
167
183
|
# Customers will never see payment methods that are not in this list. However,
|
|
168
184
|
# adding a method here does not guarantee customers will see it. Availability
|
|
@@ -173,7 +189,14 @@ module Dodopayments
|
|
|
173
189
|
allowed_payment_method_types: nil,
|
|
174
190
|
# Billing address information for the session
|
|
175
191
|
billing_address: nil,
|
|
176
|
-
#
|
|
192
|
+
# The currency to charge the customer in.
|
|
193
|
+
#
|
|
194
|
+
# Adaptive pricing must be enabled for the business. The customer then pays in
|
|
195
|
+
# this currency. If you do not set it, the currency comes from the billing
|
|
196
|
+
# country.
|
|
197
|
+
#
|
|
198
|
+
# If adaptive pricing is disabled, the API discards this field. The currency then
|
|
199
|
+
# comes from the product price, or from the billing country.
|
|
177
200
|
billing_currency: nil,
|
|
178
201
|
# The URL to redirect the customer if they cancel or go back from the checkout. If
|
|
179
202
|
# not provided, the back button will not be displayed.
|
|
@@ -212,6 +235,9 @@ module Dodopayments
|
|
|
212
235
|
metadata: nil,
|
|
213
236
|
# If true, only zipcode is required when confirm is true; other address fields
|
|
214
237
|
# remain optional
|
|
238
|
+
#
|
|
239
|
+
# Default is true when `feature_flags.single_page` is true. Otherwise, default is
|
|
240
|
+
# false.
|
|
215
241
|
minimal_address: nil,
|
|
216
242
|
# Optional payment method ID to use for this checkout session. Only allowed when
|
|
217
243
|
# `confirm` is true. If provided, existing customer id must also be provided.
|
|
@@ -46,9 +46,11 @@ module Dodopayments
|
|
|
46
46
|
# - If omitted, a random 16-character code is generated.
|
|
47
47
|
code: nil,
|
|
48
48
|
# Per-currency options (flat deduction / percentage cap + minimum subtotal).
|
|
49
|
-
#
|
|
50
|
-
#
|
|
51
|
-
# `
|
|
49
|
+
# Checkout uses the row for the currency the buyer pays in. For any other currency
|
|
50
|
+
# it converts the default row. Required for `flat` codes (must include a
|
|
51
|
+
# resolvable default); optional per-currency caps for `percentage` codes. Per-row
|
|
52
|
+
# invariants are checked in `normalize_currency_options`, not via
|
|
53
|
+
# `#[validate(nested)]`.
|
|
52
54
|
currency_options: nil,
|
|
53
55
|
# Who may redeem this discount code. Defaults to `any` (unrestricted). `specific`
|
|
54
56
|
# starts with zero attached customers (fails closed) until customers are attached
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Resources
|
|
5
|
+
class Moderation
|
|
6
|
+
# Shows how many billable screens you made and how close you are to your next
|
|
7
|
+
# charge.
|
|
8
|
+
#
|
|
9
|
+
# **Billing.** A billable screen is a live-mode screen that returns a verdict.
|
|
10
|
+
# Dodo Payments charges $0.30 for each full block of 1000 billable screens and
|
|
11
|
+
# debits the fee from your balance. Each full block is charged within one hour.
|
|
12
|
+
# Screens that do not fill a block stay unbilled until they do. Errors and
|
|
13
|
+
# test-mode screens are free and are not counted.
|
|
14
|
+
sig do
|
|
15
|
+
params(request_options: Dodopayments::RequestOptions::OrHash).returns(
|
|
16
|
+
Dodopayments::Models::ModerationRetrieveUsageResponse
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
def retrieve_usage(request_options: {})
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Screens text, an image, or both, and returns a verdict: `allow`, `flag` or
|
|
23
|
+
# `deny`. The API is fail-closed: do not generate when you get no verdict.
|
|
24
|
+
#
|
|
25
|
+
# **Pricing.** Dodo Payments charges $0.30 per 1000 billable screens and debits
|
|
26
|
+
# the fee from your balance. A billable screen is a live-mode screen that returns
|
|
27
|
+
# a verdict. Errors and test-mode screens are free.
|
|
28
|
+
#
|
|
29
|
+
# **429.** Honour `Retry-After` and retry. A 429 is a throughput limit, not a
|
|
30
|
+
# verdict.
|
|
31
|
+
#
|
|
32
|
+
# **Test mode** returns mock verdicts and never calls the model. The default
|
|
33
|
+
# verdict is `allow`. Put one of these strings in `text` to select another
|
|
34
|
+
# outcome: `dodo_mock_flag` (`flag`), `dodo_mock_deny` (`deny`),
|
|
35
|
+
# `dodo_mock_overloaded` (429) or `dodo_mock_not_ready` (503).
|
|
36
|
+
sig do
|
|
37
|
+
params(
|
|
38
|
+
image: T.nilable(String),
|
|
39
|
+
request_id: T.nilable(String),
|
|
40
|
+
text: T.nilable(String),
|
|
41
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
42
|
+
).returns(Dodopayments::Models::ModerationScreenResponse)
|
|
43
|
+
end
|
|
44
|
+
def screen(
|
|
45
|
+
# The image to screen, as base64, with or without a `data:image/...;base64,`
|
|
46
|
+
# prefix. The formats are JPEG, PNG, WebP, GIF and BMP. The limit is 6991530
|
|
47
|
+
# base64 characters, and the decoded image must be at most 5 MiB.
|
|
48
|
+
image: nil,
|
|
49
|
+
# Your identifier for this screen, up to 128 characters, with no control
|
|
50
|
+
# characters. The response returns it in `request_id`.
|
|
51
|
+
request_id: nil,
|
|
52
|
+
# The text to screen, up to 8000 characters.
|
|
53
|
+
text: nil,
|
|
54
|
+
request_options: {}
|
|
55
|
+
)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# @api private
|
|
59
|
+
sig { params(client: Dodopayments::Client).returns(T.attached_class) }
|
|
60
|
+
def self.new(client:)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -5,10 +5,10 @@ module Dodopayments
|
|
|
5
5
|
class Payouts
|
|
6
6
|
class Breakup
|
|
7
7
|
class Details
|
|
8
|
-
# Returns paginated individual balance ledger entries for a payout
|
|
9
|
-
#
|
|
10
|
-
# `page_size` (default 10, max 100) and `page_number` (default 0)
|
|
11
|
-
# parameters.
|
|
8
|
+
# Returns paginated individual balance ledger entries for a payout. Each entry is
|
|
9
|
+
# converted into the payout's currency at the rate the payout settled at. Supports
|
|
10
|
+
# pagination via `page_size` (default 10, max 100) and `page_number` (default 0)
|
|
11
|
+
# query parameters.
|
|
12
12
|
sig do
|
|
13
13
|
params(
|
|
14
14
|
payout_id: String,
|
data/sig/dodopayments/client.rbs
CHANGED
|
@@ -105,6 +105,9 @@ module Dodopayments
|
|
|
105
105
|
| :dispute_fees_reversal
|
|
106
106
|
| :deflection_fees
|
|
107
107
|
| :deflection_fees_reversal
|
|
108
|
+
| :reserve_hold
|
|
109
|
+
| :reserve_release
|
|
110
|
+
| :moderation_fees
|
|
108
111
|
|
|
109
112
|
module EventType
|
|
110
113
|
extend Dodopayments::Internal::Type::Enum
|
|
@@ -137,6 +140,9 @@ module Dodopayments
|
|
|
137
140
|
DISPUTE_FEES_REVERSAL: :dispute_fees_reversal
|
|
138
141
|
DEFLECTION_FEES: :deflection_fees
|
|
139
142
|
DEFLECTION_FEES_REVERSAL: :deflection_fees_reversal
|
|
143
|
+
RESERVE_HOLD: :reserve_hold
|
|
144
|
+
RESERVE_RELEASE: :reserve_release
|
|
145
|
+
MODERATION_FEES: :moderation_fees
|
|
140
146
|
|
|
141
147
|
def self?.values: -> ::Array[Dodopayments::Models::BalanceLedgerEntry::event_type]
|
|
142
148
|
end
|
|
@@ -405,6 +405,9 @@ module Dodopayments
|
|
|
405
405
|
| :dispute_fees_reversal
|
|
406
406
|
| :deflection_fees
|
|
407
407
|
| :deflection_fees_reversal
|
|
408
|
+
| :reserve_hold
|
|
409
|
+
| :reserve_release
|
|
410
|
+
| :moderation_fees
|
|
408
411
|
|
|
409
412
|
module EventType
|
|
410
413
|
extend Dodopayments::Internal::Type::Enum
|
|
@@ -437,6 +440,9 @@ module Dodopayments
|
|
|
437
440
|
DISPUTE_FEES_REVERSAL: :dispute_fees_reversal
|
|
438
441
|
DEFLECTION_FEES: :deflection_fees
|
|
439
442
|
DEFLECTION_FEES_REVERSAL: :deflection_fees_reversal
|
|
443
|
+
RESERVE_HOLD: :reserve_hold
|
|
444
|
+
RESERVE_RELEASE: :reserve_release
|
|
445
|
+
MODERATION_FEES: :moderation_fees
|
|
440
446
|
|
|
441
447
|
def self?.values: -> ::Array[Dodopayments::Models::BalanceRetrieveLedgerParams::event_type]
|
|
442
448
|
end
|
|
@@ -18,6 +18,7 @@ module Dodopayments
|
|
|
18
18
|
allow_tax_id: bool,
|
|
19
19
|
always_create_new_customer: bool,
|
|
20
20
|
redirect_immediately: bool,
|
|
21
|
+
require_cardholder_name: bool,
|
|
21
22
|
require_phone_number: bool,
|
|
22
23
|
require_tax_id: bool,
|
|
23
24
|
single_page: bool
|
|
@@ -88,6 +89,10 @@ module Dodopayments
|
|
|
88
89
|
|
|
89
90
|
def redirect_immediately=: (bool) -> bool
|
|
90
91
|
|
|
92
|
+
attr_reader require_cardholder_name: bool?
|
|
93
|
+
|
|
94
|
+
def require_cardholder_name=: (bool) -> bool
|
|
95
|
+
|
|
91
96
|
attr_reader require_phone_number: bool?
|
|
92
97
|
|
|
93
98
|
def require_phone_number=: (bool) -> bool
|
|
@@ -117,6 +122,7 @@ module Dodopayments
|
|
|
117
122
|
?allow_tax_id: bool,
|
|
118
123
|
?always_create_new_customer: bool,
|
|
119
124
|
?redirect_immediately: bool,
|
|
125
|
+
?require_cardholder_name: bool,
|
|
120
126
|
?require_phone_number: bool,
|
|
121
127
|
?require_tax_id: bool,
|
|
122
128
|
?single_page: bool
|
|
@@ -139,6 +145,7 @@ module Dodopayments
|
|
|
139
145
|
allow_tax_id: bool,
|
|
140
146
|
always_create_new_customer: bool,
|
|
141
147
|
redirect_immediately: bool,
|
|
148
|
+
require_cardholder_name: bool,
|
|
142
149
|
require_phone_number: bool,
|
|
143
150
|
require_tax_id: bool,
|
|
144
151
|
single_page: bool
|
|
@@ -11,6 +11,7 @@ module Dodopayments
|
|
|
11
11
|
total_price: Integer,
|
|
12
12
|
next_billing_date: Time?,
|
|
13
13
|
recurring_breakup: Dodopayments::Models::CheckoutSessionPreviewResponse::RecurringBreakup?,
|
|
14
|
+
subscriptions: ::Array[Dodopayments::Models::CheckoutSessionPreviewResponse::Subscription]?,
|
|
14
15
|
tax_id_business_name: String?,
|
|
15
16
|
tax_id_err_msg: String?,
|
|
16
17
|
tax_id_format_name: String?,
|
|
@@ -38,6 +39,8 @@ module Dodopayments
|
|
|
38
39
|
|
|
39
40
|
attr_accessor recurring_breakup: Dodopayments::Models::CheckoutSessionPreviewResponse::RecurringBreakup?
|
|
40
41
|
|
|
42
|
+
attr_accessor subscriptions: ::Array[Dodopayments::Models::CheckoutSessionPreviewResponse::Subscription]?
|
|
43
|
+
|
|
41
44
|
attr_accessor tax_id_business_name: String?
|
|
42
45
|
|
|
43
46
|
attr_accessor tax_id_err_msg: String?
|
|
@@ -60,6 +63,7 @@ module Dodopayments
|
|
|
60
63
|
total_price: Integer,
|
|
61
64
|
?next_billing_date: Time?,
|
|
62
65
|
?recurring_breakup: Dodopayments::Models::CheckoutSessionPreviewResponse::RecurringBreakup?,
|
|
66
|
+
?subscriptions: ::Array[Dodopayments::Models::CheckoutSessionPreviewResponse::Subscription]?,
|
|
63
67
|
?tax_id_business_name: String?,
|
|
64
68
|
?tax_id_err_msg: String?,
|
|
65
69
|
?tax_id_format_name: String?,
|
|
@@ -78,6 +82,7 @@ module Dodopayments
|
|
|
78
82
|
total_price: Integer,
|
|
79
83
|
next_billing_date: Time?,
|
|
80
84
|
recurring_breakup: Dodopayments::Models::CheckoutSessionPreviewResponse::RecurringBreakup?,
|
|
85
|
+
subscriptions: ::Array[Dodopayments::Models::CheckoutSessionPreviewResponse::Subscription]?,
|
|
81
86
|
tax_id_business_name: String?,
|
|
82
87
|
tax_id_err_msg: String?,
|
|
83
88
|
tax_id_format_name: String?,
|
|
@@ -407,6 +412,53 @@ module Dodopayments
|
|
|
407
412
|
tax: Integer?
|
|
408
413
|
}
|
|
409
414
|
end
|
|
415
|
+
|
|
416
|
+
type subscription =
|
|
417
|
+
{
|
|
418
|
+
amount_due_now: Integer,
|
|
419
|
+
product_id: String,
|
|
420
|
+
recurring_amount: Integer,
|
|
421
|
+
next_billing_date: Time?,
|
|
422
|
+
recurring_tax: Integer?,
|
|
423
|
+
tax_due_now: Integer?,
|
|
424
|
+
trial_period_days: Integer?
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
class Subscription < Dodopayments::Internal::Type::BaseModel
|
|
428
|
+
attr_accessor amount_due_now: Integer
|
|
429
|
+
|
|
430
|
+
attr_accessor product_id: String
|
|
431
|
+
|
|
432
|
+
attr_accessor recurring_amount: Integer
|
|
433
|
+
|
|
434
|
+
attr_accessor next_billing_date: Time?
|
|
435
|
+
|
|
436
|
+
attr_accessor recurring_tax: Integer?
|
|
437
|
+
|
|
438
|
+
attr_accessor tax_due_now: Integer?
|
|
439
|
+
|
|
440
|
+
attr_accessor trial_period_days: Integer?
|
|
441
|
+
|
|
442
|
+
def initialize: (
|
|
443
|
+
amount_due_now: Integer,
|
|
444
|
+
product_id: String,
|
|
445
|
+
recurring_amount: Integer,
|
|
446
|
+
?next_billing_date: Time?,
|
|
447
|
+
?recurring_tax: Integer?,
|
|
448
|
+
?tax_due_now: Integer?,
|
|
449
|
+
?trial_period_days: Integer?
|
|
450
|
+
) -> void
|
|
451
|
+
|
|
452
|
+
def to_hash: -> {
|
|
453
|
+
amount_due_now: Integer,
|
|
454
|
+
product_id: String,
|
|
455
|
+
recurring_amount: Integer,
|
|
456
|
+
next_billing_date: Time?,
|
|
457
|
+
recurring_tax: Integer?,
|
|
458
|
+
tax_due_now: Integer?,
|
|
459
|
+
trial_period_days: Integer?
|
|
460
|
+
}
|
|
461
|
+
end
|
|
410
462
|
end
|
|
411
463
|
end
|
|
412
464
|
end
|
|
@@ -18,7 +18,7 @@ module Dodopayments
|
|
|
18
18
|
:force_3ds => bool?,
|
|
19
19
|
mandate_min_amount_inr_paise: Integer?,
|
|
20
20
|
metadata: Dodopayments::Models::metadata?,
|
|
21
|
-
minimal_address: bool
|
|
21
|
+
minimal_address: bool?,
|
|
22
22
|
payment_method_id: String?,
|
|
23
23
|
product_collection_id: String?,
|
|
24
24
|
return_url: String?,
|
|
@@ -71,9 +71,7 @@ module Dodopayments
|
|
|
71
71
|
|
|
72
72
|
attr_accessor metadata: Dodopayments::Models::metadata?
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
def minimal_address=: (bool) -> bool
|
|
74
|
+
attr_accessor minimal_address: bool?
|
|
77
75
|
|
|
78
76
|
attr_accessor payment_method_id: String?
|
|
79
77
|
|
|
@@ -110,7 +108,7 @@ module Dodopayments
|
|
|
110
108
|
?force_3ds: bool?,
|
|
111
109
|
?mandate_min_amount_inr_paise: Integer?,
|
|
112
110
|
?metadata: Dodopayments::Models::metadata?,
|
|
113
|
-
?minimal_address: bool
|
|
111
|
+
?minimal_address: bool?,
|
|
114
112
|
?payment_method_id: String?,
|
|
115
113
|
?product_collection_id: String?,
|
|
116
114
|
?return_url: String?,
|
|
@@ -137,7 +135,7 @@ module Dodopayments
|
|
|
137
135
|
:force_3ds => bool?,
|
|
138
136
|
mandate_min_amount_inr_paise: Integer?,
|
|
139
137
|
metadata: Dodopayments::Models::metadata?,
|
|
140
|
-
minimal_address: bool
|
|
138
|
+
minimal_address: bool?,
|
|
141
139
|
payment_method_id: String?,
|
|
142
140
|
product_collection_id: String?,
|
|
143
141
|
return_url: String?,
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
module Dodopayments
|
|
2
|
+
module Models
|
|
3
|
+
type moderation_category =
|
|
4
|
+
:violent_crimes
|
|
5
|
+
| :sex_related_crimes
|
|
6
|
+
| :child_sexual_exploitation
|
|
7
|
+
| :suicide_and_self_harm
|
|
8
|
+
| :indiscriminate_weapons
|
|
9
|
+
| :intellectual_property
|
|
10
|
+
| :defamation
|
|
11
|
+
| :non_violent_crimes
|
|
12
|
+
| :hate
|
|
13
|
+
| :privacy
|
|
14
|
+
| :specialized_advice
|
|
15
|
+
| :sexual_content
|
|
16
|
+
| :non_consensual_intimate_imagery
|
|
17
|
+
| :minor_coded_language
|
|
18
|
+
| :real_person_likeness
|
|
19
|
+
| :living_artist_style
|
|
20
|
+
| :prompt_injection
|
|
21
|
+
|
|
22
|
+
module ModerationCategory
|
|
23
|
+
extend Dodopayments::Internal::Type::Enum
|
|
24
|
+
|
|
25
|
+
VIOLENT_CRIMES: :violent_crimes
|
|
26
|
+
SEX_RELATED_CRIMES: :sex_related_crimes
|
|
27
|
+
CHILD_SEXUAL_EXPLOITATION: :child_sexual_exploitation
|
|
28
|
+
SUICIDE_AND_SELF_HARM: :suicide_and_self_harm
|
|
29
|
+
INDISCRIMINATE_WEAPONS: :indiscriminate_weapons
|
|
30
|
+
INTELLECTUAL_PROPERTY: :intellectual_property
|
|
31
|
+
DEFAMATION: :defamation
|
|
32
|
+
NON_VIOLENT_CRIMES: :non_violent_crimes
|
|
33
|
+
HATE: :hate
|
|
34
|
+
PRIVACY: :privacy
|
|
35
|
+
SPECIALIZED_ADVICE: :specialized_advice
|
|
36
|
+
SEXUAL_CONTENT: :sexual_content
|
|
37
|
+
NON_CONSENSUAL_INTIMATE_IMAGERY: :non_consensual_intimate_imagery
|
|
38
|
+
MINOR_CODED_LANGUAGE: :minor_coded_language
|
|
39
|
+
REAL_PERSON_LIKENESS: :real_person_likeness
|
|
40
|
+
LIVING_ARTIST_STYLE: :living_artist_style
|
|
41
|
+
PROMPT_INJECTION: :prompt_injection
|
|
42
|
+
|
|
43
|
+
def self?.values: -> ::Array[Dodopayments::Models::moderation_category]
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|