dodopayments 2.29.0 → 2.30.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.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/client.rb +4 -0
  5. data/lib/dodopayments/models/balance_ledger_entry.rb +3 -0
  6. data/lib/dodopayments/models/balance_retrieve_ledger_params.rb +3 -0
  7. data/lib/dodopayments/models/checkout_session_flags.rb +12 -1
  8. data/lib/dodopayments/models/checkout_session_preview_response.rb +86 -4
  9. data/lib/dodopayments/models/checkout_session_request.rb +4 -1
  10. data/lib/dodopayments/models/customers/email_log_item.rb +3 -2
  11. data/lib/dodopayments/models/customers/email_policies.rb +4 -3
  12. data/lib/dodopayments/models/discount_create_params.rb +11 -8
  13. data/lib/dodopayments/models/discount_update_params.rb +6 -5
  14. data/lib/dodopayments/models/moderation_category.rb +31 -0
  15. data/lib/dodopayments/models/moderation_category_provenance.rb +150 -0
  16. data/lib/dodopayments/models/moderation_category_scores.rb +150 -0
  17. data/lib/dodopayments/models/moderation_decision.rb +18 -0
  18. data/lib/dodopayments/models/moderation_provenance.rb +18 -0
  19. data/lib/dodopayments/models/moderation_retrieve_usage_params.rb +14 -0
  20. data/lib/dodopayments/models/moderation_retrieve_usage_response.rb +61 -0
  21. data/lib/dodopayments/models/moderation_screen_params.rb +44 -0
  22. data/lib/dodopayments/models/moderation_screen_response.rb +99 -0
  23. data/lib/dodopayments/models/payment.rb +25 -3
  24. data/lib/dodopayments/models/payment_list_response.rb +21 -1
  25. data/lib/dodopayments/models/payouts/breakup/detail_list_response.rb +5 -4
  26. data/lib/dodopayments/models/payouts/breakup_retrieve_response.rb +17 -1
  27. data/lib/dodopayments/models.rb +14 -0
  28. data/lib/dodopayments/resources/checkout_sessions.rb +2 -2
  29. data/lib/dodopayments/resources/moderation.rb +81 -0
  30. data/lib/dodopayments/resources/payouts/breakup/details.rb +4 -4
  31. data/lib/dodopayments/version.rb +1 -1
  32. data/lib/dodopayments.rb +10 -0
  33. data/rbi/dodopayments/client.rbi +3 -0
  34. data/rbi/dodopayments/models/balance_ledger_entry.rbi +15 -0
  35. data/rbi/dodopayments/models/balance_retrieve_ledger_params.rbi +15 -0
  36. data/rbi/dodopayments/models/checkout_session_flags.rbi +17 -0
  37. data/rbi/dodopayments/models/checkout_session_preview_response.rbi +130 -6
  38. data/rbi/dodopayments/models/checkout_session_request.rbi +6 -0
  39. data/rbi/dodopayments/models/customers/email_log_item.rbi +4 -2
  40. data/rbi/dodopayments/models/customers/email_policies.rbi +6 -4
  41. data/rbi/dodopayments/models/discount_create_params.rbi +18 -12
  42. data/rbi/dodopayments/models/discount_update_params.rbi +8 -6
  43. data/rbi/dodopayments/models/moderation_category.rbi +88 -0
  44. data/rbi/dodopayments/models/moderation_category_provenance.rbi +184 -0
  45. data/rbi/dodopayments/models/moderation_category_scores.rbi +171 -0
  46. data/rbi/dodopayments/models/moderation_decision.rbi +27 -0
  47. data/rbi/dodopayments/models/moderation_provenance.rbi +28 -0
  48. data/rbi/dodopayments/models/moderation_retrieve_usage_params.rbi +32 -0
  49. data/rbi/dodopayments/models/moderation_retrieve_usage_response.rbi +104 -0
  50. data/rbi/dodopayments/models/moderation_screen_params.rbi +68 -0
  51. data/rbi/dodopayments/models/moderation_screen_response.rbi +135 -0
  52. data/rbi/dodopayments/models/payment.rbi +30 -2
  53. data/rbi/dodopayments/models/payment_list_response.rbi +24 -0
  54. data/rbi/dodopayments/models/payouts/breakup/detail_list_response.rbi +8 -6
  55. data/rbi/dodopayments/models/payouts/breakup_retrieve_response.rbi +19 -2
  56. data/rbi/dodopayments/models.rbi +16 -0
  57. data/rbi/dodopayments/resources/checkout_sessions.rbi +6 -0
  58. data/rbi/dodopayments/resources/discounts.rbi +5 -3
  59. data/rbi/dodopayments/resources/moderation.rbi +64 -0
  60. data/rbi/dodopayments/resources/payouts/breakup/details.rbi +4 -4
  61. data/sig/dodopayments/client.rbs +2 -0
  62. data/sig/dodopayments/models/balance_ledger_entry.rbs +6 -0
  63. data/sig/dodopayments/models/balance_retrieve_ledger_params.rbs +6 -0
  64. data/sig/dodopayments/models/checkout_session_flags.rbs +7 -0
  65. data/sig/dodopayments/models/checkout_session_preview_response.rbs +52 -0
  66. data/sig/dodopayments/models/moderation_category.rbs +46 -0
  67. data/sig/dodopayments/models/moderation_category_provenance.rbs +100 -0
  68. data/sig/dodopayments/models/moderation_category_scores.rbs +100 -0
  69. data/sig/dodopayments/models/moderation_decision.rbs +15 -0
  70. data/sig/dodopayments/models/moderation_provenance.rbs +14 -0
  71. data/sig/dodopayments/models/moderation_retrieve_usage_params.rbs +15 -0
  72. data/sig/dodopayments/models/moderation_retrieve_usage_response.rbs +42 -0
  73. data/sig/dodopayments/models/moderation_screen_params.rbs +32 -0
  74. data/sig/dodopayments/models/moderation_screen_response.rbs +65 -0
  75. data/sig/dodopayments/models/payment.rbs +10 -0
  76. data/sig/dodopayments/models/payment_list_response.rbs +10 -0
  77. data/sig/dodopayments/models.rbs +14 -0
  78. data/sig/dodopayments/resources/moderation.rbs +18 -0
  79. metadata +32 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8a906f14bc16e6454f0cdae1264cb2f4bd930e2e7b236c8c692cc2a8f7fda700
