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
@@ -0,0 +1,150 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ class ModerationCategoryScores < Dodopayments::Internal::Type::BaseModel
6
+ # @!attribute child_sexual_exploitation
7
+ # Child sexual exploitation.
8
+ #
9
+ # @return [Float]
10
+ required :child_sexual_exploitation, Float
11
+
12
+ # @!attribute defamation
13
+ # False depiction that is likely to injure the reputation of a real person.
14
+ #
15
+ # @return [Float]
16
+ required :defamation, Float
17
+
18
+ # @!attribute hate
19
+ # Demeaning people because of a protected characteristic.
20
+ #
21
+ # @return [Float]
22
+ required :hate, Float
23
+
24
+ # @!attribute indiscriminate_weapons
25
+ # Chemical, biological, radiological, nuclear or explosive weapons.
26
+ #
27
+ # @return [Float]
28
+ required :indiscriminate_weapons, Float
29
+
30
+ # @!attribute intellectual_property
31
+ # Copyright or trademark infringement.
32
+ #
33
+ # @return [Float]
34
+ required :intellectual_property, Float
35
+
36
+ # @!attribute living_artist_style
37
+ # Imitation of the signature style of a specific living artist.
38
+ #
39
+ # @return [Float]
40
+ required :living_artist_style, Float
41
+
42
+ # @!attribute minor_coded_language
43
+ # Age-coded language that suggests the subject is a minor.
44
+ #
45
+ # @return [Float]
46
+ required :minor_coded_language, Float
47
+
48
+ # @!attribute non_consensual_intimate_imagery
49
+ # Non-consensual intimate imagery: undressing, nudifying or sexualising a real
50
+ # person.
51
+ #
52
+ # @return [Float]
53
+ required :non_consensual_intimate_imagery, Float
54
+
55
+ # @!attribute non_violent_crimes
56
+ # Non-violent crimes.
57
+ #
58
+ # @return [Float]
59
+ required :non_violent_crimes, Float
60
+
61
+ # @!attribute privacy
62
+ # Sensitive private information about a person.
63
+ #
64
+ # @return [Float]
65
+ required :privacy, Float
66
+
67
+ # @!attribute prompt_injection
68
+ # An attempt to override or manipulate the instructions of the system.
69
+ #
70
+ # @return [Float]
71
+ required :prompt_injection, Float
72
+
73
+ # @!attribute real_person_likeness
74
+ # The likeness of a real, identifiable, named person.
75
+ #
76
+ # @return [Float]
77
+ required :real_person_likeness, Float
78
+
79
+ # @!attribute sex_related_crimes
80
+ # Sex-related crimes.
81
+ #
82
+ # @return [Float]
83
+ required :sex_related_crimes, Float
84
+
85
+ # @!attribute sexual_content
86
+ # Sexually explicit or pornographic content.
87
+ #
88
+ # @return [Float]
89
+ required :sexual_content, Float
90
+
91
+ # @!attribute specialized_advice
92
+ # Unqualified financial, medical, legal or electoral advice.
93
+ #
94
+ # @return [Float]
95
+ required :specialized_advice, Float
96
+
97
+ # @!attribute suicide_and_self_harm
98
+ # Suicide and self-harm.
99
+ #
100
+ # @return [Float]
101
+ required :suicide_and_self_harm, Float
102
+
103
+ # @!attribute violent_crimes
104
+ # Violent crimes.
105
+ #
106
+ # @return [Float]
107
+ required :violent_crimes, Float
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::ModerationCategoryScores} for more details.
112
+ #
113
+ # The probability, from 0 to 1, that the screen falls in each category.
114
+ #
115
+ # @param child_sexual_exploitation [Float] Child sexual exploitation.
116
+ #
117
+ # @param defamation [Float] False depiction that is likely to injure the reputation of a real person.
118
+ #
119
+ # @param hate [Float] Demeaning people because of a protected characteristic.
120
+ #
121
+ # @param indiscriminate_weapons [Float] Chemical, biological, radiological, nuclear or explosive weapons.
122
+ #
123
+ # @param intellectual_property [Float] Copyright or trademark infringement.
124
+ #
125
+ # @param living_artist_style [Float] Imitation of the signature style of a specific living artist.
126
+ #
127
+ # @param minor_coded_language [Float] Age-coded language that suggests the subject is a minor.
128
+ #
129
+ # @param non_consensual_intimate_imagery [Float] Non-consensual intimate imagery: undressing, nudifying or sexualising a real per
130
+ #
131
+ # @param non_violent_crimes [Float] Non-violent crimes.
132
+ #
133
+ # @param privacy [Float] Sensitive private information about a person.
134
+ #
135
+ # @param prompt_injection [Float] An attempt to override or manipulate the instructions of the system.
136
+ #
137
+ # @param real_person_likeness [Float] The likeness of a real, identifiable, named person.
138
+ #
139
+ # @param sex_related_crimes [Float] Sex-related crimes.
140
+ #
141
+ # @param sexual_content [Float] Sexually explicit or pornographic content.
142
+ #
143
+ # @param specialized_advice [Float] Unqualified financial, medical, legal or electoral advice.
144
+ #
145
+ # @param suicide_and_self_harm [Float] Suicide and self-harm.
146
+ #
147
+ # @param violent_crimes [Float] Violent crimes.
148
+ end
149
+ end
150
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # The verdict. `allow` means the content passed. `deny` means block the content.
6
+ # `flag` means apply your own judgement. It is not a soft deny.
7
+ module ModerationDecision
8
+ extend Dodopayments::Internal::Type::Enum
9
+
10
+ ALLOW = :allow
11
+ FLAG = :flag
12
+ DENY = :deny
13
+
14
+ # @!method self.values
15
+ # @return [Array<Symbol>]
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # How a score was measured. `targeted` means a check for that one category
6
+ # measured it. `broad` means the general check that covers all categories measured
7
+ # it.
8
+ module ModerationProvenance
9
+ extend Dodopayments::Internal::Type::Enum
10
+
11
+ TARGETED = :targeted
12
+ BROAD = :broad
13
+
14
+ # @!method self.values
15
+ # @return [Array<Symbol>]
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Moderation#retrieve_usage
6
+ class ModerationRetrieveUsageParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ # @!method initialize(request_options: {})
11
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Moderation#retrieve_usage
6
+ class ModerationRetrieveUsageResponse < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute daily
8
+ # Your billable screens per UTC day for the last 30 days, charged or not. A day
9
+ # with no screens is not in the list.
10
+ #
11
+ # @return [Array<Dodopayments::Models::ModerationRetrieveUsageResponse::Daily>]
12
+ required :daily,
13
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::ModerationRetrieveUsageResponse::Daily] }
14
+
15
+ # @!attribute screens_to_next_block
16
+ # Billable screens still needed to fill the next block of 1000. A full block is
17
+ # charged within one hour, so this value is 1000 when your unbilled screens fill
18
+ # whole blocks.
19
+ #
20
+ # @return [Integer]
21
+ required :screens_to_next_block, Integer
22
+
23
+ # @!attribute unbilled_screens
24
+ # Billable screens that Dodo Payments has not charged for yet.
25
+ #
26
+ # @return [Integer]
27
+ required :unbilled_screens, Integer
28
+
29
+ # @!method initialize(daily:, screens_to_next_block:, unbilled_screens:)
30
+ # Some parameter documentations has been truncated, see
31
+ # {Dodopayments::Models::ModerationRetrieveUsageResponse} for more details.
32
+ #
33
+ # Your moderation usage.
34
+ #
35
+ # @param daily [Array<Dodopayments::Models::ModerationRetrieveUsageResponse::Daily>] Your billable screens per UTC day for the last 30 days, charged or not. A day wi
36
+ #
37
+ # @param screens_to_next_block [Integer] Billable screens still needed to fill the next block of 1000. A full block is ch
38
+ #
39
+ # @param unbilled_screens [Integer] Billable screens that Dodo Payments has not charged for yet.
40
+
41
+ class Daily < Dodopayments::Internal::Type::BaseModel
42
+ # @!attribute date
43
+ # The UTC day.
44
+ #
45
+ # @return [Date]
46
+ required :date, Date
47
+
48
+ # @!attribute screens
49
+ # Billable screens on that day.
50
+ #
51
+ # @return [Integer]
52
+ required :screens, Integer
53
+
54
+ # @!method initialize(date:, screens:)
55
+ # @param date [Date] The UTC day.
56
+ #
57
+ # @param screens [Integer] Billable screens on that day.
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Moderation#screen
6
+ class ModerationScreenParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ # @!attribute image
11
+ # The image to screen, as base64, with or without a `data:image/...;base64,`
12
+ # prefix. The formats are JPEG, PNG, WebP, GIF and BMP. The limit is 6991530
13
+ # base64 characters, and the decoded image must be at most 5 MiB.
14
+ #
15
+ # @return [String, nil]
16
+ optional :image, String, nil?: true
17
+
18
+ # @!attribute request_id
19
+ # Your identifier for this screen, up to 128 characters, with no control
20
+ # characters. The response returns it in `request_id`.
21
+ #
22
+ # @return [String, nil]
23
+ optional :request_id, String, nil?: true
24
+
25
+ # @!attribute text
26
+ # The text to screen, up to 8000 characters.
27
+ #
28
+ # @return [String, nil]
29
+ optional :text, String, nil?: true
30
+
31
+ # @!method initialize(image: nil, request_id: nil, text: nil, request_options: {})
32
+ # Some parameter documentations has been truncated, see
33
+ # {Dodopayments::Models::ModerationScreenParams} for more details.
34
+ #
35
+ # @param image [String, nil] The image to screen, as base64, with or without a `data:image/...;base64,` prefi
36
+ #
37
+ # @param request_id [String, nil] Your identifier for this screen, up to 128 characters, with no control character
38
+ #
39
+ # @param text [String, nil] The text to screen, up to 8000 characters.
40
+ #
41
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,99 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Moderation#screen
6
+ class ModerationScreenResponse < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute categories
8
+ # The probability, from 0 to 1, that the screen falls in each category.
9
+ #
10
+ # @return [Dodopayments::Models::ModerationCategoryScores]
11
+ required :categories, -> { Dodopayments::ModerationCategoryScores }
12
+
13
+ # @!attribute compound_triggered
14
+ # True when real-person likeness and sexual content together crossed their
15
+ # combined threshold, the pattern of a sexual deepfake.
16
+ #
17
+ # @return [Boolean]
18
+ required :compound_triggered, Dodopayments::Internal::Type::Boolean
19
+
20
+ # @!attribute decision
21
+ # The verdict. `allow` means the content passed. `deny` means block the content.
22
+ # `flag` means apply your own judgement. It is not a soft deny.
23
+ #
24
+ # @return [Symbol, Dodopayments::Models::ModerationDecision]
25
+ required :decision, enum: -> { Dodopayments::ModerationDecision }
26
+
27
+ # @!attribute latency_ms
28
+ # The time the screen took, in milliseconds.
29
+ #
30
+ # @return [Integer]
31
+ required :latency_ms, Integer
32
+
33
+ # @!attribute normalized_applied
34
+ # True when the text was also screened in a normalized form, with obfuscation such
35
+ # as invisible or look-alike characters removed.
36
+ #
37
+ # @return [Boolean]
38
+ required :normalized_applied, Dodopayments::Internal::Type::Boolean
39
+
40
+ # @!attribute notes
41
+ # Human-readable reasons for the decision. The wording can change, so do not parse
42
+ # it.
43
+ #
44
+ # @return [Array<String>]
45
+ required :notes, Dodopayments::Internal::Type::ArrayOf[String]
46
+
47
+ # @!attribute passes
48
+ # The number of yes/no questions the model answered for this screen.
49
+ #
50
+ # @return [Integer]
51
+ required :passes, Integer
52
+
53
+ # @!attribute provenance
54
+ # How each score in `categories` was measured.
55
+ #
56
+ # @return [Dodopayments::Models::ModerationCategoryProvenance]
57
+ required :provenance, -> { Dodopayments::ModerationCategoryProvenance }
58
+
59
+ # @!attribute request_id
60
+ # The `request_id` you sent, or null.
61
+ #
62
+ # @return [String, nil]
63
+ required :request_id, String, nil?: true
64
+
65
+ # @!attribute triggered
66
+ # The categories whose score crossed the threshold of the category. It can be
67
+ # empty on a `flag` from the general check. `notes` then gives the reason.
68
+ #
69
+ # @return [Array<Symbol, Dodopayments::Models::ModerationCategory>]
70
+ required :triggered, -> { Dodopayments::Internal::Type::ArrayOf[enum: Dodopayments::ModerationCategory] }
71
+
72
+ # @!method initialize(categories:, compound_triggered:, decision:, latency_ms:, normalized_applied:, notes:, passes:, provenance:, request_id:, triggered:)
73
+ # Some parameter documentations has been truncated, see
74
+ # {Dodopayments::Models::ModerationScreenResponse} for more details.
75
+ #
76
+ # The verdict of one screen.
77
+ #
78
+ # @param categories [Dodopayments::Models::ModerationCategoryScores] The probability, from 0 to 1, that the screen falls in each category.
79
+ #
80
+ # @param compound_triggered [Boolean] True when real-person likeness and sexual content together crossed their combine
81
+ #
82
+ # @param decision [Symbol, Dodopayments::Models::ModerationDecision] The verdict. `allow` means the content passed. `deny` means block the content. `
83
+ #
84
+ # @param latency_ms [Integer] The time the screen took, in milliseconds.
85
+ #
86
+ # @param normalized_applied [Boolean] True when the text was also screened in a normalized form, with obfuscation such
87
+ #
88
+ # @param notes [Array<String>] Human-readable reasons for the decision. The wording can change, so do not parse
89
+ #
90
+ # @param passes [Integer] The number of yes/no questions the model answered for this screen.
91
+ #
92
+ # @param provenance [Dodopayments::Models::ModerationCategoryProvenance] How each score in `categories` was measured.
93
+ #
94
+ # @param request_id [String, nil] The `request_id` you sent, or null.
95
+ #
96
+ # @param triggered [Array<Symbol, Dodopayments::Models::ModerationCategory>] The categories whose score crossed the threshold of the category. It can be empt
97
+ end
98
+ end
99
+ end
@@ -52,6 +52,14 @@ module Dodopayments
52
52
  # @return [Array<Dodopayments::Models::Dispute>]
