dodopayments 2.26.0 → 2.28.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 (205) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/client.rb +4 -0
  5. data/lib/dodopayments/internal/type/union.rb +15 -5
  6. data/lib/dodopayments/models/balance_ledger_entry.rb +9 -1
  7. data/lib/dodopayments/models/balance_retrieve_ledger_params.rb +2 -0
  8. data/lib/dodopayments/models/blocklist/block_by_customer_id.rb +18 -0
  9. data/lib/dodopayments/models/blocklist/block_by_email.rb +18 -0
  10. data/lib/dodopayments/models/blocklist/block_identifier.rb +21 -0
  11. data/lib/dodopayments/models/blocklist/blocked_customer.rb +128 -0
  12. data/lib/dodopayments/models/blocklist/blocked_customer_source.rb +22 -0
  13. data/lib/dodopayments/models/blocklist/create_blocked_customer_request.rb +66 -0
  14. data/lib/dodopayments/models/blocklist/customer_create_params.rb +16 -0
  15. data/lib/dodopayments/models/blocklist/customer_delete_params.rb +22 -0
  16. data/lib/dodopayments/models/blocklist/customer_list_params.rb +64 -0
  17. data/lib/dodopayments/models/blocklist/customer_retrieve_params.rb +22 -0
  18. data/lib/dodopayments/models/blocklist/customers/blocked_customer_note.rb +44 -0
  19. data/lib/dodopayments/models/blocklist/customers/note_create_params.rb +24 -0
  20. data/lib/dodopayments/models/blocklist/customers/note_request.rb +19 -0
  21. data/lib/dodopayments/models/blocklist/customers/note_update_params.rb +30 -0
  22. data/lib/dodopayments/models/checkout_session_preview_response.rb +10 -1
  23. data/lib/dodopayments/models/credit_entitlements/balance_create_ledger_entry_params.rb +1 -1
  24. data/lib/dodopayments/models/credit_entitlements/balance_create_ledger_entry_response.rb +21 -1
  25. data/lib/dodopayments/models/credit_entitlements/credit_ledger_entry.rb +2 -7
  26. data/lib/dodopayments/models/customer.rb +22 -1
  27. data/lib/dodopayments/models/customers/email_body.rb +57 -0
  28. data/lib/dodopayments/models/customers/email_failure_code.rb +27 -0
  29. data/lib/dodopayments/models/customers/email_list_params.rb +39 -0
  30. data/lib/dodopayments/models/customers/email_log_item.rb +121 -0
  31. data/lib/dodopayments/models/customers/email_log_status.rb +24 -0
  32. data/lib/dodopayments/models/customers/email_policies.rb +45 -0
  33. data/lib/dodopayments/models/customers/email_retrieve_body_params.rb +28 -0
  34. data/lib/dodopayments/models/dunning_recovered_webhook_event.rb +1 -0
  35. data/lib/dodopayments/models/dunning_started_webhook_event.rb +1 -0
  36. data/lib/dodopayments/models/manual_retry.rb +76 -0
  37. data/lib/dodopayments/models/manual_retry_state.rb +50 -0
  38. data/lib/dodopayments/models/payment_retrieve_retry_state_params.rb +20 -0
  39. data/lib/dodopayments/models/payment_retry_params.rb +20 -0
  40. data/lib/dodopayments/models/price.rb +95 -27
  41. data/lib/dodopayments/models/subscription.rb +10 -1
  42. data/lib/dodopayments/models/subscription_active_webhook_event.rb +32 -4
  43. data/lib/dodopayments/models/subscription_cancelled_webhook_event.rb +33 -4
  44. data/lib/dodopayments/models/subscription_create_response.rb +10 -1
  45. data/lib/dodopayments/models/subscription_expired_webhook_event.rb +32 -4
  46. data/lib/dodopayments/models/subscription_failed_webhook_event.rb +32 -4
  47. data/lib/dodopayments/models/subscription_list_params.rb +1 -0
  48. data/lib/dodopayments/models/subscription_list_response.rb +10 -1
  49. data/lib/dodopayments/models/subscription_on_hold_webhook_event.rb +32 -4
  50. data/lib/dodopayments/models/subscription_past_due_webhook_event.rb +68 -0
  51. data/lib/dodopayments/models/subscription_paused_webhook_event.rb +32 -4
  52. data/lib/dodopayments/models/subscription_plan_changed_webhook_event.rb +33 -4
  53. data/lib/dodopayments/models/subscription_renewed_webhook_event.rb +32 -4
  54. data/lib/dodopayments/models/subscription_status.rb +1 -0
  55. data/lib/dodopayments/models/subscription_unpaused_webhook_event.rb +32 -4
  56. data/lib/dodopayments/models/subscription_update_params.rb +1 -0
  57. data/lib/dodopayments/models/subscription_update_payment_method_webhook_event.rb +34 -4
  58. data/lib/dodopayments/models/subscription_updated_webhook_event.rb +32 -4
  59. data/lib/dodopayments/models/unsafe_unwrap_webhook_event.rb +3 -1
  60. data/lib/dodopayments/models/unwrap_webhook_event.rb +3 -1
  61. data/lib/dodopayments/models/webhook_event_type.rb +1 -0
  62. data/lib/dodopayments/models/webhook_payload.rb +19 -1
  63. data/lib/dodopayments/models.rb +12 -0
  64. data/lib/dodopayments/resources/blocklist/customers/notes.rb +68 -0
  65. data/lib/dodopayments/resources/blocklist/customers.rb +107 -0
  66. data/lib/dodopayments/resources/blocklist.rb +18 -0
  67. data/lib/dodopayments/resources/credit_entitlements/balances.rb +1 -0
  68. data/lib/dodopayments/resources/customers/emails.rb +76 -0
  69. data/lib/dodopayments/resources/customers.rb +4 -0
  70. data/lib/dodopayments/resources/payments.rb +36 -0
  71. data/lib/dodopayments/resources/webhooks.rb +2 -2
  72. data/lib/dodopayments/version.rb +1 -1
  73. data/lib/dodopayments.rb +31 -1
  74. data/rbi/dodopayments/client.rbi +3 -0
  75. data/rbi/dodopayments/models/balance_ledger_entry.rbi +16 -0
  76. data/rbi/dodopayments/models/balance_retrieve_ledger_params.rbi +10 -0
  77. data/rbi/dodopayments/models/blocklist/block_by_customer_id.rbi +32 -0
  78. data/rbi/dodopayments/models/blocklist/block_by_email.rbi +32 -0
  79. data/rbi/dodopayments/models/blocklist/block_identifier.rbi +30 -0
  80. data/rbi/dodopayments/models/blocklist/blocked_customer.rbi +161 -0
  81. data/rbi/dodopayments/models/blocklist/blocked_customer_source.rbi +55 -0
  82. data/rbi/dodopayments/models/blocklist/create_blocked_customer_request.rbi +143 -0
  83. data/rbi/dodopayments/models/blocklist/customer_create_params.rbi +34 -0
  84. data/rbi/dodopayments/models/blocklist/customer_delete_params.rbi +40 -0
  85. data/rbi/dodopayments/models/blocklist/customer_list_params.rbi +88 -0
  86. data/rbi/dodopayments/models/blocklist/customer_retrieve_params.rbi +40 -0
  87. data/rbi/dodopayments/models/blocklist/customers/blocked_customer_note.rbi +66 -0
  88. data/rbi/dodopayments/models/blocklist/customers/note_create_params.rbi +45 -0
  89. data/rbi/dodopayments/models/blocklist/customers/note_request.rbi +30 -0
  90. data/rbi/dodopayments/models/blocklist/customers/note_update_params.rbi +50 -0
  91. data/rbi/dodopayments/models/checkout_session_preview_response.rbi +10 -0
  92. data/rbi/dodopayments/models/credit_entitlements/balance_create_ledger_entry_params.rbi +2 -2
  93. data/rbi/dodopayments/models/credit_entitlements/balance_create_ledger_entry_response.rbi +8 -0
  94. data/rbi/dodopayments/models/credit_entitlements/credit_ledger_entry.rbi +2 -6
  95. data/rbi/dodopayments/models/customer.rbi +20 -0
  96. data/rbi/dodopayments/models/customers/email_body.rbi +88 -0
  97. data/rbi/dodopayments/models/customers/email_failure_code.rbi +70 -0
  98. data/rbi/dodopayments/models/customers/email_list_params.rbi +68 -0
  99. data/rbi/dodopayments/models/customers/email_log_item.rbi +157 -0
  100. data/rbi/dodopayments/models/customers/email_log_status.rbi +46 -0
  101. data/rbi/dodopayments/models/customers/email_policies.rbi +68 -0
  102. data/rbi/dodopayments/models/customers/email_retrieve_body_params.rbi +48 -0
  103. data/rbi/dodopayments/models/dunning_recovered_webhook_event.rbi +5 -0
  104. data/rbi/dodopayments/models/dunning_started_webhook_event.rbi +5 -0
  105. data/rbi/dodopayments/models/manual_retry.rbi +93 -0
  106. data/rbi/dodopayments/models/manual_retry_state.rbi +65 -0
  107. data/rbi/dodopayments/models/payment_retrieve_retry_state_params.rbi +38 -0
  108. data/rbi/dodopayments/models/payment_retry_params.rbi +38 -0
  109. data/rbi/dodopayments/models/price.rbi +124 -25
  110. data/rbi/dodopayments/models/subscription.rbi +10 -0
  111. data/rbi/dodopayments/models/subscription_active_webhook_event.rbi +53 -6
  112. data/rbi/dodopayments/models/subscription_cancelled_webhook_event.rbi +53 -6
  113. data/rbi/dodopayments/models/subscription_create_response.rbi +10 -0
  114. data/rbi/dodopayments/models/subscription_expired_webhook_event.rbi +53 -6
  115. data/rbi/dodopayments/models/subscription_failed_webhook_event.rbi +53 -6
  116. data/rbi/dodopayments/models/subscription_list_params.rbi +5 -0
  117. data/rbi/dodopayments/models/subscription_list_response.rbi +10 -0
  118. data/rbi/dodopayments/models/subscription_on_hold_webhook_event.rbi +53 -6
  119. data/rbi/dodopayments/models/subscription_past_due_webhook_event.rbi +114 -0
  120. data/rbi/dodopayments/models/subscription_paused_webhook_event.rbi +53 -6
  121. data/rbi/dodopayments/models/subscription_plan_changed_webhook_event.rbi +53 -6
  122. data/rbi/dodopayments/models/subscription_renewed_webhook_event.rbi +53 -6
  123. data/rbi/dodopayments/models/subscription_status.rbi +2 -0
  124. data/rbi/dodopayments/models/subscription_unpaused_webhook_event.rbi +53 -6
  125. data/rbi/dodopayments/models/subscription_update_params.rbi +5 -0
  126. data/rbi/dodopayments/models/subscription_update_payment_method_webhook_event.rbi +58 -6
  127. data/rbi/dodopayments/models/subscription_updated_webhook_event.rbi +53 -6
  128. data/rbi/dodopayments/models/unsafe_unwrap_webhook_event.rbi +1 -0
  129. data/rbi/dodopayments/models/unwrap_webhook_event.rbi +1 -0
  130. data/rbi/dodopayments/models/webhook_event_type.rbi +5 -0
  131. data/rbi/dodopayments/models/webhook_payload.rbi +37 -3
  132. data/rbi/dodopayments/models.rbi +14 -0
  133. data/rbi/dodopayments/resources/blocklist/customers/notes.rbi +50 -0
  134. data/rbi/dodopayments/resources/blocklist/customers.rbi +88 -0
  135. data/rbi/dodopayments/resources/blocklist.rbi +15 -0
  136. data/rbi/dodopayments/resources/credit_entitlements/balances.rbi +2 -1
  137. data/rbi/dodopayments/resources/customers/emails.rbi +60 -0
  138. data/rbi/dodopayments/resources/customers.rbi +3 -0
  139. data/rbi/dodopayments/resources/payments.rbi +26 -0
  140. data/rbi/dodopayments/resources/webhooks.rbi +2 -0
  141. data/sig/dodopayments/client.rbs +2 -0
  142. data/sig/dodopayments/models/balance_ledger_entry.rbs +9 -0
  143. data/sig/dodopayments/models/balance_retrieve_ledger_params.rbs +4 -0
  144. data/sig/dodopayments/models/blocklist/block_by_customer_id.rbs +15 -0
  145. data/sig/dodopayments/models/blocklist/block_by_email.rbs +15 -0
  146. data/sig/dodopayments/models/blocklist/block_identifier.rbs +15 -0
  147. data/sig/dodopayments/models/blocklist/blocked_customer.rbs +87 -0
  148. data/sig/dodopayments/models/blocklist/blocked_customer_source.rbs +20 -0
  149. data/sig/dodopayments/models/blocklist/create_blocked_customer_request.rbs +71 -0
  150. data/sig/dodopayments/models/blocklist/customer_create_params.rbs +17 -0
  151. data/sig/dodopayments/models/blocklist/customer_delete_params.rbs +25 -0
  152. data/sig/dodopayments/models/blocklist/customer_list_params.rbs +53 -0
  153. data/sig/dodopayments/models/blocklist/customer_retrieve_params.rbs +25 -0
  154. data/sig/dodopayments/models/blocklist/customers/blocked_customer_note.rbs +44 -0
  155. data/sig/dodopayments/models/blocklist/customers/note_create_params.rbs +30 -0
  156. data/sig/dodopayments/models/blocklist/customers/note_request.rbs +17 -0
  157. data/sig/dodopayments/models/blocklist/customers/note_update_params.rbs +36 -0
  158. data/sig/dodopayments/models/checkout_session_preview_response.rbs +5 -0
  159. data/sig/dodopayments/models/credit_entitlements/balance_create_ledger_entry_response.rbs +5 -0
  160. data/sig/dodopayments/models/customer.rbs +10 -0
  161. data/sig/dodopayments/models/customers/email_body.rbs +42 -0
  162. data/sig/dodopayments/models/customers/email_failure_code.rbs +30 -0
  163. data/sig/dodopayments/models/customers/email_list_params.rbs +38 -0
  164. data/sig/dodopayments/models/customers/email_log_item.rbs +82 -0
  165. data/sig/dodopayments/models/customers/email_log_status.rbs +20 -0
  166. data/sig/dodopayments/models/customers/email_policies.rbs +37 -0
  167. data/sig/dodopayments/models/customers/email_retrieve_body_params.rbs +30 -0
  168. data/sig/dodopayments/models/dunning_recovered_webhook_event.rbs +2 -1
  169. data/sig/dodopayments/models/dunning_started_webhook_event.rbs +2 -1
  170. data/sig/dodopayments/models/manual_retry.rbs +55 -0
  171. data/sig/dodopayments/models/manual_retry_state.rbs +40 -0
  172. data/sig/dodopayments/models/payment_retrieve_retry_state_params.rbs +23 -0
  173. data/sig/dodopayments/models/payment_retry_params.rbs +23 -0
  174. data/sig/dodopayments/models/price.rbs +52 -17
  175. data/sig/dodopayments/models/subscription.rbs +5 -0
  176. data/sig/dodopayments/models/subscription_active_webhook_event.rbs +16 -4
  177. data/sig/dodopayments/models/subscription_cancelled_webhook_event.rbs +16 -4
  178. data/sig/dodopayments/models/subscription_create_response.rbs +5 -0
  179. data/sig/dodopayments/models/subscription_expired_webhook_event.rbs +16 -4
  180. data/sig/dodopayments/models/subscription_failed_webhook_event.rbs +16 -4
  181. data/sig/dodopayments/models/subscription_list_params.rbs +2 -0
  182. data/sig/dodopayments/models/subscription_list_response.rbs +5 -0
  183. data/sig/dodopayments/models/subscription_on_hold_webhook_event.rbs +16 -4
  184. data/sig/dodopayments/models/subscription_past_due_webhook_event.rbs +47 -0
  185. data/sig/dodopayments/models/subscription_paused_webhook_event.rbs +16 -4
  186. data/sig/dodopayments/models/subscription_plan_changed_webhook_event.rbs +16 -4
  187. data/sig/dodopayments/models/subscription_renewed_webhook_event.rbs +16 -4
  188. data/sig/dodopayments/models/subscription_status.rbs +9 -1
  189. data/sig/dodopayments/models/subscription_unpaused_webhook_event.rbs +16 -4
  190. data/sig/dodopayments/models/subscription_update_params.rbs +2 -0
  191. data/sig/dodopayments/models/subscription_update_payment_method_webhook_event.rbs +16 -4
  192. data/sig/dodopayments/models/subscription_updated_webhook_event.rbs +16 -4
  193. data/sig/dodopayments/models/unsafe_unwrap_webhook_event.rbs +1 -0
  194. data/sig/dodopayments/models/unwrap_webhook_event.rbs +1 -0
  195. data/sig/dodopayments/models/webhook_event_type.rbs +2 -0
  196. data/sig/dodopayments/models/webhook_payload.rbs +16 -4
  197. data/sig/dodopayments/models.rbs +12 -0
  198. data/sig/dodopayments/resources/blocklist/customers/notes.rbs +24 -0
  199. data/sig/dodopayments/resources/blocklist/customers.rbs +36 -0
  200. data/sig/dodopayments/resources/blocklist.rbs +9 -0
  201. data/sig/dodopayments/resources/customers/emails.rbs +22 -0
  202. data/sig/dodopayments/resources/customers.rbs +2 -0
  203. data/sig/dodopayments/resources/payments.rbs +10 -0
  204. data/sig/dodopayments/resources/webhooks.rbs +2 -0
  205. metadata +92 -2
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Payments#retry_
6
+ class PaymentRetryParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ # @!attribute payment_id
11
+ #
12
+ # @return [String]
13
+ required :payment_id, String
14
+
15
+ # @!method initialize(payment_id:, request_options: {})
16
+ # @param payment_id [String]
17
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
18
+ end
19
+ end
20
+ end
@@ -24,12 +24,6 @@ module Dodopayments
24
24
  # @return [Symbol, Dodopayments::Models::Currency]