4
- data.tar.gz: 2d0c702ef4868d7e4e1eaab5f1ea09a6eb2028dee9debe9650b36ff07f18bdd4
3
+ metadata.gz: d255803850b82f08ad10d4dda6adbfc5ed6396443aa10c8bdc7c3e49af841db2
4
+ data.tar.gz: e73593617cf7f82d97f9e198f517531358cb32bfd0e30064a4c514757229d5fd
5
5
  SHA512:
6
- metadata.gz: 6455bf5f046c28307fd7482310b2f9b281c291671bceb8b3ff6ae2d564205767fbc169e603d0c6647ba7a0e1f60367d10e9b79fb0fdf3a0055362a90144083ef
7
- data.tar.gz: 8af0e496f42407fe77d5ff318bb7c0d70ee24923b05aeee36cd714500efe2c0511c1ca5281fb2853f746da83040c1fe82a6b45749425b5b596ec3d1e73f13c71
6
+ metadata.gz: '0949b3e69763af13e6d63dec5763e9abba82a251dcc1e1d5f4d3e771cd69b19a55d00f1c1a1f2244c54468a03c518b6a12ca0f35fbae84bba786d289ebcaa00b'
7
+ data.tar.gz: 1af8337dcdf57c984bdc58b3964ab384deb407705acf3a13d5f0d4171cfcb560b3b175c39f532b7791018d947022c393b4228491fe00c702fc6e74b6fd95847d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.30.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.29.0...v2.30.0) (2026-09-25)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** add moderation API and multi-subscription payments ([a65179d](https://github.com/dodopayments/dodopayments-ruby/commit/a65179d7302e29a0a63954ea6c281f78c265c9d9))
9
+ * **api:** add moderation API and multi-subscription payments ([0e91769](https://github.com/dodopayments/dodopayments-ruby/commit/0e9176946ef42edd58987ce612639e360b3d7e5c))
10
+
3
11
  ## [2.29.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.28.0...v2.29.0) (2026-09-18)
4
12
 
5
13
 
data/README.md CHANGED
@@ -23,7 +23,7 @@ To use this gem, install via Bundler by adding the following to your application
23
23
  <!-- x-release-please-start-version -->
24
24
 
25
25
  ```ruby
26
- gem "dodopayments", "~> 2.29.0"
26
+ gem "dodopayments", "~> 2.30.0"
27
27
  ```
28
28
 
29
29
  <!-- x-release-please-end -->
@@ -102,6 +102,9 @@ module Dodopayments
102
102
  # @return [Dodopayments::Resources::ProductCollections]
103
103
  attr_reader :product_collections
104
104
 
105
+ # @return [Dodopayments::Resources::Moderation]
106
+ attr_reader :moderation
107
+
105
108
  # @api private
106
109
  #
107
110
  # @return [Hash{String=>String}]
@@ -203,6 +206,7 @@ module Dodopayments
203
206
  @credit_entitlements = Dodopayments::Resources::CreditEntitlements.new(client: self)
204
207
  @entitlements = Dodopayments::Resources::Entitlements.new(client: self)
205
208
  @product_collections = Dodopayments::Resources::ProductCollections.new(client: self)
209
+ @moderation = Dodopayments::Resources::Moderation.new(client: self)
206
210
  end
207
211
  end
208
212
  end
@@ -116,6 +116,9 @@ module Dodopayments
116
116
  DISPUTE_FEES_REVERSAL = :dispute_fees_reversal
117
117
  DEFLECTION_FEES = :deflection_fees
118
118
  DEFLECTION_FEES_REVERSAL = :deflection_fees_reversal
119
+ RESERVE_HOLD = :reserve_hold
120
+ RESERVE_RELEASE = :reserve_release
121
+ MODERATION_FEES = :moderation_fees
119
122
 
120
123
  # @!method self.values
121
124
  # @return [Array<Symbol>]
@@ -263,6 +263,9 @@ module Dodopayments
263
263
  DISPUTE_FEES_REVERSAL = :dispute_fees_reversal
264
264
  DEFLECTION_FEES = :deflection_fees
265
265
  DEFLECTION_FEES_REVERSAL = :deflection_fees_reversal
266
+ RESERVE_HOLD = :reserve_hold
267
+ RESERVE_RELEASE = :reserve_release
268
+ MODERATION_FEES = :moderation_fees
266
269
 
267
270
  # @!method self.values
268
271
  # @return [Array<Symbol>]
@@ -113,6 +113,15 @@ module Dodopayments
113
113
  # @return [Boolean, nil]
114
114
  optional :redirect_immediately, Dodopayments::Internal::Type::Boolean
115
115
 
116
+ # @!attribute require_cardholder_name
117
+ # If true, the customer must give the name on the card to pay by card. The
118
+ # checkout page enforces this. Other payment methods ignore it.
119
+ #
120
+ # Default is false
121
+ #
122
+ # @return [Boolean, nil]
123
+ optional :require_cardholder_name, Dodopayments::Internal::Type::Boolean
124
+
116
125
  # @!attribute require_phone_number
117
126
  # If true, the customer must provide a phone number to complete checkout. Requires
118
127
  # `allow_phone_number_collection` to also be true.
@@ -148,7 +157,7 @@ module Dodopayments
148
157
  # @return [Boolean, nil]
149
158
  optional :single_page, Dodopayments::Internal::Type::Boolean
150
159
 
151
- # @!method initialize(allow_currency_selection: nil, allow_customer_editing_business_name: nil, allow_customer_editing_city: nil, allow_customer_editing_country: nil, allow_customer_editing_email: nil, allow_customer_editing_name: nil, allow_customer_editing_state: nil, allow_customer_editing_street: nil, allow_customer_editing_tax_id: nil, allow_customer_editing_zipcode: nil, allow_discount_code: nil, allow_editing_addons: nil, allow_phone_number_collection: nil, allow_tax_id: nil, always_create_new_customer: nil, redirect_immediately: nil, require_phone_number: nil, require_tax_id: nil, single_page: nil)
160
+ # @!method initialize(allow_currency_selection: nil, allow_customer_editing_business_name: nil, allow_customer_editing_city: nil, allow_customer_editing_country: nil, allow_customer_editing_email: nil, allow_customer_editing_name: nil, allow_customer_editing_state: nil, allow_customer_editing_street: nil, allow_customer_editing_tax_id: nil, allow_customer_editing_zipcode: nil, allow_discount_code: nil, allow_editing_addons: nil, allow_phone_number_collection: nil, allow_tax_id: nil, always_create_new_customer: nil, redirect_immediately: nil, require_cardholder_name: nil, require_phone_number: nil, require_tax_id: nil, single_page: nil)
152
161
  # Some parameter documentations has been truncated, see
153
162
  # {Dodopayments::Models::CheckoutSessionFlags} for more details.
154
163
  #
@@ -184,6 +193,8 @@ module Dodopayments
184
193
  #
185
194
  # @param redirect_immediately [Boolean] If true, redirects the customer immediately after payment completion
186
195
  #
196
+ # @param require_cardholder_name [Boolean] If true, the customer must give the name on the card to pay by card.
197
+ #
187
198
  # @param require_phone_number [Boolean] If true, the customer must provide a phone number to complete checkout.
188
199
  #
189
200
  # @param require_tax_id [Boolean] If true, the customer must give a tax id to check out as a business.
@@ -55,7 +55,9 @@ module Dodopayments
55
55
  # The upcoming billing date for subscriptions, computed relative to now: with a
56
56
  # trial it is `now + trial_period_days`, otherwise `now + payment frequency`.
57
57
  # `None` for one-time-only carts. This is a preview estimate; the authoritative
58
- # value is set when the subscription activates.
58
+ # value is set when the subscription activates. For a cart of more than one
59
+ # subscription, this is the earliest date of the cart. `subscriptions` gives the
60
+ # date of each subscription.
59
61
  #
60
62
  # @return [Time, nil]
61
63
  optional :next_billing_date, Time, nil?: true
@@ -68,6 +70,15 @@ module Dodopayments
68
70
  -> { Dodopayments::Models::CheckoutSessionPreviewResponse::RecurringBreakup },
69
71
  nil?: true
70
72
 
73
+ # @!attribute subscriptions
74
+ # One entry for each subscription of a cart that holds more than one. Each
75
+ # subscription renews on its own schedule, so the checkout shows each one here.
76
+ #
77
+ # @return [Array<Dodopayments::Models::CheckoutSessionPreviewResponse::Subscription>, nil]
78
+ optional :subscriptions,
79
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::CheckoutSessionPreviewResponse::Subscription] },
80
+ nil?: true
81
+
71
82
  # @!attribute tax_id_business_name
72
83
  # Registered business name from the official registry (EU/GB/AU) when found
73
84
  #
@@ -95,19 +106,22 @@ module Dodopayments
95
106
  # @!attribute trial_amount
96
107
  # Per-unit trial amount after discounts, in the price currency's minor units
97
108
  # (pre-quantity, pre-tax; see `current_breakup` for the taxed total due today).
98
- # Only present for a paid trial; `None` for a free trial or no trial.
109
+ # Only present for a paid trial; `None` for a free trial or no trial. Always
110
+ # `None` for a cart of more than one subscription.
99
111
  #
100
112
  # @return [Integer, nil]
101
113
  optional :trial_amount, Integer, nil?: true
102
114
 
103
115
  # @!attribute trial_period_days
104
116
  # Effective trial duration in days for the subscription line, when there's a trial
105
- # (free or paid). `None` if no subscription or no trial.
117
+ # (free or paid). `None` if no subscription or no trial. Always `None` for a cart
118
+ # of more than one subscription. Read the trial of each subscription from
119
+ # `subscriptions`.
106
120
  #
107
121
  # @return [Integer, nil]
108
122
  optional :trial_period_days, Integer, nil?: true
109
123
 
110
- # @!method initialize(billing_country:, currency:, current_breakup:, is_byop:, payment_method_required:, product_cart:, total_price:, next_billing_date: nil, recurring_breakup: nil, tax_id_business_name: nil, tax_id_err_msg: nil, tax_id_format_name: nil, total_tax: nil, trial_amount: nil, trial_period_days: nil)
124
+ # @!method initialize(billing_country:, currency:, current_breakup:, is_byop:, payment_method_required:, product_cart:, total_price:, next_billing_date: nil, recurring_breakup: nil, subscriptions: nil, tax_id_business_name: nil, tax_id_err_msg: nil, tax_id_format_name: nil, total_tax: nil, trial_amount: nil, trial_period_days: nil)
111
125
  # Some parameter documentations has been truncated, see
112
126
  # {Dodopayments::Models::CheckoutSessionPreviewResponse} for more details.
113
127
  #
@@ -131,6 +145,8 @@ module Dodopayments
131
145
  #
132
146
  # @param recurring_breakup [Dodopayments::Models::CheckoutSessionPreviewResponse::RecurringBreakup, nil] Breakup of recurring payments (None for one-time only)
133
147
  #
148
+ # @param subscriptions [Array<Dodopayments::Models::CheckoutSessionPreviewResponse::Subscription>, nil] One entry for each subscription of a cart that holds more than one. Each
149
+ #
134
150
  # @param tax_id_business_name [String, nil] Registered business name from the official registry (EU/GB/AU) when found
135
151
  #
136
152
  # @param tax_id_err_msg [String, nil] Error message if tax ID validation failed
@@ -563,6 +579,72 @@ module Dodopayments
563
579
  #
564
580
  # @param tax [Integer, nil] Total tax on recurring payments
565
581
  end
582
+
583
+ class Subscription < Dodopayments::Internal::Type::BaseModel
584
+ # @!attribute amount_due_now
585
+ # The amount this subscription charges today, including tax.
586
+ #
587
+ # @return [Integer]
588
+ required :amount_due_now, Integer
589
+
590
+ # @!attribute product_id
591
+ # The subscription product.
592
+ #
593
+ # @return [String]
594
+ required :product_id, String
595
+
596
+ # @!attribute recurring_amount
597
+ # The amount of each renewal, including tax.
598
+ #
599
+ # @return [Integer]
600
+ required :recurring_amount, Integer
601
+
602
+ # @!attribute next_billing_date
603
+ # A preview of the first renewal date. The date is set when the subscription
604
+ # activates.
605
+ #
606
+ # @return [Time, nil]
607
+ optional :next_billing_date, Time, nil?: true
608
+
609
+ # @!attribute recurring_tax
610
+ # The tax in `recurring_amount`.
611
+ #
612
+ # @return [Integer, nil]
613
+ optional :recurring_tax, Integer, nil?: true
614
+
615
+ # @!attribute tax_due_now
616
+ # The tax in `amount_due_now`.
617
+ #
618
+ # @return [Integer, nil]
619
+ optional :tax_due_now, Integer, nil?: true
620
+
621
+ # @!attribute trial_period_days
622
+ # The trial duration in days. `None` when the subscription has no trial.
623
+ #
624
+ # @return [Integer, nil]
625
+ optional :trial_period_days, Integer, nil?: true
626
+
627
+ # @!method initialize(amount_due_now:, product_id:, recurring_amount:, next_billing_date: nil, recurring_tax: nil, tax_due_now: nil, trial_period_days: nil)
628
+ # Some parameter documentations has been truncated, see
629
+ # {Dodopayments::Models::CheckoutSessionPreviewResponse::Subscription} for more
630
+ # details.
631
+ #
632
+ # The quote of one subscription in a cart of several.
633
+ #
634
+ # @param amount_due_now [Integer] The amount this subscription charges today, including tax.
635
+ #
636
+ # @param product_id [String] The subscription product.
637
+ #
638
+ # @param recurring_amount [Integer] The amount of each renewal, including tax.
639
+ #
640
+ # @param next_billing_date [Time, nil] A preview of the first renewal date. The date is set when the subscription activ
641
+ #
642
+ # @param recurring_tax [Integer, nil] The tax in `recurring_amount`.
643
+ #
644
+ # @param tax_due_now [Integer, nil] The tax in `amount_due_now`.
645
+ #
646
+ # @param trial_period_days [Integer, nil] The trial duration in days. `None` when the subscription has no trial.
647
+ end
566
648
  end
567
649
  end
568
650
  end
@@ -4,6 +4,9 @@ module Dodopayments
4
4
  module Models
5
5
  class CheckoutSessionRequest < Dodopayments::Internal::Type::BaseModel
6
6
  # @!attribute product_cart
7
+ # The products of the checkout. A cart holds at most 20 of them, one-time and
8
+ # subscription products together. An empty cart is valid for the
9
+ # product-collection flow, where the customer chooses the product later.
7
10
  #
8
11
  # @return [Array<Dodopayments::Models::ProductItemReq>]
9
12
  required :product_cart, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::ProductItemReq] }