53
53
  required :disputes, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Dispute] }
54
54
 
55
+ # @!attribute is_multi_subscription
56
+ # True when one payment starts more than one subscription. Read this field to find
57
+ # the payment type. Do not read the length of `subscription_ids`. Do not read
58
+ # `subscription_id` for null.
59
+ #
60
+ # @return [Boolean]
61
+ required :is_multi_subscription, Dodopayments::Internal::Type::Boolean
62
+
55
63
  # @!attribute is_update_payment_method
56
64
  # Whether this payment was created solely to update a subscription's payment
57
65
  # method (a zero-/setup-amount charge). `false` for normal charges.
@@ -108,6 +116,14 @@ module Dodopayments
108
116
  # @return [Symbol, Dodopayments::Models::Currency]
109
117
  required :settlement_currency, enum: -> { Dodopayments::Currency }
110
118
 
119
+ # @!attribute subscription_ids
120
+ # Every subscription that this payment starts or charges, in a stable order. It is
121
+ # empty for a one-time payment. It holds the value of `subscription_id` when the
122
+ # payment names one subscription.
123
+ #
124
+ # @return [Array<String>]
125
+ required :subscription_ids, Dodopayments::Internal::Type::ArrayOf[String]
126
+
111
127
  # @!attribute total_amount