25
25
  required :currency, enum: -> { Dodopayments::Currency }
26
26
 
27
- # @!attribute discount
28
- # Discount applied to the price, represented as a percentage (0 to 100).
29
- #
30
- # @return [Integer]
31
- required :discount, Integer
32
-
33
27
  # @!attribute price
34
28
  # The payment amount, in the smallest denomination of the currency (e.g., cents
35
29
  # for USD). For example, to charge $1.00, pass `100`.
@@ -45,6 +39,27 @@ module Dodopayments
45
39
  # @return [Symbol, :one_time_price]
46
40
  required :type, const: :one_time_price
47
41
 
42
+ # @!attribute discount
43
+ # @deprecated
44
+ #
45
+ # Deprecated: use `discount_bps` instead.
46
+ #
47
+ # Discount applied to the price, represented as a percentage (0 to 100). A
48
+ # response rounds this value to the nearest whole percent. Defaults to `0`.
49
+ #
50
+ # @return [Integer, nil]
51
+ optional :discount, Integer
52
+
53
+ # @!attribute discount_bps
54
+ # Discount applied to the price, in basis points. 100 basis points make one
55
+ # percent, so `1250` is a discount of 12.5%.
56
+ #
57
+ # Use this field for a discount with a fraction of a percent. A request that sends
58
+ # this field ignores `discount`. A value of `0` gives no discount.
59
+ #
60
+ # @return [Integer, nil]
61
+ optional :discount_bps, Integer, nil?: true
62
+
48
63
  # @!attribute pay_what_you_want
