dodopayments 2.20.1 → 2.22.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 (86) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/models/checkout_session_preview_response.rb +30 -4
  5. data/lib/dodopayments/models/credit_entitlements/balance_create_ledger_entry_params.rb +4 -2
  6. data/lib/dodopayments/models/discount.rb +95 -3
  7. data/lib/dodopayments/models/discount_create_params.rb +110 -3
  8. data/lib/dodopayments/models/discount_list_params.rb +7 -2
  9. data/lib/dodopayments/models/discount_type.rb +1 -0
  10. data/lib/dodopayments/models/discount_update_params.rb +108 -3
  11. data/lib/dodopayments/models/payment.rb +4 -2
  12. data/lib/dodopayments/models/payment_list_params.rb +169 -3
  13. data/lib/dodopayments/models/payment_method_types.rb +0 -1
  14. data/lib/dodopayments/models/payout_created_webhook_event.rb +188 -0
  15. data/lib/dodopayments/models/payout_failed_webhook_event.rb +188 -0
  16. data/lib/dodopayments/models/payout_in_progress_webhook_event.rb +188 -0
  17. data/lib/dodopayments/models/payout_on_hold_webhook_event.rb +188 -0
  18. data/lib/dodopayments/models/payout_success_webhook_event.rb +188 -0
  19. data/lib/dodopayments/models/price.rb +19 -1
  20. data/lib/dodopayments/models/subscription.rb +11 -1
  21. data/lib/dodopayments/models/subscription_create_response.rb +10 -1
  22. data/lib/dodopayments/models/subscription_list_response.rb +11 -1
  23. data/lib/dodopayments/models/unsafe_unwrap_webhook_event.rb +11 -1
  24. data/lib/dodopayments/models/unwrap_webhook_event.rb +11 -1
  25. data/lib/dodopayments/models/webhook_event_type.rb +1 -1
  26. data/lib/dodopayments/models/webhook_payload.rb +160 -3
  27. data/lib/dodopayments/models.rb +10 -0
  28. data/lib/dodopayments/resources/credit_entitlements/balances.rb +1 -1
  29. data/lib/dodopayments/resources/discounts.rb +24 -5
  30. data/lib/dodopayments/resources/payments.rb +7 -2
  31. data/lib/dodopayments/resources/webhooks.rb +2 -2
  32. data/lib/dodopayments/version.rb +1 -1
  33. data/lib/dodopayments.rb +5 -0
  34. data/rbi/dodopayments/models/checkout_session_preview_response.rbi +33 -5
  35. data/rbi/dodopayments/models/credit_entitlements/balance_create_ledger_entry_params.rbi +6 -2
  36. data/rbi/dodopayments/models/discount.rbi +151 -2
  37. data/rbi/dodopayments/models/discount_create_params.rbi +197 -2
  38. data/rbi/dodopayments/models/discount_list_params.rbi +6 -2
  39. data/rbi/dodopayments/models/discount_type.rbi +1 -0
  40. data/rbi/dodopayments/models/discount_update_params.rbi +193 -2
  41. data/rbi/dodopayments/models/payment.rbi +6 -2
  42. data/rbi/dodopayments/models/payment_list_params.rbi +331 -2
  43. data/rbi/dodopayments/models/payment_method_types.rbi +0 -1
  44. data/rbi/dodopayments/models/payout_created_webhook_event.rbi +270 -0
  45. data/rbi/dodopayments/models/payout_failed_webhook_event.rbi +270 -0
  46. data/rbi/dodopayments/models/payout_in_progress_webhook_event.rbi +272 -0
  47. data/rbi/dodopayments/models/payout_on_hold_webhook_event.rbi +270 -0
  48. data/rbi/dodopayments/models/payout_success_webhook_event.rbi +270 -0
  49. data/rbi/dodopayments/models/price.rbi +20 -0
  50. data/rbi/dodopayments/models/subscription.rbi +15 -3
  51. data/rbi/dodopayments/models/subscription_create_response.rbi +13 -3
  52. data/rbi/dodopayments/models/subscription_list_response.rbi +15 -3
  53. data/rbi/dodopayments/models/unsafe_unwrap_webhook_event.rbi +5 -0
  54. data/rbi/dodopayments/models/unwrap_webhook_event.rbi +5 -0
  55. data/rbi/dodopayments/models/webhook_event_type.rbi +2 -5
  56. data/rbi/dodopayments/models/webhook_payload.rbi +213 -0
  57. data/rbi/dodopayments/models.rbi +11 -0
  58. data/rbi/dodopayments/resources/credit_entitlements/balances.rbi +3 -1
  59. data/rbi/dodopayments/resources/discounts.rbi +57 -3
  60. data/rbi/dodopayments/resources/payments.rbi +5 -1
  61. data/rbi/dodopayments/resources/webhooks.rbi +10 -0
  62. data/sig/dodopayments/models/checkout_session_preview_response.rbs +13 -3
  63. data/sig/dodopayments/models/discount.rbs +69 -0
  64. data/sig/dodopayments/models/discount_create_params.rbs +69 -0
  65. data/sig/dodopayments/models/discount_type.rbs +2 -1
  66. data/sig/dodopayments/models/discount_update_params.rbs +69 -0
  67. data/sig/dodopayments/models/payment_list_params.rbs +308 -0
  68. data/sig/dodopayments/models/payment_method_types.rbs +0 -2
  69. data/sig/dodopayments/models/payout_created_webhook_event.rbs +137 -0
  70. data/sig/dodopayments/models/payout_failed_webhook_event.rbs +137 -0
  71. data/sig/dodopayments/models/payout_in_progress_webhook_event.rbs +137 -0
  72. data/sig/dodopayments/models/payout_on_hold_webhook_event.rbs +137 -0
  73. data/sig/dodopayments/models/payout_success_webhook_event.rbs +137 -0
  74. data/sig/dodopayments/models/price.rbs +10 -0
  75. data/sig/dodopayments/models/subscription.rbs +8 -3
  76. data/sig/dodopayments/models/subscription_create_response.rbs +8 -3
  77. data/sig/dodopayments/models/subscription_list_response.rbs +8 -3
  78. data/sig/dodopayments/models/unsafe_unwrap_webhook_event.rbs +5 -0
  79. data/sig/dodopayments/models/unwrap_webhook_event.rbs +5 -0
  80. data/sig/dodopayments/models/webhook_event_type.rbs +2 -2
  81. data/sig/dodopayments/models/webhook_payload.rbs +108 -0
  82. data/sig/dodopayments/models.rbs +10 -0
  83. data/sig/dodopayments/resources/discounts.rbs +8 -0
  84. data/sig/dodopayments/resources/payments.rbs +1 -0
  85. data/sig/dodopayments/resources/webhooks.rbs +10 -0
  86. metadata +17 -2