112
128
  # Total amount charged to the customer including tax, in the currency's smallest
113
129
  # unit (e.g. cents for USD, yen for JPY, fils for KWD — see the currency's decimal
@@ -257,7 +273,9 @@ module Dodopayments
257
273
  optional :status, enum: -> { Dodopayments::IntentStatus }, nil?: true
258
274
 
259
275
  # @!attribute subscription_id
260
- # Identifier of the subscription if payment is part of a subscription
276
+ # Identifier of the subscription if payment is part of a subscription. A
277
+ # multi-subscription payment leaves this null, because no single subscription owns
278
+ # the payment. Read `subscription_ids` for those.
261
279
  #
262
280
  # @return [String, nil]
263
281
  optional :subscription_id, String, nil?: true
@@ -275,7 +293,7 @@ module Dodopayments
275
293
  # @return [Time, nil]
276
294
  optional :updated_at, Time, nil?: true
277
295
 
278
- # @!method initialize(billing:, brand_id:, business_id:, created_at:, currency:, customer:, digital_products_delivered:, disputes:, is_update_payment_method:, metadata:, payment_id:, payment_provider:, refunds:, retry_attempt:, settlement_amount:, settlement_currency:, total_amount:, card_holder_name: nil, card_issuing_country: nil, card_last_four: nil, card_network: nil, card_type: nil, checkout_session_id: nil, custom_field_responses: nil, discount_id: nil, discounts: nil, error_code: nil, error_message: nil, invoice_id: nil, invoice_url: nil, payment_link: nil, payment_method: nil, payment_method_id: nil, payment_method_type: nil, product_cart: nil, refund_status: nil, settlement_tax: nil, status: nil, subscription_id: nil, tax: nil, updated_at: nil)
296
+ # @!method initialize(billing:, brand_id:, business_id:, created_at:, currency:, customer:, digital_products_delivered:, disputes:, is_multi_subscription:, is_update_payment_method:, metadata:, payment_id:, payment_provider:, refunds:, retry_attempt:, settlement_amount:, settlement_currency:, subscription_ids:, total_amount:, card_holder_name: nil, card_issuing_country: nil, card_last_four: nil, card_network: nil, card_type: nil, checkout_session_id: nil, custom_field_responses: nil, discount_id: nil, discounts: nil, error_code: nil, error_message: nil, invoice_id: nil, invoice_url: nil, payment_link: nil, payment_method: nil, payment_method_id: nil, payment_method_type: nil, product_cart: nil, refund_status: nil, settlement_tax: nil, status: nil, subscription_id: nil, tax: nil, updated_at: nil)
279
297
  # Some parameter documentations has been truncated, see