49
64
  # Indicates whether the customer can pay any amount they choose. If set to `true`,
50
65
  # the [`price`](Self::price) field is the minimum amount.
@@ -74,7 +89,7 @@ module Dodopayments
74
89
  # @return [Boolean, nil]
75
90
  optional :tax_inclusive, Dodopayments::Internal::Type::Boolean, nil?: true
76
91
 
77
- # @!method initialize(currency:, discount:, price:, pay_what_you_want: nil, purchasing_power_parity: nil, suggested_price: nil, tax_inclusive: nil, type: :one_time_price)
92
+ # @!method initialize(currency:, price:, discount: nil, discount_bps: nil, pay_what_you_want: nil, purchasing_power_parity: nil, suggested_price: nil, tax_inclusive: nil, type: :one_time_price)
78
93
  # Some parameter documentations has been truncated, see
79
94
  # {Dodopayments::Models::Price::OneTimePrice} for more details.
80
95
  #
@@ -82,10 +97,12 @@ module Dodopayments
82
97
  #
83
98
  # @param currency [Symbol, Dodopayments::Models::Currency] The currency in which the payment is made.
84
99
  #
85
- # @param discount [Integer] Discount applied to the price, represented as a percentage (0 to 100).
86
- #
87
100
  # @param price [Integer] The payment amount, in the smallest denomination of the currency (e.g., cents fo