@@ -0,0 +1,188 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ class PayoutInProgressWebhookEvent < Dodopayments::Internal::Type::BaseModel
6
+ # @!attribute business_id
7
+ # The business identifier
8
+ #
9
+ # @return [String]
10
+ required :business_id, String
11
+
12
+ # @!attribute data
13
+ #
14
+ # @return [Dodopayments::Models::PayoutInProgressWebhookEvent::Data]
15
+ required :data, -> { Dodopayments::PayoutInProgressWebhookEvent::Data }
16
+
17
+ # @!attribute timestamp
18
+ # The timestamp of when the event occurred
19
+ #
20
+ # @return [Time]
21
+ required :timestamp, Time
22
+
23
+ # @!attribute type
24
+ # The event type
25
+ #
26
+ # @return [Symbol, :"payout.in_progress"]
27
+ required :type, const: :"payout.in_progress"
28
+
29
+ # @!method initialize(business_id:, data:, timestamp:, type: :"payout.in_progress")
30
+ # @param business_id [String] The business identifier
31
+ #
32
+ # @param data [Dodopayments::Models::PayoutInProgressWebhookEvent::Data]
33
+ #
34
+ # @param timestamp [Time] The timestamp of when the event occurred
35
+ #
36
+ # @param type [Symbol, :"payout.in_progress"] The event type
37
+
38
+ # @see Dodopayments::Models::PayoutInProgressWebhookEvent#data
39
+ class Data < Dodopayments::Internal::Type::BaseModel
40
+ # @!attribute amount
41
+ # The total amount of the payout.
42
+ #
43
+ # @return [Integer]
44
+ required :amount, Integer
45
+
46
+ # @!attribute business_id
47
+ # The unique identifier of the business associated with the payout.
48
+ #
49
+ # @return [String]
50
+ required :business_id, String
51
+
52
+ # @!attribute chargebacks
53
+ # @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a future
54
+ # release.
55
+ #
56
+ # The total value of chargebacks associated with the payout.
57
+ #
58
+ # @return [Integer]
59
+ required :chargebacks, Integer
60
+
61
+ # @!attribute created_at
62
+ # The timestamp when the payout was created, in UTC.
63
+ #
64
+ # @return [Time]
65
+ required :created_at, Time
66
+
67
+ # @!attribute currency
68
+ # The currency of the payout, represented as an ISO 4217 currency code.
69
+ #
70
+ # @return [Symbol, Dodopayments::Models::Currency]
71
+ required :currency, enum: -> { Dodopayments::Currency }
72
+
73
+ # @!attribute fee
74
+ # The fee charged for processing the payout.
75
+ #
76
+ # @return [Integer]
77
+ required :fee, Integer
78
+
79
+ # @!attribute payment_method
80
+ # The payment method used for the payout (e.g., bank transfer, card, etc.).
81
+ #
82
+ # @return [String]
83
+ required :payment_method, String
84
+
85
+ # @!attribute payout_id
86
+ # The unique identifier of the payout.
87
+ #
88
+ # @return [String]
89
+ required :payout_id, String
90
+
91
+ # @!attribute refunds
92
+ # @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a future
93
+ # release.
94
+ #
95
+ # The total value of refunds associated with the payout.
96
+ #
97
+ # @return [Integer]
98
+ required :refunds, Integer
99
+
100
+ # @!attribute status
101
+ # The current status of the payout.
102
+ #
103
+ # @return [Symbol, Dodopayments::Models::PayoutInProgressWebhookEvent::Data::Status]
104
+ required :status, enum: -> { Dodopayments::PayoutInProgressWebhookEvent::Data::Status }
105
+
106
+ # @!attribute tax
107
+ # @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a future
108
+ # release.
109
+ #
110
+ # The tax applied to the payout.
111
+ #
112
+ # @return [Integer]
113
+ required :tax, Integer
114
+
115
+ # @!attribute updated_at
116
+ # The timestamp when the payout was last updated, in UTC.
117
+ #
118
+ # @return [Time]
119
+ required :updated_at, Time
120
+
121
+ # @!attribute name
122
+ # The name of the payout recipient or purpose.
123
+ #
124
+ # @return [String, nil]
125
+ optional :name, String, nil?: true
126
+
127
+ # @!attribute payout_document_url
128
+ # The URL of the document associated with the payout.
129
+ #
130
+ # @return [String, nil]
131
+ optional :payout_document_url, String, nil?: true
132
+
133
+ # @!attribute remarks
134
+ # Any additional remarks or notes associated with the payout.
135
+ #
136
+ # @return [String, nil]
137
+ optional :remarks, String, nil?: true
138
+
139
+ # @!method initialize(amount:, business_id:, chargebacks:, created_at:, currency:, fee:, payment_method:, payout_id:, refunds:, status:, tax:, updated_at:, name: nil, payout_document_url: nil, remarks: nil)
140
+ # @param amount [Integer] The total amount of the payout.
141
+ #
142
+ # @param business_id [String] The unique identifier of the business associated with the payout.
143
+ #
144
+ # @param chargebacks [Integer] The total value of chargebacks associated with the payout.
145
+ #
146
+ # @param created_at [Time] The timestamp when the payout was created, in UTC.
147
+ #
148
+ # @param currency [Symbol, Dodopayments::Models::Currency] The currency of the payout, represented as an ISO 4217 currency code.
149
+ #
150
+ # @param fee [Integer] The fee charged for processing the payout.
151
+ #
152
+ # @param payment_method [String] The payment method used for the payout (e.g., bank transfer, card, etc.).
153
+ #
154
+ # @param payout_id [String] The unique identifier of the payout.
155
+ #
156
+ # @param refunds [Integer] The total value of refunds associated with the payout.
157
+ #
158
+ # @param status [Symbol, Dodopayments::Models::PayoutInProgressWebhookEvent::Data::Status] The current status of the payout.
159
+ #
160
+ # @param tax [Integer] The tax applied to the payout.
161
+ #
162
+ # @param updated_at [Time] The timestamp when the payout was last updated, in UTC.
163
+ #
164
+ # @param name [String, nil] The name of the payout recipient or purpose.
165
+ #
166
+ # @param payout_document_url [String, nil] The URL of the document associated with the payout.
167
+ #
168
+ # @param remarks [String, nil] Any additional remarks or notes associated with the payout.
169
+
170
+ # The current status of the payout.
171
+ #
172
+ # @see Dodopayments::Models::PayoutInProgressWebhookEvent::Data#status
173
+ module Status
174
+ extend Dodopayments::Internal::Type::Enum
175
+
176
+ NOT_INITIATED = :not_initiated
177
+ IN_PROGRESS = :in_progress
178
+ ON_HOLD = :on_hold
179
+ FAILED = :failed
180
+ SUCCESS = :success
181
+
182
+ # @!method self.values
183
+ # @return [Array<Symbol>]
184
+ end
185
+ end
186
+ end
187
+ end
188
+ end
@@ -0,0 +1,188 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ class PayoutOnHoldWebhookEvent < Dodopayments::Internal::Type::BaseModel
6
+ # @!attribute business_id
7
+ # The business identifier
8
+ #
9
+ # @return [String]
10
+ required :business_id, String
11
+
12
+ # @!attribute data
13
+ #
14
+ # @return [Dodopayments::Models::PayoutOnHoldWebhookEvent::Data]
15
+ required :data, -> { Dodopayments::PayoutOnHoldWebhookEvent::Data }
16
+
17
+ # @!attribute timestamp
18
+ # The timestamp of when the event occurred
19
+ #
20
+ # @return [Time]
21
+ required :timestamp, Time
22
+
23
+ # @!attribute type
24
+ # The event type
25
+ #
26
+ # @return [Symbol, :"payout.on_hold"]
27
+ required :type, const: :"payout.on_hold"
28
+
29
+ # @!method initialize(business_id:, data:, timestamp:, type: :"payout.on_hold")
30
+ # @param business_id [String] The business identifier
31
+ #
32
+ # @param data [Dodopayments::Models::PayoutOnHoldWebhookEvent::Data]
33
+ #
34
+ # @param timestamp [Time] The timestamp of when the event occurred
35
+ #
36
+ # @param type [Symbol, :"payout.on_hold"] The event type
37
+
38
+ # @see Dodopayments::Models::PayoutOnHoldWebhookEvent#data
39
+ class Data < Dodopayments::Internal::Type::BaseModel
40
+ # @!attribute amount
41
+ # The total amount of the payout.
42
+ #
43
+ # @return [Integer]
44
+ required :amount, Integer
45
+
46
+ # @!attribute business_id
47
+ # The unique identifier of the business associated with the payout.
48
+ #
49
+ # @return [String]
50
+ required :business_id, String
51
+
52
+ # @!attribute chargebacks
53
+ # @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a future
54
+ # release.
55
+ #
56
+ # The total value of chargebacks associated with the payout.
57
+ #
58
+ # @return [Integer]
59
+ required :chargebacks, Integer
60
+
61
+ # @!attribute created_at
62
+ # The timestamp when the payout was created, in UTC.
63
+ #
64
+ # @return [Time]
65
+ required :created_at, Time
66
+
67
+ # @!attribute currency
68
+ # The currency of the payout, represented as an ISO 4217 currency code.
69
+ #
70
+ # @return [Symbol, Dodopayments::Models::Currency]
71
+ required :currency, enum: -> { Dodopayments::Currency }
72
+
73
+ # @!attribute fee
74
+ # The fee charged for processing the payout.
75
+ #
76
+ # @return [Integer]
77
+ required :fee, Integer
78
+
79
+ # @!attribute payment_method
80
+ # The payment method used for the payout (e.g., bank transfer, card, etc.).
81
+ #
82
+ # @return [String]
83
+ required :payment_method, String
84
+
85
+ # @!attribute payout_id
86
+ # The unique identifier of the payout.
87
+ #
88
+ # @return [String]
89
+ required :payout_id, String
90
+
91
+ # @!attribute refunds
92
+ # @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a future
93
+ # release.
94
+ #
95
+ # The total value of refunds associated with the payout.
96
+ #
97
+ # @return [Integer]
98
+ required :refunds, Integer
99
+
100
+ # @!attribute status
101
+ # The current status of the payout.
102
+ #
103
+ # @return [Symbol, Dodopayments::Models::PayoutOnHoldWebhookEvent::Data::Status]
104
+ required :status, enum: -> { Dodopayments::PayoutOnHoldWebhookEvent::Data::Status }
105
+
106
+ # @!attribute tax
107
+ # @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a future
108
+ # release.
109
+ #
110
+ # The tax applied to the payout.
111
+ #
112
+ # @return [Integer]
113
+ required :tax, Integer
114
+
115
+ # @!attribute updated_at
116
+ # The timestamp when the payout was last updated, in UTC.
117
+ #
118
+ # @return [Time]
119
+ required :updated_at, Time
120
+
121
+ # @!attribute name
122
+ # The name of the payout recipient or purpose.
123
+ #
124
+ # @return [String, nil]
125
+ optional :name, String, nil?: true
126
+
127
+ # @!attribute payout_document_url
128
+ # The URL of the document associated with the payout.
129
+ #
130
+ # @return [String, nil]
131
+ optional :payout_document_url, String, nil?: true
132
+
133
+ # @!attribute remarks
134
+ # Any additional remarks or notes associated with the payout.
135
+ #
136
+ # @return [String, nil]
137
+ optional :remarks, String, nil?: true
138
+
139
+ # @!method initialize(amount:, business_id:, chargebacks:, created_at:, currency:, fee:, payment_method:, payout_id:, refunds:, status:, tax:, updated_at:, name: nil, payout_document_url: nil, remarks: nil)
140
+ # @param amount [Integer] The total amount of the payout.
141
+ #
142
+ # @param business_id [String] The unique identifier of the business associated with the payout.
143
+ #
144
+ # @param chargebacks [Integer] The total value of chargebacks associated with the payout.
145
+ #
146
+ # @param created_at [Time] The timestamp when the payout was created, in UTC.
147
+ #
148
+ # @param currency [Symbol, Dodopayments::Models::Currency] The currency of the payout, represented as an ISO 4217 currency code.
149
+ #
150
+ # @param fee [Integer] The fee charged for processing the payout.
151
+ #
152
+ # @param payment_method [String] The payment method used for the payout (e.g., bank transfer, card, etc.).
153
+ #
154
+ # @param payout_id [String] The unique identifier of the payout.
155
+ #
156
+ # @param refunds [Integer] The total value of refunds associated with the payout.
157
+ #
158
+ # @param status [Symbol, Dodopayments::Models::PayoutOnHoldWebhookEvent::Data::Status] The current status of the payout.
159
+ #
160
+ # @param tax [Integer] The tax applied to the payout.
161
+ #
162
+ # @param updated_at [Time] The timestamp when the payout was last updated, in UTC.
163
+ #
164
+ # @param name [String, nil] The name of the payout recipient or purpose.
165
+ #
166
+ # @param payout_document_url [String, nil] The URL of the document associated with the payout.
167
+ #
168
+ # @param remarks [String, nil] Any additional remarks or notes associated with the payout.
169
+
170
+ # The current status of the payout.
171
+ #
172
+ # @see Dodopayments::Models::PayoutOnHoldWebhookEvent::Data#status
173
+ module Status
174
+ extend Dodopayments::Internal::Type::Enum
175
+
176
+ NOT_INITIATED = :not_initiated
177
+ IN_PROGRESS = :in_progress
178
+ ON_HOLD = :on_hold
179
+ FAILED = :failed
180
+ SUCCESS = :success
181
+
182
+ # @!method self.values
183
+ # @return [Array<Symbol>]
184
+ end
185
+ end
186
+ end
187
+ end
188
+ end
@@ -0,0 +1,188 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ class PayoutSuccessWebhookEvent < Dodopayments::Internal::Type::BaseModel
6
+ # @!attribute business_id
7
+ # The business identifier
8
+ #
9
+ # @return [String]
10
+ required :business_id, String
11
+
12
+ # @!attribute data
13
+ #
14
+ # @return [Dodopayments::Models::PayoutSuccessWebhookEvent::Data]
15
+ required :data, -> { Dodopayments::PayoutSuccessWebhookEvent::Data }
16
+
17
+ # @!attribute timestamp
18
+ # The timestamp of when the event occurred
19
+ #
20
+ # @return [Time]
21
+ required :timestamp, Time
22
+
23
+ # @!attribute type
24
+ # The event type
25
+ #
26
+ # @return [Symbol, :"payout.success"]
27
+ required :type, const: :"payout.success"
28
+
29
+ # @!method initialize(business_id:, data:, timestamp:, type: :"payout.success")
30
+ # @param business_id [String] The business identifier
31
+ #
32
+ # @param data [Dodopayments::Models::PayoutSuccessWebhookEvent::Data]
33
+ #
34
+ # @param timestamp [Time] The timestamp of when the event occurred
35
+ #
36
+ # @param type [Symbol, :"payout.success"] The event type
37
+
38
+ # @see Dodopayments::Models::PayoutSuccessWebhookEvent#data
39
+ class Data < Dodopayments::Internal::Type::BaseModel
40
+ # @!attribute amount
41
+ # The total amount of the payout.
42
+ #
43
+ # @return [Integer]
44
+ required :amount, Integer
45
+
46
+ # @!attribute business_id
47
+ # The unique identifier of the business associated with the payout.
48
+ #
49
+ # @return [String]
50
+ required :business_id, String
51
+
52
+ # @!attribute chargebacks
53
+ # @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a future
54
+ # release.
55
+ #
56
+ # The total value of chargebacks associated with the payout.
57
+ #
58
+ # @return [Integer]
59
+ required :chargebacks, Integer
60
+
61
+ # @!attribute created_at
62
+ # The timestamp when the payout was created, in UTC.
63
+ #
64
+ # @return [Time]
65
+ required :created_at, Time
66
+
67
+ # @!attribute currency
68
+ # The currency of the payout, represented as an ISO 4217 currency code.
69
+ #
70
+ # @return [Symbol, Dodopayments::Models::Currency]
71
+ required :currency, enum: -> { Dodopayments::Currency }
72
+
73
+ # @!attribute fee
74
+ # The fee charged for processing the payout.
75
+ #
76
+ # @return [Integer]
77
+ required :fee, Integer
78
+
79
+ # @!attribute payment_method
80
+ # The payment method used for the payout (e.g., bank transfer, card, etc.).
81
+ #
82
+ # @return [String]
83
+ required :payment_method, String
84
+
85
+ # @!attribute payout_id
86
+ # The unique identifier of the payout.
87
+ #
88
+ # @return [String]
89
+ required :payout_id, String
90
+
91
+ # @!attribute refunds
92
+ # @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a future
93
+ # release.
94
+ #
95
+ # The total value of refunds associated with the payout.
96
+ #
97
+ # @return [Integer]
98
+ required :refunds, Integer
99
+
100
+ # @!attribute status
101
+ # The current status of the payout.
102
+ #
103
+ # @return [Symbol, Dodopayments::Models::PayoutSuccessWebhookEvent::Data::Status]
104
+ required :status, enum: -> { Dodopayments::PayoutSuccessWebhookEvent::Data::Status }
105
+
106
+ # @!attribute tax
107
+ # @deprecated Use the v3 payout breakup endpoints instead. Will be removed in a future
108
+ # release.
109
+ #
110
+ # The tax applied to the payout.
111
+ #
112
+ # @return [Integer]
113
+ required :tax, Integer
114
+
115
+ # @!attribute updated_at
116
+ # The timestamp when the payout was last updated, in UTC.
117
+ #
118
+ # @return [Time]
119
+ required :updated_at, Time
120
+
121
+ # @!attribute name
122
+ # The name of the payout recipient or purpose.
123
+ #
124
+ # @return [String, nil]
125
+ optional :name, String, nil?: true
126
+
127
+ # @!attribute payout_document_url
128
+ # The URL of the document associated with the payout.
129
+ #
130
+ # @return [String, nil]
131
+ optional :payout_document_url, String, nil?: true
132
+
133
+ # @!attribute remarks
134
+ # Any additional remarks or notes associated with the payout.
135
+ #
136
+ # @return [String, nil]
137
+ optional :remarks, String, nil?: true
138
+
139
+ # @!method initialize(amount:, business_id:, chargebacks:, created_at:, currency:, fee:, payment_method:, payout_id:, refunds:, status:, tax:, updated_at:, name: nil, payout_document_url: nil, remarks: nil)
140
+ # @param amount [Integer] The total amount of the payout.
141
+ #
142
+ # @param business_id [String] The unique identifier of the business associated with the payout.
143
+ #
144
+ # @param chargebacks [Integer] The total value of chargebacks associated with the payout.
145
+ #
146
+ # @param created_at [Time] The timestamp when the payout was created, in UTC.
147
+ #
148
+ # @param currency [Symbol, Dodopayments::Models::Currency] The currency of the payout, represented as an ISO 4217 currency code.
149
+ #
150
+ # @param fee [Integer] The fee charged for processing the payout.
151
+ #
152
+ # @param payment_method [String] The payment method used for the payout (e.g., bank transfer, card, etc.).
153
+ #
154
+ # @param payout_id [String] The unique identifier of the payout.
155
+ #
156
+ # @param refunds [Integer] The total value of refunds associated with the payout.
157
+ #
158
+ # @param status [Symbol, Dodopayments::Models::PayoutSuccessWebhookEvent::Data::Status] The current status of the payout.
159
+ #
160
+ # @param tax [Integer] The tax applied to the payout.
161
+ #
162
+ # @param updated_at [Time] The timestamp when the payout was last updated, in UTC.
163
+ #
164
+ # @param name [String, nil] The name of the payout recipient or purpose.
165
+ #
166
+ # @param payout_document_url [String, nil] The URL of the document associated with the payout.
167
+ #
168
+ # @param remarks [String, nil] Any additional remarks or notes associated with the payout.
169
+
170
+ # The current status of the payout.
171
+ #
172
+ # @see Dodopayments::Models::PayoutSuccessWebhookEvent::Data#status
173
+ module Status
174
+ extend Dodopayments::Internal::Type::Enum
175
+
176
+ NOT_INITIATED = :not_initiated
177
+ IN_PROGRESS = :in_progress
178
+ ON_HOLD = :on_hold
179
+ FAILED = :failed
180
+ SUCCESS = :success
181
+
182
+ # @!method self.values
183
+ # @return [Array<Symbol>]
184
+ end
185
+ end
186
+ end
187
+ end
188
+ end
@@ -160,13 +160,27 @@ module Dodopayments
160
160
  # @return [Boolean, nil]