280
298
  # {Dodopayments::Models::Payment} for more details.
281
299
  #
@@ -295,6 +313,8 @@ module Dodopayments
295
313
  #
296
314
  # @param disputes [Array<Dodopayments::Models::Dispute>] List of disputes associated with this payment
297
315
  #
316
+ # @param is_multi_subscription [Boolean] True when one payment starts more than one subscription. Read this field
317
+ #
298
318
  # @param is_update_payment_method [Boolean] Whether this payment was created solely to update a subscription's
299
319
  #
300
320
  # @param metadata [Hash{Symbol=>String, Float, Boolean}] Additional custom data associated with the payment
@@ -311,6 +331,8 @@ module Dodopayments
311
331
  #
312
332
  # @param settlement_currency [Symbol, Dodopayments::Models::Currency] The currency in which the settlement_amount will be credited to your Dodo balanc
313
333
  #
334
+ # @param subscription_ids [Array<String>] Every subscription that this payment starts or charges, in a stable order.
335
+ #
314
336
  # @param total_amount [Integer] Total amount charged to the customer including tax, in the currency's smallest u
315
337
  #
316
338
  # @param card_holder_name [String, nil] Cardholder name
@@ -355,7 +377,7 @@ module Dodopayments
355
377
  #
356
378
  # @param status [Symbol, Dodopayments::Models::IntentStatus, nil] Current status of the payment intent