@@ -176,7 +179,7 @@ module Dodopayments
176
179
  # Some parameter documentations has been truncated, see
177
180
  # {Dodopayments::Models::CheckoutSessionRequest} for more details.
178
181
  #
179
- # @param product_cart [Array<Dodopayments::Models::ProductItemReq>]
182
+ # @param product_cart [Array<Dodopayments::Models::ProductItemReq>] The products of the checkout. A cart holds at most 20 of them, one-time and
180
183
  #
181
184
  # @param allowed_payment_method_types [Array<Symbol, Dodopayments::Models::PaymentMethodTypes>, nil] Customers will never see payment methods that are not in this list.
182
185
  #
@@ -68,7 +68,8 @@ module Dodopayments
68
68
  optional :from, String, nil?: true
69
69
 
70
70
  # @!attribute recipient
71
- # The address the email reached.
71
+ # The address the email went to. On a failed email this is the address the
72
+ # provider reports as bounced.
72
73
  #
73
74
  # @return [String, nil]
74
75
  optional :recipient, String, nil?: true
@@ -103,7 +104,7 @@ module Dodopayments
103
104
  #
104
105
  # @param from [String, nil] The address the email was sent from.
105
106
  #
106
- # @param recipient [String, nil] The address the email reached.
107
+ # @param recipient [String, nil] The address the email went to. On a failed email this is the address the
107
108
  #