88
101
  #
102
+ # @param discount [Integer] Deprecated: use `discount_bps` instead.
103
+ #
104
+ # @param discount_bps [Integer, nil] Discount applied to the price, in basis points. 100 basis points make
105
+ #
89
106
  # @param pay_what_you_want [Boolean] Indicates whether the customer can pay any amount they choose.
90
107
  #
91
108
  # @param purchasing_power_parity [Boolean] Opts this price in to purchasing power parity. The business must also
@@ -104,12 +121,6 @@ module Dodopayments
104
121
  # @return [Symbol, Dodopayments::Models::Currency]
105
122
  required :currency, enum: -> { Dodopayments::Currency }
106
123
 
107
- # @!attribute discount
108
- # Discount applied to the price, represented as a percentage (0 to 100).
109
- #
110
- # @return [Integer]
111
- required :discount, Integer
112
-
113
124
  # @!attribute payment_frequency_count
114
125
  # Number of units for the payment frequency. For example, a value of `1` with a
115
126
  # `payment_frequency_interval` of `month` represents monthly payments.
@@ -148,6 +159,27 @@ module Dodopayments
148
159
  # @return [Symbol, :recurring_price]
149
160
  required :type, const: :recurring_price
150
161
 
162
+ # @!attribute discount
163
+ # @deprecated
164
+ #
165
+ # Deprecated: use `discount_bps` instead.
166
+ #
167
+ # Discount applied to the price, represented as a percentage (0 to 100). A
168
+ # response rounds this value to the nearest whole percent. Defaults to `0`.
169
+ #
170
+ # @return [Integer, nil]
171
+ optional :discount, Integer
172
+
173
+ # @!attribute discount_bps
174
+ # Discount applied to the price, in basis points. 100 basis points make one
175
+ # percent, so `1250` is a discount of 12.5%.
176
+ #
177
+ # Use this field for a discount with a fraction of a percent. A request that sends
178
+ # this field ignores `discount`. A value of `0` gives no discount.
179
+ #
180
+ # @return [Integer, nil]
181
+ optional :discount_bps, Integer, nil?: true
182
+
151
183
  # @!attribute purchasing_power_parity
152
184
  # Opts this price in to purchasing power parity. The business must also enable
153
185
  # purchasing power parity. The discount percentage per country is always
@@ -176,13 +208,26 @@ module Dodopayments
176
208
  # @return [Boolean, nil]
177
209
  optional :trial_apply_discounts, Dodopayments::Internal::Type::Boolean, nil?: true
178
210
 
211
+ # @!attribute trial_payment_method_optional
212
+ # Let a customer start a free trial with no card. Defaults to false.
213
+ #
214
+ # @return [Boolean, nil]
215
+ optional :trial_payment_method_optional, Dodopayments::Internal::Type::Boolean
216
+
179
217
  # @!attribute trial_period_days
180
218
  # Number of days for the trial period. A value of `0` indicates no trial period.
181
219
  #
182
220
  # @return [Integer, nil]
183
221
  optional :trial_period_days, Integer
184
222
 
185
- # @!method initialize(currency:, discount:, payment_frequency_count:, payment_frequency_interval:, price:, subscription_period_count:, subscription_period_interval:, purchasing_power_parity: nil, tax_inclusive: nil, trial_amount: nil, trial_apply_discounts: nil, trial_period_days: nil, type: :recurring_price)
223
+ # @!attribute zero_amount_payment_method_optional
224
+ # Let a customer start a subscription with no card, when the amount due today is
225
+ # `0` (a native `0` price, or a 100% discount). Defaults to false.
226
+ #
227
+ # @return [Boolean, nil]
228
+ optional :zero_amount_payment_method_optional, Dodopayments::Internal::Type::Boolean
229
+
230
+ # @!method initialize(currency:, payment_frequency_count:, payment_frequency_interval:, price:, subscription_period_count:, subscription_period_interval:, discount: nil, discount_bps: nil, purchasing_power_parity: nil, tax_inclusive: nil, trial_amount: nil, trial_apply_discounts: nil, trial_payment_method_optional: nil, trial_period_days: nil, zero_amount_payment_method_optional: nil, type: :recurring_price)
186
231
  # Some parameter documentations has been truncated, see
187
232
  # {Dodopayments::Models::Price::RecurringPrice} for more details.
188
233
  #
@@ -190,8 +235,6 @@ module Dodopayments
190
235
  #
191
236
  # @param currency [Symbol, Dodopayments::Models::Currency] The currency in which the payment is made.
192
237
  #
193
- # @param discount [Integer] Discount applied to the price, represented as a percentage (0 to 100).
194
- #
195
238
  # @param payment_frequency_count [Integer] Number of units for the payment frequency.