357
379
  #
358
- # @param subscription_id [String, nil] Identifier of the subscription if payment is part of a subscription
380
+ # @param subscription_id [String, nil] Identifier of the subscription if payment is part of a subscription.
359
381
  #
360
382
  # @param tax [Integer, nil] Amount of tax collected in the currency's smallest unit
361
383
  #
@@ -34,6 +34,14 @@ module Dodopayments
34
34
  # @return [Boolean]
35
35
  required :has_license_key, Dodopayments::Internal::Type::Boolean
36
36
 
37
+ # @!attribute is_multi_subscription
38
+ # True when one payment starts more than one subscription. Read this field to find
39
+ # the payment type. Do not read the length of `subscription_ids`. Do not read
40
+ # `subscription_id` for null.
41
+ #
42
+ # @return [Boolean]
43
+ required :is_multi_subscription, Dodopayments::Internal::Type::Boolean
44
+
37
45
  # @!attribute metadata
38
46
  # Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
39
47
  #
@@ -52,6 +60,14 @@ module Dodopayments
52
60
  # @return [Symbol, Dodopayments::Models::PaymentListResponse::PaymentProvider]
53
61
  required :payment_provider, enum: -> { Dodopayments::Models::PaymentListResponse::PaymentProvider }
54
62
 
63
+ # @!attribute subscription_ids
64
+ # Every subscription that this payment starts or charges, in a stable order. It is
65
+ # empty for a one-time payment. It holds the value of `subscription_id` when the
66
+ # payment names one subscription.
67
+ #
68
+ # @return [Array<String>]
69
+ required :subscription_ids, Dodopayments::Internal::Type::ArrayOf[String]
70
+
55
71
  # @!attribute total_amount