161
161
  optional :tax_inclusive, Dodopayments::Internal::Type::Boolean, nil?: true
162
162
 
163
+ # @!attribute trial_amount
164
+ # Amount charged today for a paid trial, in the price currency's minor units.
165
+ # Requires `trial_period_days > 0`. Omit or null for a free trial (the default).
166
+ #
167
+ # @return [Integer, nil]
168
+ optional :trial_amount, Integer, nil?: true
169
+
170
+ # @!attribute trial_apply_discounts
171
+ # Whether discount codes reduce the trial charge. Defaults to false. Only
172
+ # meaningful when a paid trial is configured.
173
+ #
174
+ # @return [Boolean, nil]
175
+ optional :trial_apply_discounts, Dodopayments::Internal::Type::Boolean, nil?: true
176
+
163
177
  # @!attribute trial_period_days
164
178
  # Number of days for the trial period. A value of `0` indicates no trial period.
165
179
  #
166
180
  # @return [Integer, nil]
167
181
  optional :trial_period_days, Integer
168
182
 
169
- # @!method initialize(currency:, discount:, payment_frequency_count:, payment_frequency_interval:, price:, purchasing_power_parity:, subscription_period_count:, subscription_period_interval:, tax_inclusive: nil, trial_period_days: nil, type: :recurring_price)
183
+ # @!method initialize(currency:, discount:, payment_frequency_count:, payment_frequency_interval:, price:, purchasing_power_parity:, subscription_period_count:, subscription_period_interval:, tax_inclusive: nil, trial_amount: nil, trial_apply_discounts: nil, trial_period_days: nil, type: :recurring_price)
170
184
  # Some parameter documentations has been truncated, see