108
109
  # @param subject [String, nil] The subject line as it was sent. Empty until the provider replicates.
109
110
  end
@@ -29,8 +29,9 @@ module Dodopayments
29
29
  required :retry_allowed, Dodopayments::Internal::Type::Boolean
30
30
 
31
31
  # @!attribute superseded
32
- # A later send of this email reached the provider, so this row is history. To send
33
- # it again would deliver a second copy.
32
+ # A later send of this email replaced this row, so this row is history. A row that
33
+ # never went out needs a later send that reached the provider. A failed row needs
34
+ # a later send that was delivered.
34
35
  #
35
36
  # @return [Boolean]
36
37
  required :superseded, Dodopayments::Internal::Type::Boolean
@@ -50,7 +51,7 @@ module Dodopayments
50
51
  #
51
52
  # @param retry_allowed [Boolean] The row failed and may be sent again.
52
53
  #
53
- # @param superseded [Boolean] A later send of this email reached the provider, so this row is history.
54
+ # @param superseded [Boolean] A later send of this email replaced this row, so this row is history.
54
55
  end
55
56
  end
56
57
  end
@@ -33,9 +33,11 @@ module Dodopayments
33
33
 
34
34
  # @!attribute currency_options
35
35
  # Per-currency options (flat deduction / percentage cap + minimum subtotal).