56
72
  #
57
73
  # @return [Integer]
@@ -114,7 +130,7 @@ module Dodopayments
114
130
  # @return [String, nil]
115
131
  optional :subscription_id, String, nil?: true
116
132
 
117
- # @!method initialize(brand_id:, created_at:, currency:, customer:, digital_products_delivered:, has_license_key:, metadata:, payment_id:, payment_provider:, total_amount:, card_last_four: nil, card_network: nil, dispute_status: nil, invoice_id: nil, invoice_url: nil, payment_method: nil, payment_method_type: nil, refund_status: nil, status: nil, subscription_id: nil)
133
+ # @!method initialize(brand_id:, created_at:, currency:, customer:, digital_products_delivered:, has_license_key:, is_multi_subscription:, metadata:, payment_id:, payment_provider:, subscription_ids:, total_amount:, card_last_four: nil, card_network: nil, dispute_status: nil, invoice_id: nil, invoice_url: nil, payment_method: nil, payment_method_type: nil, refund_status: nil, status: nil, subscription_id: nil)
118
134
  # Some parameter documentations has been truncated, see
119
135
  # {Dodopayments::Models::PaymentListResponse} for more details.
120
136
  #
@@ -130,12 +146,16 @@ module Dodopayments
130
146
  #
131
147
  # @param has_license_key [Boolean]
132
148
  #
149
+ # @param is_multi_subscription [Boolean] True when one payment starts more than one subscription. Read this field
150
+ #
133
151
  # @param metadata [Hash{Symbol=>String, Float, Boolean}] Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
134
152
  #
135
153
  # @param payment_id [String]
136
154
  #
137
155
  # @param payment_provider [Symbol, Dodopayments::Models::PaymentListResponse::PaymentProvider] Which processor handled this payment. `stripe` / `adyen` for BYOP routes
138
156
  #
157
+ # @param subscription_ids [Array<String>] Every subscription that this payment starts or charges, in a stable order.
158
+ #
139
159
  # @param total_amount [Integer]
140
160
  #
141
161
  # @param card_last_four [String, nil] The last four digits of the card
@@ -40,8 +40,9 @@ module Dodopayments
40
40
 
41
41
  # @!attribute payout_currency_amount
42
42
  # Amount in the payout's currency, in that currency's smallest unit (cents for
43
- # USD, yen for JPY, fils for KWD). Uses cumulative rounding to ensure sum matches
44
- # payout total exactly.
43
+ # USD, yen for JPY, fils for KWD). The entry is converted at the rate the payout
44
+ # settled at. These amounts sum to the value of the entries, which can be less
45
+ # than the payout: the grouped breakup reports the difference as `unattributed`.
45
46
  #
46
47
  # @return [Integer]
47
48
  required :payout_currency_amount, Integer
@@ -68,8 +69,8 @@ module Dodopayments
68
69
  # Some parameter documentations has been truncated, see
69
70
  # {Dodopayments::Models::Payouts::Breakup::DetailListResponse} for more details.
70
71
  #
71
- # Individual balance ledger entry for a payout, with amounts pro-rated into the
72
- # payout's currency.
72
+ # Individual balance ledger entry for a payout, converted into the payout's
73
+ # currency.
73
74
  #
74
75
  # @param id [String] Unique identifier of the balance ledger entry.
75
76
  #
@@ -6,7 +6,8 @@ module Dodopayments
6
6
  class BreakupRetrieveResponseItem < Dodopayments::Internal::Type::BaseModel
7
7
  # @!attribute event_type
8
8
  # The type of balance ledger event (e.g., "payment", "refund", "dispute",
9
- # "payment_fees").
9
+ # "payment_fees"), or `unattributed` for the payout amount the entries do not
10
+ # account for.
10
11
  #
11
12
  # @return [String]