196
239
  #
197
240
  # @param payment_frequency_interval [Symbol, Dodopayments::Models::TimeInterval] The time interval for the payment frequency (e.g., day, month, year).
@@ -202,6 +245,10 @@ module Dodopayments
202
245
  #
203
246
  # @param subscription_period_interval [Symbol, Dodopayments::Models::TimeInterval] The time interval for the subscription period (e.g., day, month, year).
204
247
  #
248
+ # @param discount [Integer] Deprecated: use `discount_bps` instead.
249
+ #
250
+ # @param discount_bps [Integer, nil] Discount applied to the price, in basis points. 100 basis points make
251
+ #
205
252
  # @param purchasing_power_parity [Boolean] Opts this price in to purchasing power parity. The business must also
206
253
  #
207
254
  # @param tax_inclusive [Boolean, nil] Indicates if the price is tax inclusive
@@ -210,8 +257,12 @@ module Dodopayments
210
257
  #
211
258
  # @param trial_apply_discounts [Boolean, nil] Whether discount codes reduce the trial charge. Defaults to false. Only meaningf
212
259
  #
260
+ # @param trial_payment_method_optional [Boolean] Let a customer start a free trial with no card. Defaults to false.
261
+ #
213
262
  # @param trial_period_days [Integer] Number of days for the trial period. A value of `0` indicates no trial period.
214
263
  #
264
+ # @param zero_amount_payment_method_optional [Boolean] Let a customer start a subscription with no card, when the amount due
265
+ #
215
266
  # @param type [Symbol, :recurring_price]
216
267
  end
217
268
 
@@ -222,12 +273,6 @@ module Dodopayments
222
273
  # @return [Symbol, Dodopayments::Models::Currency]
223
274
  required :currency, enum: -> { Dodopayments::Currency }
224
275
 
225
- # @!attribute discount
226
- # Discount applied to the price, represented as a percentage (0 to 100).
227
- #
228
- # @return [Integer]
229
- required :discount, Integer
230
-
231
276
  # @!attribute fixed_price
232
277
  # The fixed payment amount. Represented in the lowest denomination of the currency
233
278
  # (e.g., cents for USD). For example, to charge $1.00, pass `100`.
@@ -266,6 +311,27 @@ module Dodopayments
266
311
  # @return [Symbol, :usage_based_price]
267
312
  required :type, const: :usage_based_price
268
313
 
314
+ # @!attribute discount
315
+ # @deprecated
316
+ #
317
+ # Deprecated: use `discount_bps` instead.
318
+ #
319
+ # Discount applied to the price, represented as a percentage (0 to 100). A
320
+ # response rounds this value to the nearest whole percent. Defaults to `0`.
321
+ #
322
+ # @return [Integer, nil]
323
+ optional :discount, Integer
324
+
325
+ # @!attribute discount_bps
326
+ # Discount applied to the price, in basis points. 100 basis points make one
327
+ # percent, so `1250` is a discount of 12.5%.
328
+ #
329
+ # Use this field for a discount with a fraction of a percent. A request that sends
330
+ # this field ignores `discount`. A value of `0` gives no discount.
331
+ #
332
+ # @return [Integer, nil]
333
+ optional :discount_bps, Integer, nil?: true
334
+
269
335
  # @!attribute meters
270
336
  #
271
337
  # @return [Array<Dodopayments::Models::AddMeterToPrice>, nil]
@@ -290,7 +356,7 @@ module Dodopayments
290
356
  # @return [Boolean, nil]
291
357
  optional :tax_inclusive, Dodopayments::Internal::Type::Boolean, nil?: true
292
358
 
293
- # @!method initialize(currency:, discount:, fixed_price:, payment_frequency_count:, payment_frequency_interval:, subscription_period_count:, subscription_period_interval:, meters: nil, purchasing_power_parity: nil, tax_inclusive: nil, type: :usage_based_price)
359
+ # @!method initialize(currency:, fixed_price:, payment_frequency_count:, payment_frequency_interval:, subscription_period_count:, subscription_period_interval:, discount: nil, discount_bps: nil, meters: nil, purchasing_power_parity: nil, tax_inclusive: nil, type: :usage_based_price)
294
360
  # Some parameter documentations has been truncated, see
295
361
  # {Dodopayments::Models::Price::UsageBasedPrice} for more details.
296
362
  #
@@ -298,8 +364,6 @@ module Dodopayments
298
364
  #
299
365
  # @param currency [Symbol, Dodopayments::Models::Currency] The currency in which the payment is made.
300
366
  #
301
- # @param discount [Integer] Discount applied to the price, represented as a percentage (0 to 100).
302
- #
303
367
  # @param fixed_price [Integer] The fixed payment amount. Represented in the lowest denomination of the currency
304
368
  #
305
369
  # @param payment_frequency_count [Integer] Number of units for the payment frequency.
@@ -310,6 +374,10 @@ module Dodopayments
310
374
  #
311
375
  # @param subscription_period_interval [Symbol, Dodopayments::Models::TimeInterval] The time interval for the subscription period (e.g., day, month, year).
312
376
  #
377
+ # @param discount [Integer] Deprecated: use `discount_bps` instead.
378
+ #
379
+ # @param discount_bps [Integer, nil] Discount applied to the price, in basis points. 100 basis points make
380
+ #
313
381
  # @param meters [Array<Dodopayments::Models::AddMeterToPrice>, nil]
314
382
  #
315
383
  # @param purchasing_power_parity [Boolean] Opts this price in to purchasing power parity. The business must also
@@ -53,6 +53,13 @@ module Dodopayments
53
53
  # @return [Dodopayments::Models::CustomerLimitedDetails]
54
54
  required :customer, -> { Dodopayments::CustomerLimitedDetails }
55
55
 
56
+ # @!attribute has_payment_method
57
+ # Whether a payment method is on file. False while a card-optional subscription
58
+ # waits for the customer to add one.
59
+ #
60
+ # @return [Boolean]
61
+ required :has_payment_method, Dodopayments::Internal::Type::Boolean
62
+
56
63
  # @!attribute metadata
57
64
  # Additional custom data associated with the subscription
58
65
  #
@@ -250,7 +257,7 @@ module Dodopayments
250
257
  # @return [Integer, nil]
251
258
  optional :trial_amount, Integer, nil?: true
252
259
 