36
- # Required for `flat` codes (must include a resolvable default); optional
37
- # per-currency caps for `percentage` codes. Per-row invariants are checked in
38
- # `normalize_currency_options`, not via `#[validate(nested)]`.
36
+ # Checkout uses the row for the currency the buyer pays in. For any other currency
37
+ # it converts the default row. Required for `flat` codes (must include a
38
+ # resolvable default); optional per-currency caps for `percentage` codes. Per-row
39
+ # invariants are checked in `normalize_currency_options`, not via
40
+ # `#[validate(nested)]`.
39
41
  #
40
42
  # @return [Array<Dodopayments::Models::DiscountCreateParams::CurrencyOption>, nil]
41
43
  optional :currency_options,
@@ -148,14 +150,15 @@ module Dodopayments
148
150
 
149
151
  class CurrencyOption < Dodopayments::Internal::Type::BaseModel
150
152
  # @!attribute currency
151
- # The currency this option applies to.
153
+ # The currency this option applies to. The row applies when the buyer pays in this
154
+ # currency.
152
155
  #
153
156
  # @return [Symbol, Dodopayments::Models::Currency]
154
157
  required :currency, enum: -> { Dodopayments::Currency }
155
158
 
156
159
  # @!attribute is_default
157
- # Whether this row is the default to convert from for unconfigured currencies. At
158
- # most one row per discount may be default.
160
+ # Whether this row is the default to convert from when the buyer pays in a
161
+ # currency that has no row. At most one row per discount may be default.
159
162
  #