12
13
  required :event_type, String
@@ -24,6 +25,21 @@ module Dodopayments
24
25
  #
25
26
  # Payout breakup aggregated by event type, with amounts in the payout's currency.
26
27
  #
28
+ # The rows sum to the payout amount. The last row can be `unattributed`, which is
29
+ # not a ledger event type. It holds the payout amount less the entries that fund
30
+ # it, and it takes either sign:
31
+ #
32
+ # - Positive: the entries come to less than the payout, so the payout drew on the
33
+ # balance an earlier cycle left over. A cycle of refunds and disputes produces a
34
+ # large positive value.
35
+ # - Negative: the entries come to more than the payout, and the remainder funds a
36
+ # later payout. This is the common case, for two reasons. The walk that claims
37
+ # the entries stops at the first one that reaches its target, so it passes the
38
+ # target by part of an entry. The target is also the gross debit, which holds
39
+ # the payout fee, and the fee is not a line here.
40
+ #
41
+ # The row is absent when the two are equal.
42
+ #
27
43
  # @param event_type [String] The type of balance ledger event (e.g., "payment", "refund", "dispute", "payment
28
44
  #
29
45
  # @param total [Integer] Total amount for this event type in the payout's currency, in that currency's sm
@@ -350,6 +350,20 @@ module Dodopayments
350
350
 
351
351
  MiscListSupportedCountriesParams = Dodopayments::Models::MiscListSupportedCountriesParams
352
352
 
353
+ ModerationCategory = Dodopayments::Models::ModerationCategory
354
+
355
+ ModerationCategoryProvenance = Dodopayments::Models::ModerationCategoryProvenance
356
+
357
+ ModerationCategoryScores = Dodopayments::Models::ModerationCategoryScores
358
+
359
+ ModerationDecision = Dodopayments::Models::ModerationDecision
360
+
361
+ ModerationProvenance = Dodopayments::Models::ModerationProvenance
362
+
363
+ ModerationRetrieveUsageParams = Dodopayments::Models::ModerationRetrieveUsageParams
364
+
365
+ ModerationScreenParams = Dodopayments::Models::ModerationScreenParams
366
+
353
367
  NewCustomer = Dodopayments::Models::NewCustomer
354
368
 
355
369
  OnDemandSubscription = Dodopayments::Models::OnDemandSubscription
@@ -8,7 +8,7 @@ module Dodopayments
8
8
  #
9
9
  # @overload create(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, cancel_url: nil, confirm: nil, custom_fields: nil, customer: nil, customer_business_name: nil, customization: nil, discount_code: nil, discount_codes: nil, feature_flags: nil, force_3ds: nil, mandate_min_amount_inr_paise: nil, metadata: nil, minimal_address: nil, payment_method_id: nil, product_collection_id: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, subscription_data: nil, tax_id: nil, request_options: {})
10
10
  #
11
- # @param product_cart [Array<Dodopayments::Models::ProductItemReq>]
11
+ # @param product_cart [Array<Dodopayments::Models::ProductItemReq>] The products of the checkout. A cart holds at most 20 of them, one-time and
12
12
  #
13
13
  # @param allowed_payment_method_types [Array<Symbol, Dodopayments::Models::PaymentMethodTypes>, nil] Customers will never see payment methods that are not in this list.
14
14
  #
@@ -95,7 +95,7 @@ module Dodopayments
95
95
  #
96
96
  # @overload preview(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, cancel_url: nil, confirm: nil, custom_fields: nil, customer: nil, customer_business_name: nil, customization: nil, discount_code: nil, discount_codes: nil, feature_flags: nil, force_3ds: nil, mandate_min_amount_inr_paise: nil, metadata: nil, minimal_address: nil, payment_method_id: nil, product_collection_id: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, subscription_data: nil, tax_id: nil, request_options: {})
97
97
  #
98
- # @param product_cart [Array<Dodopayments::Models::ProductItemReq>]
98
+ # @param product_cart [Array<Dodopayments::Models::ProductItemReq>] The products of the checkout. A cart holds at most 20 of them, one-time and
99
99
  #
100
100
  # @param allowed_payment_method_types [Array<Symbol, Dodopayments::Models::PaymentMethodTypes>, nil] Customers will never see payment methods that are not in this list.
101
101
  #