253
- # @!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, paused_at: nil, payment_method_id: nil, scheduled_change: nil, tax_id: nil, trial_amount: nil)
260
+ # @!method initialize(addons:, billing:, brand_id:, cancel_at_next_billing_date:, created_at:, credit_entitlement_cart:, currency:, customer:, has_payment_method:, 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, paused_at: nil, payment_method_id: nil, scheduled_change: nil, tax_id: nil, trial_amount: nil)
254
261
  # Some parameter documentations has been truncated, see
255
262
  # {Dodopayments::Models::Subscription} for more details.
256
263
  #
@@ -272,6 +279,8 @@ module Dodopayments
272
279
  #
273
280
  # @param customer [Dodopayments::Models::CustomerLimitedDetails] Customer details associated with the subscription
274
281
  #
282
+ # @param has_payment_method [Boolean] Whether a payment method is on file. False while a card-optional
283
+ #
275
284
  # @param metadata [Hash{Symbol=>String, Float, Boolean}] Additional custom data associated with the subscription
276
285
  #
277
286
  # @param meter_credit_entitlement_cart [Array<Dodopayments::Models::MeterCreditEntitlementCartResponse>] Meter credit entitlement cart settings for this subscription
@@ -10,10 +10,11 @@ module Dodopayments
10
10
  required :business_id, String
11
11
 
12
12
  # @!attribute data
13
- # Response struct representing subscription details
13
+ # Subscription payload sent on a webhook. It carries every field of
14
+ # `SubscriptionResponse`, plus the grace-period deadline.
14
15
  #
15
- # @return [Dodopayments::Models::Subscription]
16
- required :data, -> { Dodopayments::Subscription }
16
+ # @return [Dodopayments::Models::SubscriptionActiveWebhookEvent::Data]
17
+ required :data, -> { Dodopayments::SubscriptionActiveWebhookEvent::Data }
17
18
 
18
19
  # @!attribute timestamp
19
20
  # The timestamp of when the event occurred
@@ -28,13 +29,40 @@ module Dodopayments
28
29
  required :type, const: :"subscription.active"
29
30
 
30
31
  # @!method initialize(business_id:, data:, timestamp:, type: :"subscription.active")
32
+ # Some parameter documentations has been truncated, see
33
+ # {Dodopayments::Models::SubscriptionActiveWebhookEvent} for more details.
34
+ #
31
35
  # @param business_id [String] The business identifier
32
36
  #
33
- # @param data [Dodopayments::Models::Subscription] Response struct representing subscription details
37
+ # @param data [Dodopayments::Models::SubscriptionActiveWebhookEvent::Data] Subscription payload sent on a webhook. It carries every field of
34
38
  #
35
39
  # @param timestamp [Time] The timestamp of when the event occurred
36
40
  #
37
41
  # @param type [Symbol, :"subscription.active"] The event type
42
+
43
+ # @see Dodopayments::Models::SubscriptionActiveWebhookEvent#data
44
+ class Data < Dodopayments::Models::Subscription
45
+ # @!attribute past_due_ends_at
46
+ # Time when the grace period ends. The subscription moves to `on_hold` or to
47
+ # `cancelled` at this time.
48
+ #
49
+ # Read in the same query as the rest of the payload, so it always comes from the
50
+ # row snapshot that produced `status`. It is set whenever the subscription sits in
51
+ # a window at that moment. A delayed event of another type therefore carries the
52
+ # deadline too, next to a `past_due` status.
53
+ #
54
+ # @return [Time, nil]
55
+ optional :past_due_ends_at, Time, nil?: true
56
+
57
+ # @!method initialize(past_due_ends_at: nil)
58
+ # Some parameter documentations has been truncated, see
59
+ # {Dodopayments::Models::SubscriptionActiveWebhookEvent::Data} for more details.
60
+ #
61
+ # Subscription payload sent on a webhook. It carries every field of
62
+ # `SubscriptionResponse`, plus the grace-period deadline.
63
+ #
64
+ # @param past_due_ends_at [Time, nil] Time when the grace period ends. The subscription moves to `on_hold` or
65
+ end
38
66
  end
39
67
  end
40
68
  end
@@ -10,10 +10,11 @@ module Dodopayments
10
10
  required :business_id, String
11
11
 
12
12
  # @!attribute data
13
- # Response struct representing subscription details
13
+ # Subscription payload sent on a webhook. It carries every field of
14
+ # `SubscriptionResponse`, plus the grace-period deadline.
14
15
  #
15
- # @return [Dodopayments::Models::Subscription]
16
- required :data, -> { Dodopayments::Subscription }
16
+ # @return [Dodopayments::Models::SubscriptionCancelledWebhookEvent::Data]
17
+ required :data, -> { Dodopayments::SubscriptionCancelledWebhookEvent::Data }
17
18
 
18
19
  # @!attribute timestamp
19
20
  # The timestamp of when the event occurred
@@ -28,13 +29,41 @@ module Dodopayments
28
29
  required :type, const: :"subscription.cancelled"
29
30
 
30
31
  # @!method initialize(business_id:, data:, timestamp:, type: :"subscription.cancelled")
32
+ # Some parameter documentations has been truncated, see
33
+ # {Dodopayments::Models::SubscriptionCancelledWebhookEvent} for more details.
34
+ #
31
35
  # @param business_id [String] The business identifier
32
36
  #
33
- # @param data [Dodopayments::Models::Subscription] Response struct representing subscription details
37
+ # @param data [Dodopayments::Models::SubscriptionCancelledWebhookEvent::Data] Subscription payload sent on a webhook. It carries every field of
34
38
  #
35
39
  # @param timestamp [Time] The timestamp of when the event occurred
36
40
  #
37
41
  # @param type [Symbol, :"subscription.cancelled"] The event type
42
+
43
+ # @see Dodopayments::Models::SubscriptionCancelledWebhookEvent#data
44
+ class Data < Dodopayments::Models::Subscription
45
+ # @!attribute past_due_ends_at
46
+ # Time when the grace period ends. The subscription moves to `on_hold` or to
47
+ # `cancelled` at this time.
48
+ #
49
+ # Read in the same query as the rest of the payload, so it always comes from the
50
+ # row snapshot that produced `status`. It is set whenever the subscription sits in
51
+ # a window at that moment. A delayed event of another type therefore carries the
52
+ # deadline too, next to a `past_due` status.
53
+ #
54
+ # @return [Time, nil]
55
+ optional :past_due_ends_at, Time, nil?: true
56
+
57
+ # @!method initialize(past_due_ends_at: nil)
58
+ # Some parameter documentations has been truncated, see
59
+ # {Dodopayments::Models::SubscriptionCancelledWebhookEvent::Data} for more
60
+ # details.
61
+ #
62
+ # Subscription payload sent on a webhook. It carries every field of
63
+ # `SubscriptionResponse`, plus the grace-period deadline.
64
+ #
65
+ # @param past_due_ends_at [Time, nil] Time when the grace period ends. The subscription moves to `on_hold` or
66
+ end
38
67
  end