160
163
  # @return [Boolean, nil]
161
164
  optional :is_default, Dodopayments::Internal::Type::Boolean
@@ -184,9 +187,9 @@ module Dodopayments
184
187
  # flat deduction for `flat` codes, or the max-discount cap for `percentage` codes.
185
188
  # Maps to the DB column of the same name.
186
189
  #
187
- # @param currency [Symbol, Dodopayments::Models::Currency] The currency this option applies to.
190
+ # @param currency [Symbol, Dodopayments::Models::Currency] The currency this option applies to. The row applies when the buyer pays
188
191
  #
189
- # @param is_default [Boolean] Whether this row is the default to convert from for unconfigured
192
+ # @param is_default [Boolean] Whether this row is the default to convert from when the buyer pays in a
190
193
  #
191
194
  # @param max_amount_possible [Integer, nil] The most this code discounts in this currency's subunits. For `flat` codes
192
195
  #
@@ -151,14 +151,15 @@ module Dodopayments
151
151
 
152
152
  class CurrencyOption < Dodopayments::Internal::Type::BaseModel
153
153
  # @!attribute currency
154
- # The currency this option applies to.
154
+ # The currency this option applies to. The row applies when the buyer pays in this
155
+ # currency.
155
156
  #
156
157
  # @return [Symbol, Dodopayments::Models::Currency]
157
158
  required :currency, enum: -> { Dodopayments::Currency }
158
159
 
159
160
  # @!attribute is_default
160
- # Whether this row is the default to convert from for unconfigured currencies. At
161
- # most one row per discount may be default.
161
+ # Whether this row is the default to convert from when the buyer pays in a
162
+ # currency that has no row. At most one row per discount may be default.
162
163
  #
163
164
  # @return [Boolean, nil]
164
165
  optional :is_default, Dodopayments::Internal::Type::Boolean
@@ -187,9 +188,9 @@ module Dodopayments
187
188
  # flat deduction for `flat` codes, or the max-discount cap for `percentage` codes.
188
189
  # Maps to the DB column of the same name.
189
190
  #
190
- # @param currency [Symbol, Dodopayments::Models::Currency] The currency this option applies to.
191
+ # @param currency [Symbol, Dodopayments::Models::Currency] The currency this option applies to. The row applies when the buyer pays
191
192
  #
192
- # @param is_default [Boolean] Whether this row is the default to convert from for unconfigured
193
+ # @param is_default [Boolean] Whether this row is the default to convert from when the buyer pays in a
193
194
  #
194
195
  # @param max_amount_possible [Integer, nil] The most this code discounts in this currency's subunits. For `flat` codes