171
185
  # {Dodopayments::Models::Price::RecurringPrice} for more details.
172
186
  #
@@ -190,6 +204,10 @@ module Dodopayments
190
204
  #
191
205
  # @param tax_inclusive [Boolean, nil] Indicates if the price is tax inclusive
192
206
  #
207
+ # @param trial_amount [Integer, nil] Amount charged today for a paid trial, in the price currency's minor units.
208
+ #
209
+ # @param trial_apply_discounts [Boolean, nil] Whether discount codes reduce the trial charge. Defaults to false. Only meaningf
210
+ #
193
211
  # @param trial_period_days [Integer] Number of days for the trial period. A value of `0` indicates no trial period.
194
212
  #
195
213
  # @param type [Symbol, :recurring_price]
@@ -235,7 +235,15 @@ module Dodopayments
235
235
  # @return [String, nil]
236
236
  optional :tax_id, String, nil?: true
237
237
 
238
- # @!method initialize(addons:, billing:, brand_id:, cancel_at_next_billing_date:, created_at:, credit_entitlement_cart:, currency:, customer:, metadata:, meter_credit_entitlement_cart:, meters:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancellation_comment: nil, cancellation_feedback: nil, cancelled_at: nil, custom_field_responses: nil, customer_business_name: nil, discount_cycles_remaining: nil, discount_id: nil, discounts: nil, expires_at: nil, payment_method_id: nil, scheduled_change: nil, tax_id: nil)
238
+ # @!attribute trial_amount
239
+ # Per-unit trial amount after discounts, snapshotted at subscription creation
240
+ # (price currency minor units, pre-quantity, pre-tax). Null for a free trial or no
241
+ # trial.
242
+ #
243
+ # @return [Integer, nil]
244
+ optional :trial_amount, Integer, nil?: true
245
+
246
+ # @!method initialize(addons:, billing:, brand_id:, cancel_at_next_billing_date:, created_at:, credit_entitlement_cart:, currency:, customer:, metadata:, meter_credit_entitlement_cart:, meters:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancellation_comment: nil, cancellation_feedback: nil, cancelled_at: nil, custom_field_responses: nil, customer_business_name: nil, discount_cycles_remaining: nil, discount_id: nil, discounts: nil, expires_at: nil, payment_method_id: nil, scheduled_change: nil, tax_id: nil, trial_amount: nil)
239
247
  # Some parameter documentations has been truncated, see