39
68
  end
40
69
  end
@@ -28,6 +28,13 @@ module Dodopayments
28
28
  # @return [String]
29
29
  required :payment_id, String
30
30
 
31
+ # @!attribute payment_method_required
32
+ # False when the customer can start this subscription with no card. True for every
33
+ # other subscription.
34
+ #
35
+ # @return [Boolean]
36
+ required :payment_method_required, Dodopayments::Internal::Type::Boolean
37
+
31
38
  # @!attribute recurring_pre_tax_amount
32
39
  # Tax will be added to the amount and charged to the customer on each billing
33
40
  # cycle
@@ -90,7 +97,7 @@ module Dodopayments
90
97
  # @return [Integer, nil]
91
98
  optional :trial_amount, Integer, nil?: true
92
99
 
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)
100
+ # @!method initialize(addons:, customer:, metadata:, payment_id:, payment_method_required:, 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)
94
101
  # Some parameter documentations has been truncated, see
95
102
  # {Dodopayments::Models::SubscriptionCreateResponse} for more details.
96
103
  #
@@ -102,6 +109,8 @@ module Dodopayments
102
109
  #
103
110
  # @param payment_id [String] First payment id for the subscription
104
111
  #
112
+ # @param payment_method_required [Boolean] False when the customer can start this subscription with no card.
113
+ #
105
114
  # @param recurring_pre_tax_amount [Integer] Tax will be added to the amount and charged to the customer on each billing cycl
106
115
  #
107
116
  # @param subscription_id [String] Unique identifier for the subscription
@@ -10,10 +10,11 @@ module Dodopayments
10
10
  required :business_id, String
11
11
 
12
12
  # @!attribute data
13
- # Response struct representing subscription details
13
+ # Subscription payload sent on a webhook. It carries every field of
14
+ # `SubscriptionResponse`, plus the grace-period deadline.
14
15
  #
15
- # @return [Dodopayments::Models::Subscription]
16
- required :data, -> { Dodopayments::Subscription }
16
+ # @return [Dodopayments::Models::SubscriptionExpiredWebhookEvent::Data]
17
+ required :data, -> { Dodopayments::SubscriptionExpiredWebhookEvent::Data }
17
18
 
18
19
  # @!attribute timestamp
19
20
  # The timestamp of when the event occurred
@@ -28,13 +29,40 @@ module Dodopayments
28
29
  required :type, const: :"subscription.expired"
29
30
 
30
31
  # @!method initialize(business_id:, data:, timestamp:, type: :"subscription.expired")
32
+ # Some parameter documentations has been truncated, see
33
+ # {Dodopayments::Models::SubscriptionExpiredWebhookEvent} for more details.
34
+ #
31
35
  # @param business_id [String] The business identifier
32
36
  #
33
- # @param data [Dodopayments::Models::Subscription] Response struct representing subscription details
37
+ # @param data [Dodopayments::Models::SubscriptionExpiredWebhookEvent::Data] Subscription payload sent on a webhook. It carries every field of
34
38
  #
35
39
  # @param timestamp [Time] The timestamp of when the event occurred
36
40
  #
37
41
  # @param type [Symbol, :"subscription.expired"] The event type
42
+
43
+ # @see Dodopayments::Models::SubscriptionExpiredWebhookEvent#data
44
+ class Data < Dodopayments::Models::Subscription
45
+ # @!attribute past_due_ends_at
46
+ # Time when the grace period ends. The subscription moves to `on_hold` or to
47
+ # `cancelled` at this time.
48
+ #
49
+ # Read in the same query as the rest of the payload, so it always comes from the
50
+ # row snapshot that produced `status`. It is set whenever the subscription sits in
51
+ # a window at that moment. A delayed event of another type therefore carries the
52
+ # deadline too, next to a `past_due` status.
53
+ #
54
+ # @return [Time, nil]
55
+ optional :past_due_ends_at, Time, nil?: true
56
+
57
+ # @!method initialize(past_due_ends_at: nil)
58
+ # Some parameter documentations has been truncated, see
59
+ # {Dodopayments::Models::SubscriptionExpiredWebhookEvent::Data} for more details.
60
+ #
61
+ # Subscription payload sent on a webhook. It carries every field of
62
+ # `SubscriptionResponse`, plus the grace-period deadline.
63
+ #
64
+ # @param past_due_ends_at [Time, nil] Time when the grace period ends. The subscription moves to `on_hold` or
65
+ end
38
66
  end
39
67
  end
40
68
  end
@@ -10,10 +10,11 @@ module Dodopayments
10
10
  required :business_id, String
11
11
 
12
12
  # @!attribute data
13
- # Response struct representing subscription details
13
+ # Subscription payload sent on a webhook. It carries every field of
14
+ # `SubscriptionResponse`, plus the grace-period deadline.
14
15
  #
15
- # @return [Dodopayments::Models::Subscription]
16
- required :data, -> { Dodopayments::Subscription }
16
+ # @return [Dodopayments::Models::SubscriptionFailedWebhookEvent::Data]
17
+ required :data, -> { Dodopayments::SubscriptionFailedWebhookEvent::Data }
17
18
 
18
19
  # @!attribute timestamp
19
20
  # The timestamp of when the event occurred
@@ -28,13 +29,40 @@ module Dodopayments
28
29
  required :type, const: :"subscription.failed"
29
30
 
30
31
  # @!method initialize(business_id:, data:, timestamp:, type: :"subscription.failed")
32
+ # Some parameter documentations has been truncated, see
33
+ # {Dodopayments::Models::SubscriptionFailedWebhookEvent} for more details.
34
+ #
31
35
  # @param business_id [String] The business identifier
32
36
  #
33
- # @param data [Dodopayments::Models::Subscription] Response struct representing subscription details
37
+ # @param data [Dodopayments::Models::SubscriptionFailedWebhookEvent::Data] Subscription payload sent on a webhook. It carries every field of
34
38
  #
35
39
  # @param timestamp [Time] The timestamp of when the event occurred
36
40
  #
37
41
  # @param type [Symbol, :"subscription.failed"] The event type