195
196
  #
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # A moderation category.
6
+ module ModerationCategory
7
+ extend Dodopayments::Internal::Type::Enum
8
+
9
+ VIOLENT_CRIMES = :violent_crimes
10
+ SEX_RELATED_CRIMES = :sex_related_crimes
11
+ CHILD_SEXUAL_EXPLOITATION = :child_sexual_exploitation
12
+ SUICIDE_AND_SELF_HARM = :suicide_and_self_harm
13
+ INDISCRIMINATE_WEAPONS = :indiscriminate_weapons
14
+ INTELLECTUAL_PROPERTY = :intellectual_property
15
+ DEFAMATION = :defamation
16
+ NON_VIOLENT_CRIMES = :non_violent_crimes
17
+ HATE = :hate
18
+ PRIVACY = :privacy
19
+ SPECIALIZED_ADVICE = :specialized_advice
20
+ SEXUAL_CONTENT = :sexual_content
21
+ NON_CONSENSUAL_INTIMATE_IMAGERY = :non_consensual_intimate_imagery
22
+ MINOR_CODED_LANGUAGE = :minor_coded_language
23
+ REAL_PERSON_LIKENESS = :real_person_likeness
24
+ LIVING_ARTIST_STYLE = :living_artist_style
25
+ PROMPT_INJECTION = :prompt_injection
26
+
27
+ # @!method self.values
28
+ # @return [Array<Symbol>]
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,150 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ class ModerationCategoryProvenance < Dodopayments::Internal::Type::BaseModel
6
+ # @!attribute child_sexual_exploitation
7
+ # Child sexual exploitation.
8
+ #
9
+ # @return [Symbol, Dodopayments::Models::ModerationProvenance]
10
+ required :child_sexual_exploitation, enum: -> { Dodopayments::ModerationProvenance }
11
+
12
+ # @!attribute defamation
13
+ # False depiction that is likely to injure the reputation of a real person.
14
+ #
15
+ # @return [Symbol, Dodopayments::Models::ModerationProvenance]
16
+ required :defamation, enum: -> { Dodopayments::ModerationProvenance }
17
+
18
+ # @!attribute hate
19
+ # Demeaning people because of a protected characteristic.
20
+ #
21
+ # @return [Symbol, Dodopayments::Models::ModerationProvenance]
22
+ required :hate, enum: -> { Dodopayments::ModerationProvenance }
23
+
24
+ # @!attribute indiscriminate_weapons
25
+ # Chemical, biological, radiological, nuclear or explosive weapons.
26
+ #
27
+ # @return [Symbol, Dodopayments::Models::ModerationProvenance]
28
+ required :indiscriminate_weapons, enum: -> { Dodopayments::ModerationProvenance }
29
+
30
+ # @!attribute intellectual_property
31
+ # Copyright or trademark infringement.
32
+ #
33
+ # @return [Symbol, Dodopayments::Models::ModerationProvenance]
34
+ required :intellectual_property, enum: -> { Dodopayments::ModerationProvenance }
35
+
36
+ # @!attribute living_artist_style
37
+ # Imitation of the signature style of a specific living artist.
38
+ #
39
+ # @return [Symbol, Dodopayments::Models::ModerationProvenance]
40
+ required :living_artist_style, enum: -> { Dodopayments::ModerationProvenance }
41
+
42
+ # @!attribute minor_coded_language
43
+ # Age-coded language that suggests the subject is a minor.
44
+ #
45
+ # @return [Symbol, Dodopayments::Models::ModerationProvenance]
46
+ required :minor_coded_language, enum: -> { Dodopayments::ModerationProvenance }
47
+
48
+ # @!attribute non_consensual_intimate_imagery
49
+ # Non-consensual intimate imagery: undressing, nudifying or sexualising a real
50
+ # person.
51
+ #
52
+ # @return [Symbol, Dodopayments::Models::ModerationProvenance]
53
+ required :non_consensual_intimate_imagery, enum: -> { Dodopayments::ModerationProvenance }
54
+
55
+ # @!attribute non_violent_crimes
56
+ # Non-violent crimes.
57
+ #
58
+ # @return [Symbol, Dodopayments::Models::ModerationProvenance]
59
+ required :non_violent_crimes, enum: -> { Dodopayments::ModerationProvenance }
60
+
61
+ # @!attribute privacy
62
+ # Sensitive private information about a person.
63
+ #
64
+ # @return [Symbol, Dodopayments::Models::ModerationProvenance]
65
+ required :privacy, enum: -> { Dodopayments::ModerationProvenance }
66
+
67
+ # @!attribute prompt_injection
68
+ # An attempt to override or manipulate the instructions of the system.
69
+ #
70
+ # @return [Symbol, Dodopayments::Models::ModerationProvenance]
71
+ required :prompt_injection, enum: -> { Dodopayments::ModerationProvenance }
72
+
73
+ # @!attribute real_person_likeness
74
+ # The likeness of a real, identifiable, named person.
75
+ #
76
+ # @return [Symbol, Dodopayments::Models::ModerationProvenance]
77
+ required :real_person_likeness, enum: -> { Dodopayments::ModerationProvenance }
78
+
79
+ # @!attribute sex_related_crimes
80
+ # Sex-related crimes.
81
+ #
82
+ # @return [Symbol, Dodopayments::Models::ModerationProvenance]
83
+ required :sex_related_crimes, enum: -> { Dodopayments::ModerationProvenance }
84
+
85
+ # @!attribute sexual_content
86
+ # Sexually explicit or pornographic content.
87
+ #
88
+ # @return [Symbol, Dodopayments::Models::ModerationProvenance]
89
+ required :sexual_content, enum: -> { Dodopayments::ModerationProvenance }
90
+
91
+ # @!attribute specialized_advice
92
+ # Unqualified financial, medical, legal or electoral advice.
93
+ #
94
+ # @return [Symbol, Dodopayments::Models::ModerationProvenance]
95
+ required :specialized_advice, enum: -> { Dodopayments::ModerationProvenance }
96
+
97
+ # @!attribute suicide_and_self_harm
98
+ # Suicide and self-harm.
99
+ #
100
+ # @return [Symbol, Dodopayments::Models::ModerationProvenance]
101
+ required :suicide_and_self_harm, enum: -> { Dodopayments::ModerationProvenance }
102
+
103
+ # @!attribute violent_crimes
104
+ # Violent crimes.
105
+ #
106
+ # @return [Symbol, Dodopayments::Models::ModerationProvenance]
107
+ required :violent_crimes, enum: -> { Dodopayments::ModerationProvenance }
108
+
109
+ # @!method initialize(child_sexual_exploitation:, defamation:, hate:, indiscriminate_weapons:, intellectual_property:, living_artist_style:, minor_coded_language:, non_consensual_intimate_imagery:, non_violent_crimes:, privacy:, prompt_injection:, real_person_likeness:, sex_related_crimes:, sexual_content:, specialized_advice:, suicide_and_self_harm:, violent_crimes:)
110
+ # Some parameter documentations has been truncated, see
111
+ # {Dodopayments::Models::ModerationCategoryProvenance} for more details.
112
+ #
113
+ # How each score in `categories` was measured.
114
+ #
115
+ # @param child_sexual_exploitation [Symbol, Dodopayments::Models::ModerationProvenance] Child sexual exploitation.
116
+ #
117
+ # @param defamation [Symbol, Dodopayments::Models::ModerationProvenance] False depiction that is likely to injure the reputation of a real person.
118
+ #
119
+ # @param hate [Symbol, Dodopayments::Models::ModerationProvenance] Demeaning people because of a protected characteristic.
120
+ #
121
+ # @param indiscriminate_weapons [Symbol, Dodopayments::Models::ModerationProvenance] Chemical, biological, radiological, nuclear or explosive weapons.
122
+ #
123
+ # @param intellectual_property [Symbol, Dodopayments::Models::ModerationProvenance] Copyright or trademark infringement.
124
+ #
125
+ # @param living_artist_style [Symbol, Dodopayments::Models::ModerationProvenance] Imitation of the signature style of a specific living artist.
126
+ #
127
+ # @param minor_coded_language [Symbol, Dodopayments::Models::ModerationProvenance] Age-coded language that suggests the subject is a minor.
128
+ #
129
+ # @param non_consensual_intimate_imagery [Symbol, Dodopayments::Models::ModerationProvenance] Non-consensual intimate imagery: undressing, nudifying or sexualising a real per
130
+ #
131
+ # @param non_violent_crimes [Symbol, Dodopayments::Models::ModerationProvenance] Non-violent crimes.
132
+ #
133
+ # @param privacy [Symbol, Dodopayments::Models::ModerationProvenance] Sensitive private information about a person.
134
+ #
135
+ # @param prompt_injection [Symbol, Dodopayments::Models::ModerationProvenance] An attempt to override or manipulate the instructions of the system.
136
+ #
137
+ # @param real_person_likeness [Symbol, Dodopayments::Models::ModerationProvenance] The likeness of a real, identifiable, named person.
138
+ #
139
+ # @param sex_related_crimes [Symbol, Dodopayments::Models::ModerationProvenance] Sex-related crimes.
140
+ #
141
+ # @param sexual_content [Symbol, Dodopayments::Models::ModerationProvenance] Sexually explicit or pornographic content.
142
+ #
143
+ # @param specialized_advice [Symbol, Dodopayments::Models::ModerationProvenance] Unqualified financial, medical, legal or electoral advice.
144
+ #
145
+ # @param suicide_and_self_harm [Symbol, Dodopayments::Models::ModerationProvenance] Suicide and self-harm.
146
+ #
147
+ # @param violent_crimes [Symbol, Dodopayments::Models::ModerationProvenance] Violent crimes.
148
+ end
149
+ end
150
+ end