240
248
  # {Dodopayments::Models::Subscription} for more details.
241
249
  #
@@ -314,6 +322,8 @@ module Dodopayments
314
322
  # @param scheduled_change [Dodopayments::Models::ScheduledPlanChange, nil] Scheduled plan change details, if any
315
323
  #
316
324
  # @param tax_id [String, nil] Tax identifier provided for this subscription (if applicable)
325
+ #
326
+ # @param trial_amount [Integer, nil] Per-unit trial amount after discounts, snapshotted at subscription creation
317
327
  end
318
328
  end
319
329
  end
@@ -83,7 +83,14 @@ module Dodopayments
83
83
  # @return [String, nil]
84
84
  optional :payment_link, String, nil?: true
85
85
 
86
- # @!method initialize(addons:, customer:, metadata:, payment_id:, recurring_pre_tax_amount:, subscription_id:, client_secret: nil, discount_id: nil, discount_ids: nil, expires_on: nil, one_time_product_cart: nil, payment_link: nil)
86
+ # @!attribute trial_amount
87
+ # Per-unit trial amount after discounts, in the price currency's minor units
88
+ # (pre-quantity, pre-tax). Null for a free trial or no trial.
89
+ #
90
+ # @return [Integer, nil]
91
+ optional :trial_amount, Integer, nil?: true
92
+
93
+ # @!method initialize(addons:, customer:, metadata:, payment_id:, recurring_pre_tax_amount:, subscription_id:, client_secret: nil, discount_id: nil, discount_ids: nil, expires_on: nil, one_time_product_cart: nil, payment_link: nil, trial_amount: nil)
87
94
  # Some parameter documentations has been truncated, see