42
+
43
+ # @see Dodopayments::Models::SubscriptionFailedWebhookEvent#data
44
+ class Data < Dodopayments::Models::Subscription
45
+ # @!attribute past_due_ends_at
46
+ # Time when the grace period ends. The subscription moves to `on_hold` or to
47
+ # `cancelled` at this time.
48
+ #
49
+ # Read in the same query as the rest of the payload, so it always comes from the
50
+ # row snapshot that produced `status`. It is set whenever the subscription sits in
51
+ # a window at that moment. A delayed event of another type therefore carries the
52
+ # deadline too, next to a `past_due` status.
53
+ #
54
+ # @return [Time, nil]
55
+ optional :past_due_ends_at, Time, nil?: true
56
+
57
+ # @!method initialize(past_due_ends_at: nil)
58
+ # Some parameter documentations has been truncated, see
59
+ # {Dodopayments::Models::SubscriptionFailedWebhookEvent::Data} for more details.
60
+ #
61
+ # Subscription payload sent on a webhook. It carries every field of
62
+ # `SubscriptionResponse`, plus the grace-period deadline.
63
+ #
64
+ # @param past_due_ends_at [Time, nil] Time when the grace period ends. The subscription moves to `on_hold` or
65
+ end
38
66
  end
39
67
  end
40
68
  end
@@ -96,6 +96,7 @@ module Dodopayments
96
96
  CANCELLED = :cancelled
97
97
  FAILED = :failed
98
98
  EXPIRED = :expired
99
+ PAST_DUE = :past_due
99
100
 
100
101
  # @!method self.values
101
102
  # @return [Array<Symbol>]
@@ -41,6 +41,13 @@ module Dodopayments
41
41
  required :discounts,
42
42
  -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::SubscriptionListResponse::Discount] }
43
43
 
44
+ # @!attribute has_payment_method
45
+ # Whether a payment method is on file. False while a card-optional subscription
46
+ # waits for the customer to add one.
47
+ #
48
+ # @return [Boolean]
49
+ required :has_payment_method, Dodopayments::Internal::Type::Boolean
50
+
44
51
  # @!attribute metadata
45
52
  # Additional custom data associated with the subscription
46
53
  #
@@ -197,7 +204,7 @@ module Dodopayments
197
204
  # @return [Integer, nil]
198
205
  optional :trial_amount, Integer, nil?: true
199
206
 
200
- # @!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, paused_at: nil, payment_method_id: nil, product_name: nil, scheduled_change: nil, tax_id: nil, trial_amount: nil)
207
+ # @!method initialize(billing:, cancel_at_next_billing_date:, created_at:, currency:, customer:, discounts:, has_payment_method:, 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, paused_at: nil, payment_method_id: nil, product_name: nil, scheduled_change: nil, tax_id: nil, trial_amount: nil)
201
208
  # Some parameter documentations has been truncated, see
202
209
  # {Dodopayments::Models::SubscriptionListResponse} for more details.
203
210
  #
@@ -215,6 +222,8 @@ module Dodopayments
215
222
  #
216
223
  # @param discounts [Array<Dodopayments::Models::SubscriptionListResponse::Discount>] All stacked discounts applied, in order of application
217
224
  #
225
+ # @param has_payment_method [Boolean] Whether a payment method is on file. False while a card-optional
226
+ #
218
227
  # @param metadata [Hash{Symbol=>String, Float, Boolean}] Additional custom data associated with the subscription
219
228
  #
220
229
  # @param next_billing_date [Time] Timestamp of the next scheduled billing. Indicates the end of current billing pe
@@ -10,10 +10,11 @@ module Dodopayments
10
10
  required :business_id, String
11
11
 
12
12
  # @!attribute data
13
- # Response struct representing subscription details
13
+ # Subscription payload sent on a webhook. It carries every field of
14
+ # `SubscriptionResponse`, plus the grace-period deadline.
14
15
  #
15
- # @return [Dodopayments::Models::Subscription]
16
- required :data, -> { Dodopayments::Subscription }
16
+ # @return [Dodopayments::Models::SubscriptionOnHoldWebhookEvent::Data]
17
+ required :data, -> { Dodopayments::SubscriptionOnHoldWebhookEvent::Data }
17
18
 
18
19
  # @!attribute timestamp
19
20
  # The timestamp of when the event occurred
@@ -28,13 +29,40 @@ module Dodopayments
28
29
  required :type, const: :"subscription.on_hold"
29
30
 
30
31
  # @!method initialize(business_id:, data:, timestamp:, type: :"subscription.on_hold")
32
+ # Some parameter documentations has been truncated, see
33
+ # {Dodopayments::Models::SubscriptionOnHoldWebhookEvent} for more details.
34
+ #
31
35
  # @param business_id [String] The business identifier
32
36
  #
33
- # @param data [Dodopayments::Models::Subscription] Response struct representing subscription details
37
+ # @param data [Dodopayments::Models::SubscriptionOnHoldWebhookEvent::Data] Subscription payload sent on a webhook. It carries every field of
34
38
  #
35
39
  # @param timestamp [Time] The timestamp of when the event occurred
36
40
  #
37
41
  # @param type [Symbol, :"subscription.on_hold"] The event type
42
+
43
+ # @see Dodopayments::Models::SubscriptionOnHoldWebhookEvent#data
44
+ class Data < Dodopayments::Models::Subscription
45
+ # @!attribute past_due_ends_at
46
+ # Time when the grace period ends. The subscription moves to `on_hold` or to
47
+ # `cancelled` at this time.
48
+ #
49
+ # Read in the same query as the rest of the payload, so it always comes from the
50
+ # row snapshot that produced `status`. It is set whenever the subscription sits in
51
+ # a window at that moment. A delayed event of another type therefore carries the
52
+ # deadline too, next to a `past_due` status.
53
+ #
54
+ # @return [Time, nil]
55
+ optional :past_due_ends_at, Time, nil?: true
56
+
57
+ # @!method initialize(past_due_ends_at: nil)
58
+ # Some parameter documentations has been truncated, see
59
+ # {Dodopayments::Models::SubscriptionOnHoldWebhookEvent::Data} for more details.
60
+ #
61
+ # Subscription payload sent on a webhook. It carries every field of
62
+ # `SubscriptionResponse`, plus the grace-period deadline.
63
+ #
64
+ # @param past_due_ends_at [Time, nil] Time when the grace period ends. The subscription moves to `on_hold` or
65
+ end
38
66
  end
39
67
  end
40
68
  end