88
95
  # {Dodopayments::Models::SubscriptionCreateResponse} for more details.
89
96
  #
@@ -110,6 +117,8 @@ module Dodopayments
110
117
  # @param one_time_product_cart [Array<Dodopayments::Models::SubscriptionCreateResponse::OneTimeProductCart>, nil] One time products associated with the purchase of subscription
111
118
  #
112
119
  # @param payment_link [String, nil] URL to checkout page
120
+ #
121
+ # @param trial_amount [Integer, nil] Per-unit trial amount after discounts, in the price currency's minor units
113
122
 
114
123
  class OneTimeProductCart < Dodopayments::Internal::Type::BaseModel
115
124
  # @!attribute product_id
@@ -182,7 +182,15 @@ module Dodopayments
182
182
  # @return [String, nil]
183
183
  optional :tax_id, String, nil?: true
184
184
 
185
- # @!method initialize(billing:, cancel_at_next_billing_date:, created_at:, currency:, customer:, discounts:, metadata:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, customer_business_name: nil, discount_cycles_remaining: nil, discount_id: nil, payment_method_id: nil, product_name: nil, scheduled_change: nil, tax_id: nil)
185
+ # @!attribute trial_amount
186
+ # Per-unit trial amount after discounts, snapshotted at subscription creation
187
+ # (price currency minor units, pre-quantity, pre-tax). Null for a free trial or no
188
+ # trial.
189
+ #
190
+ # @return [Integer, nil]
191
+ optional :trial_amount, Integer, nil?: true
192
+
193
+ # @!method initialize(billing:, cancel_at_next_billing_date:, created_at:, currency:, customer:, discounts:, metadata:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, customer_business_name: nil, discount_cycles_remaining: nil, discount_id: nil, payment_method_id: nil, product_name: nil, scheduled_change: nil, tax_id: nil, trial_amount: nil)
186
194
  # Some parameter documentations has been truncated, see
187
195
  # {Dodopayments::Models::SubscriptionListResponse} for more details.
188
196
  #
@@ -245,6 +253,8 @@ module Dodopayments
245
253
  # @param scheduled_change [Dodopayments::Models::ScheduledPlanChange, nil] Scheduled plan change details, if any
246
254
  #
247
255
  # @param tax_id [String, nil] Tax identifier provided for this subscription (if applicable)
256
+ #
257
+ # @param trial_amount [Integer, nil] Per-unit trial amount after discounts, snapshotted at subscription creation
248
258
 
249
259
  class Discount < Dodopayments::Internal::Type::BaseModel
250
260
  # @!attribute discount_id