dodopayments 2.32.2 → 2.33.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 +8 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/models/balance_ledger_entry.rb +3 -0
  5. data/lib/dodopayments/models/balance_retrieve_ledger_params.rb +3 -0
  6. data/lib/dodopayments/models/checkout_session_flags.rb +3 -0
  7. data/lib/dodopayments/models/manual_retry_state.rb +27 -1
  8. data/lib/dodopayments/models/payment.rb +14 -1
  9. data/lib/dodopayments/models/payment_list_response.rb +33 -1
  10. data/lib/dodopayments/models/product_collection.rb +2 -0
  11. data/lib/dodopayments/models/product_collection_create_params.rb +2 -0
  12. data/lib/dodopayments/models/product_collection_update_params.rb +2 -0
  13. data/lib/dodopayments/models/refund.rb +11 -1
  14. data/lib/dodopayments/models/refund_list_item.rb +11 -1
  15. data/lib/dodopayments/models/subscription_active_webhook_event.rb +10 -1
  16. data/lib/dodopayments/models/subscription_cancelled_webhook_event.rb +10 -1
  17. data/lib/dodopayments/models/subscription_expired_webhook_event.rb +10 -1
  18. data/lib/dodopayments/models/subscription_failed_webhook_event.rb +10 -1
  19. data/lib/dodopayments/models/subscription_on_hold_webhook_event.rb +10 -1
  20. data/lib/dodopayments/models/subscription_past_due_webhook_event.rb +10 -1
  21. data/lib/dodopayments/models/subscription_paused_webhook_event.rb +10 -1
  22. data/lib/dodopayments/models/subscription_plan_changed_webhook_event.rb +10 -1
  23. data/lib/dodopayments/models/subscription_renewed_webhook_event.rb +10 -1
  24. data/lib/dodopayments/models/subscription_service_period.rb +39 -0
  25. data/lib/dodopayments/models/subscription_unpaused_webhook_event.rb +10 -1
  26. data/lib/dodopayments/models/subscription_update_payment_method_webhook_event.rb +10 -1
  27. data/lib/dodopayments/models/subscription_updated_webhook_event.rb +10 -1
  28. data/lib/dodopayments/models/update_subscription_plan_req.rb +1 -0
  29. data/lib/dodopayments/models/webhook_payload.rb +10 -1
  30. data/lib/dodopayments/models.rb +2 -0
  31. data/lib/dodopayments/version.rb +1 -1
  32. data/lib/dodopayments.rb +1 -0
  33. data/rbi/dodopayments/models/balance_ledger_entry.rbi +15 -0
  34. data/rbi/dodopayments/models/balance_retrieve_ledger_params.rbi +15 -0
  35. data/rbi/dodopayments/models/checkout_session_flags.rbi +6 -0
  36. data/rbi/dodopayments/models/manual_retry_state.rbi +28 -0
  37. data/rbi/dodopayments/models/payment.rbi +17 -0
  38. data/rbi/dodopayments/models/payment_list_response.rbi +39 -0
  39. data/rbi/dodopayments/models/product_collection.rbi +10 -0
  40. data/rbi/dodopayments/models/product_collection_create_params.rbi +10 -0
  41. data/rbi/dodopayments/models/product_collection_update_params.rbi +10 -0
  42. data/rbi/dodopayments/models/refund.rbi +12 -0
  43. data/rbi/dodopayments/models/refund_list_item.rbi +12 -0
  44. data/rbi/dodopayments/models/subscription_active_webhook_event.rbi +18 -3
  45. data/rbi/dodopayments/models/subscription_cancelled_webhook_event.rbi +18 -3
  46. data/rbi/dodopayments/models/subscription_expired_webhook_event.rbi +18 -3
  47. data/rbi/dodopayments/models/subscription_failed_webhook_event.rbi +18 -3
  48. data/rbi/dodopayments/models/subscription_on_hold_webhook_event.rbi +18 -3
  49. data/rbi/dodopayments/models/subscription_past_due_webhook_event.rbi +18 -3
  50. data/rbi/dodopayments/models/subscription_paused_webhook_event.rbi +18 -3
  51. data/rbi/dodopayments/models/subscription_plan_changed_webhook_event.rbi +18 -3
  52. data/rbi/dodopayments/models/subscription_renewed_webhook_event.rbi +18 -3
  53. data/rbi/dodopayments/models/subscription_service_period.rbi +55 -0
  54. data/rbi/dodopayments/models/subscription_unpaused_webhook_event.rbi +18 -3
  55. data/rbi/dodopayments/models/subscription_update_payment_method_webhook_event.rbi +18 -3
  56. data/rbi/dodopayments/models/subscription_updated_webhook_event.rbi +18 -3
  57. data/rbi/dodopayments/models/update_subscription_plan_req.rbi +5 -0
  58. data/rbi/dodopayments/models/webhook_payload.rbi +14 -1
  59. data/rbi/dodopayments/models.rbi +2 -0
  60. data/sig/dodopayments/models/balance_ledger_entry.rbs +6 -0
  61. data/sig/dodopayments/models/balance_retrieve_ledger_params.rbs +6 -0
  62. data/sig/dodopayments/models/manual_retry_state.rbs +15 -0
  63. data/sig/dodopayments/models/payment.rbs +5 -0
  64. data/sig/dodopayments/models/payment_list_response.rbs +15 -0
  65. data/sig/dodopayments/models/product_collection.rbs +4 -0
  66. data/sig/dodopayments/models/product_collection_create_params.rbs +4 -0
  67. data/sig/dodopayments/models/product_collection_update_params.rbs +4 -0
  68. data/sig/dodopayments/models/refund.rbs +5 -0
  69. data/sig/dodopayments/models/refund_list_item.rbs +5 -0
  70. data/sig/dodopayments/models/subscription_active_webhook_event.rbs +7 -3
  71. data/sig/dodopayments/models/subscription_cancelled_webhook_event.rbs +7 -3
  72. data/sig/dodopayments/models/subscription_expired_webhook_event.rbs +7 -3
  73. data/sig/dodopayments/models/subscription_failed_webhook_event.rbs +7 -3
  74. data/sig/dodopayments/models/subscription_on_hold_webhook_event.rbs +7 -3
  75. data/sig/dodopayments/models/subscription_past_due_webhook_event.rbs +7 -3
  76. data/sig/dodopayments/models/subscription_paused_webhook_event.rbs +7 -3
  77. data/sig/dodopayments/models/subscription_plan_changed_webhook_event.rbs +7 -3
  78. data/sig/dodopayments/models/subscription_renewed_webhook_event.rbs +7 -3
  79. data/sig/dodopayments/models/subscription_service_period.rbs +26 -0
  80. data/sig/dodopayments/models/subscription_unpaused_webhook_event.rbs +7 -3
  81. data/sig/dodopayments/models/subscription_update_payment_method_webhook_event.rbs +7 -3
  82. data/sig/dodopayments/models/subscription_updated_webhook_event.rbs +7 -3
  83. data/sig/dodopayments/models/update_subscription_plan_req.rbs +2 -0
  84. data/sig/dodopayments/models/webhook_payload.rbs +12 -2
  85. data/sig/dodopayments/models.rbs +2 -0
  86. metadata +5 -2
@@ -55,7 +55,14 @@ module Dodopayments
55
55
  # @return [Time, nil]
56
56
  optional :past_due_ends_at, Time, nil?: true
57
57
 
58
- # @!method initialize(past_due_ends_at: nil)
58
+ # @!attribute payment_id
59
+ # Identifier of the payment that caused this event. It is set only for
60
+ # `subscription.renewed`. It is null for all other subscription events.
61
+ #
62
+ # @return [String, nil]
63
+ optional :payment_id, String, nil?: true
64
+
65
+ # @!method initialize(past_due_ends_at: nil, payment_id: nil)
59
66
  # Some parameter documentations has been truncated, see
60
67
  # {Dodopayments::Models::SubscriptionUpdatePaymentMethodWebhookEvent::Data} for
61
68
  # more details.
@@ -64,6 +71,8 @@ module Dodopayments
64
71
  # `SubscriptionResponse`, plus the grace-period deadline.
65
72
  #
66
73
  # @param past_due_ends_at [Time, nil] Time when the grace period ends. The subscription moves to `on_hold` or
74
+ #
75
+ # @param payment_id [String, nil] Identifier of the payment that caused this event.
67
76
  end
68
77
  end
69
78
  end
@@ -54,7 +54,14 @@ module Dodopayments
54
54
  # @return [Time, nil]
55
55
  optional :past_due_ends_at, Time, nil?: true
56
56
 
57
- # @!method initialize(past_due_ends_at: nil)
57
+ # @!attribute payment_id
58
+ # Identifier of the payment that caused this event. It is set only for
59
+ # `subscription.renewed`. It is null for all other subscription events.
60
+ #
61
+ # @return [String, nil]
62
+ optional :payment_id, String, nil?: true
63
+
64
+ # @!method initialize(past_due_ends_at: nil, payment_id: nil)
58
65
  # Some parameter documentations has been truncated, see
59
66
  # {Dodopayments::Models::SubscriptionUpdatedWebhookEvent::Data} for more details.
60
67
  #
@@ -62,6 +69,8 @@ module Dodopayments
62
69
  # `SubscriptionResponse`, plus the grace-period deadline.
63
70
  #
64
71
  # @param past_due_ends_at [Time, nil] Time when the grace period ends. The subscription moves to `on_hold` or
72
+ #
73
+ # @param payment_id [String, nil] Identifier of the payment that caused this event.
65
74
  end
66
75
  end
67
76
  end
@@ -190,6 +190,7 @@ module Dodopayments
190
190
  FULL_IMMEDIATELY = :full_immediately
191
191
  DIFFERENCE_IMMEDIATELY = :difference_immediately
192
192
  DO_NOT_BILL = :do_not_bill
193
+ PRORATED_IMMEDIATELY_KEEP_CYCLE = :prorated_immediately_keep_cycle
193
194
 
194
195
  # @!method self.values
195
196
  # @return [Array<Symbol>]
@@ -101,7 +101,14 @@ module Dodopayments
101
101
  # @return [Time, nil]
102
102
  optional :past_due_ends_at, Time, nil?: true
103
103
 
104
- # @!method initialize(past_due_ends_at: nil, payload_type: :Subscription)
104
+ # @!attribute payment_id
105
+ # Identifier of the payment that caused this event. It is set only for
106
+ # `subscription.renewed`. It is null for all other subscription events.
107
+ #
108
+ # @return [String, nil]
109
+ optional :payment_id, String, nil?: true
110
+
111
+ # @!method initialize(past_due_ends_at: nil, payment_id: nil, payload_type: :Subscription)
105
112
  # Some parameter documentations has been truncated, see
106
113
  # {Dodopayments::Models::WebhookPayload::Data::Subscription} for more details.
107
114
  #
@@ -109,6 +116,8 @@ module Dodopayments
109
116
  #
110
117
  # @param past_due_ends_at [Time, nil] Time when the grace period ends. The subscription moves to `on_hold` or
111
118
  #
119
+ # @param payment_id [String, nil] Identifier of the payment that caused this event.
120
+ #
112
121
  # @param payload_type [Symbol, :Subscription]
113
122
  end
114
123
 
@@ -514,6 +514,8 @@ module Dodopayments
514
514
 
515
515
  SubscriptionRetrieveUsageHistoryParams = Dodopayments::Models::SubscriptionRetrieveUsageHistoryParams
516
516
 
517
+ SubscriptionServicePeriod = Dodopayments::Models::SubscriptionServicePeriod
518
+
517
519
  SubscriptionStatus = Dodopayments::Models::SubscriptionStatus
518
520
 
519
521
  SubscriptionUnpausedWebhookEvent = Dodopayments::Models::SubscriptionUnpausedWebhookEvent
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dodopayments
4
- VERSION = "2.32.2"
4
+ VERSION = "2.33.0"
5
5
  end
data/lib/dodopayments.rb CHANGED
@@ -393,6 +393,7 @@ require_relative "dodopayments/models/subscription_retrieve_credit_usage_respons
393
393
  require_relative "dodopayments/models/subscription_retrieve_params"
394
394
  require_relative "dodopayments/models/subscription_retrieve_usage_history_params"
395
395
  require_relative "dodopayments/models/subscription_retrieve_usage_history_response"
396
+ require_relative "dodopayments/models/subscription_service_period"
396
397
  require_relative "dodopayments/models/subscription_status"
397
398
  require_relative "dodopayments/models/subscription_unpaused_webhook_event"
398
399
  require_relative "dodopayments/models/subscription_updated_webhook_event"
@@ -268,6 +268,21 @@ module Dodopayments
268
268
  :moderation_fees,
269
269
  Dodopayments::BalanceLedgerEntry::EventType::TaggedSymbol
270
270
  )
271
+ DODO_FIXED_FEE =
272
+ T.let(
273
+ :dodo_fixed_fee,
274
+ Dodopayments::BalanceLedgerEntry::EventType::TaggedSymbol
275
+ )
276
+ INTERCHANGE_FEE =
277
+ T.let(
278
+ :interchange_fee,
279
+ Dodopayments::BalanceLedgerEntry::EventType::TaggedSymbol
280
+ )
281
+ SCHEME_FEE =
282
+ T.let(
283
+ :scheme_fee,
284
+ Dodopayments::BalanceLedgerEntry::EventType::TaggedSymbol
285
+ )
271
286
 
272
287
  sig do
273
288
  override.returns(
@@ -1060,6 +1060,21 @@ module Dodopayments
1060
1060
  :moderation_fees,
1061
1061
  Dodopayments::BalanceRetrieveLedgerParams::EventType::TaggedSymbol
1062
1062
  )
1063
+ DODO_FIXED_FEE =
1064
+ T.let(
1065
+ :dodo_fixed_fee,
1066
+ Dodopayments::BalanceRetrieveLedgerParams::EventType::TaggedSymbol
1067
+ )
1068
+ INTERCHANGE_FEE =
1069
+ T.let(
1070
+ :interchange_fee,
1071
+ Dodopayments::BalanceRetrieveLedgerParams::EventType::TaggedSymbol
1072
+ )
1073
+ SCHEME_FEE =
1074
+ T.let(
1075
+ :scheme_fee,
1076
+ Dodopayments::BalanceRetrieveLedgerParams::EventType::TaggedSymbol
1077
+ )
1063
1078
 
1064
1079
  sig do
1065
1080
  override.returns(
@@ -83,6 +83,9 @@ module Dodopayments
83
83
 
84
84
  # If the customer is allowed to apply discount code, set it to true.
85
85
  #
86
+ # If this flag is false, the customer cannot change the discount codes. The
87
+ # discount codes that you give when you create the session still apply.
88
+ #
86
89
  # Default is true
87
90
  sig { returns(T.nilable(T::Boolean)) }
88
91
  attr_reader :allow_discount_code
@@ -234,6 +237,9 @@ module Dodopayments
234
237
  allow_customer_editing_zipcode: nil,
235
238
  # If the customer is allowed to apply discount code, set it to true.
236
239
  #
240
+ # If this flag is false, the customer cannot change the discount codes. The
241
+ # discount codes that you give when you create the session still apply.
242
+ #
237
243
  # Default is true
238
244
  allow_discount_code: nil,
239
245
  # If true, the customer can add or remove addons on a subscription product during
@@ -17,6 +17,20 @@ module Dodopayments
17
17
  sig { returns(Integer) }
18
18
  attr_accessor :sends_used
19
19
 
20
+ # The number of the queued automatic retry, starting at 1.
21
+ sig { returns(T.nilable(Integer)) }
22
+ attr_accessor :automatic_retry_number
23
+
24
+ # The number of automatic retries that the current configuration plans for this
25
+ # invoice. It is never less than `automatic_retry_number`.
26
+ sig { returns(T.nilable(Integer)) }
27
+ attr_accessor :automatic_retry_total
28
+
29
+ # When the next automatic retry on this invoice is scheduled. Null when no
30
+ # automatic retry is queued or automatic retries are disabled.
31
+ sig { returns(T.nilable(Time)) }
32
+ attr_accessor :next_automatic_retry_at
33
+
20
34
  # The code `POST` would fail with. Null when `can_retry` is true.
21
35
  sig { returns(T.nilable(String)) }
22
36
  attr_accessor :reason
@@ -31,6 +45,9 @@ module Dodopayments
31
45
  can_retry: T::Boolean,
32
46
  sends_allowed: Integer,
33
47
  sends_used: Integer,
48
+ automatic_retry_number: T.nilable(Integer),
49
+ automatic_retry_total: T.nilable(Integer),
50
+ next_automatic_retry_at: T.nilable(Time),
34
51
  reason: T.nilable(String),
35
52
  retry_available_at: T.nilable(Time)
36
53
  ).returns(T.attached_class)
@@ -39,6 +56,14 @@ module Dodopayments
39
56
  can_retry:,
40
57
  sends_allowed:,
41
58
  sends_used:,
59
+ # The number of the queued automatic retry, starting at 1.
60
+ automatic_retry_number: nil,
61
+ # The number of automatic retries that the current configuration plans for this
62
+ # invoice. It is never less than `automatic_retry_number`.
63
+ automatic_retry_total: nil,
64
+ # When the next automatic retry on this invoice is scheduled. Null when no
65
+ # automatic retry is queued or automatic retries are disabled.
66
+ next_automatic_retry_at: nil,
42
67
  # The code `POST` would fail with. Null when `can_retry` is true.
43
68
  reason: nil,
44
69
  # When the next send becomes available. Null when no send is left, or when the
@@ -53,6 +78,9 @@ module Dodopayments
53
78
  can_retry: T::Boolean,
54
79
  sends_allowed: Integer,
55
80
  sends_used: Integer,
81
+ automatic_retry_number: T.nilable(Integer),
82
+ automatic_retry_total: T.nilable(Integer),
83
+ next_automatic_retry_at: T.nilable(Time),
56
84
  reason: T.nilable(String),
57
85
  retry_available_at: T.nilable(Time)
58
86
  }
@@ -82,6 +82,14 @@ module Dodopayments
82
82
  sig { returns(Integer) }
83
83
  attr_accessor :retry_attempt
84
84
 
85
+ # The service period of each subscription that this payment pays for. The order is
86
+ # the same as `subscription_ids`. For a plan change charge, the period starts at
87
+ # the plan change and ends at the next billing date. The list is empty unless the
88
+ # payment status is `succeeded`. The list is also empty for a one-time payment, an
89
+ # on-demand charge, or a payment method update.
90
+ sig { returns(T::Array[Dodopayments::SubscriptionServicePeriod]) }
91
+ attr_accessor :service_periods
92
+
85
93
  # The amount that will be credited to your Dodo balance after currency conversion
86
94
  # and processing. Especially relevant for adaptive pricing where the customer's
87
95
  # payment currency differs from your settlement currency.
@@ -230,6 +238,8 @@ module Dodopayments
230
238
  payment_provider: Dodopayments::Payment::PaymentProvider::OrSymbol,
231
239
  refunds: T::Array[Dodopayments::RefundListItem::OrHash],
232
240
  retry_attempt: Integer,
241
+ service_periods:
242
+ T::Array[Dodopayments::SubscriptionServicePeriod::OrHash],
233
243
  settlement_amount: Integer,
234
244
  settlement_currency: Dodopayments::Currency::OrSymbol,
235
245
  subscription_ids: T::Array[String],
@@ -299,6 +309,12 @@ module Dodopayments
299
309
  # payment, `1`+ for each scheduled off-session retry after a failed renewal.
300
310
  # Always `0` for non-subscription payments.
301
311
  retry_attempt:,
312
+ # The service period of each subscription that this payment pays for. The order is
313
+ # the same as `subscription_ids`. For a plan change charge, the period starts at
314
+ # the plan change and ends at the next billing date. The list is empty unless the
315
+ # payment status is `succeeded`. The list is also empty for a one-time payment, an
316
+ # on-demand charge, or a payment method update.
317
+ service_periods:,
302
318
  # The amount that will be credited to your Dodo balance after currency conversion
303
319
  # and processing. Especially relevant for adaptive pricing where the customer's
304
320
  # payment currency differs from your settlement currency.
@@ -394,6 +410,7 @@ module Dodopayments
394
410
  Dodopayments::Payment::PaymentProvider::TaggedSymbol,
395
411
  refunds: T::Array[Dodopayments::RefundListItem],
396
412
  retry_attempt: Integer,
413
+ service_periods: T::Array[Dodopayments::SubscriptionServicePeriod],
397
414
  settlement_amount: Integer,
398
415
  settlement_currency: Dodopayments::Currency::TaggedSymbol,
399
416
  subscription_ids: T::Array[String],
@@ -56,6 +56,20 @@ module Dodopayments
56
56
  end
57
57
  attr_accessor :payment_provider
58
58
 
59
+ # The retry attempt number of this payment. The value is `0` for the original
60
+ # payment. Each retry after a failed subscription renewal adds `1`. The value is
61
+ # always `0` for a payment that is not for a subscription.
62
+ sig { returns(Integer) }
63
+ attr_accessor :retry_attempt
64
+
65
+ # The service period of each subscription that this payment pays for. The order is
66
+ # the same as `subscription_ids`. For a plan change charge, the period starts at
67
+ # the plan change and ends at the next billing date. The list is empty unless the
68
+ # payment status is `succeeded`. The list is also empty for a one-time payment, an
69
+ # on-demand charge, or a payment method update.
70
+ sig { returns(T::Array[Dodopayments::SubscriptionServicePeriod]) }
71
+ attr_accessor :service_periods
72
+
59
73
  # Every subscription that this payment starts or charges, in a stable order. It is
60
74
  # empty for a one-time payment. It holds the value of `subscription_id` when the
61
75
  # payment names one subscription.
@@ -73,6 +87,11 @@ module Dodopayments
73
87
  sig { returns(T.nilable(String)) }
74
88
  attr_accessor :card_network
75
89
 
90
+ # The ID of the checkout session for this payment. The value is null when the
91
+ # payment does not use a checkout session.
92
+ sig { returns(T.nilable(String)) }
93
+ attr_accessor :checkout_session_id
94
+
76
95
  # The most recent dispute status for this payment. None if no disputes exist.
77
96
  sig { returns(T.nilable(Dodopayments::DisputeStatus::TaggedSymbol)) }
78
97
  attr_accessor :dispute_status
@@ -117,10 +136,14 @@ module Dodopayments
117
136
  payment_id: String,
118
137
  payment_provider:
119
138
  Dodopayments::Models::PaymentListResponse::PaymentProvider::OrSymbol,
139
+ retry_attempt: Integer,
140
+ service_periods:
141
+ T::Array[Dodopayments::SubscriptionServicePeriod::OrHash],
120
142
  subscription_ids: T::Array[String],
121
143
  total_amount: Integer,
122
144
  card_last_four: T.nilable(String),
123
145
  card_network: T.nilable(String),
146
+ checkout_session_id: T.nilable(String),
124
147
  dispute_status: T.nilable(Dodopayments::DisputeStatus::OrSymbol),
125
148
  invoice_id: T.nilable(String),
126
149
  invoice_url: T.nilable(String),
@@ -148,6 +171,16 @@ module Dodopayments
148
171
  # Which processor handled this payment. `stripe` / `adyen` for BYOP routes (the
149
172
  # merchant's own payment connector); `dodo` for everything Dodo processed itself.
150
173
  payment_provider:,
174
+ # The retry attempt number of this payment. The value is `0` for the original
175
+ # payment. Each retry after a failed subscription renewal adds `1`. The value is
176
+ # always `0` for a payment that is not for a subscription.
177
+ retry_attempt:,
178
+ # The service period of each subscription that this payment pays for. The order is
179
+ # the same as `subscription_ids`. For a plan change charge, the period starts at
180
+ # the plan change and ends at the next billing date. The list is empty unless the
181
+ # payment status is `succeeded`. The list is also empty for a one-time payment, an
182
+ # on-demand charge, or a payment method update.
183
+ service_periods:,
151
184
  # Every subscription that this payment starts or charges, in a stable order. It is
152
185
  # empty for a one-time payment. It holds the value of `subscription_id` when the
153
186
  # payment names one subscription.
@@ -157,6 +190,9 @@ module Dodopayments
157
190
  card_last_four: nil,
158
191
  # Card network like VISA, MASTERCARD etc.
159
192
  card_network: nil,
193
+ # The ID of the checkout session for this payment. The value is null when the
194
+ # payment does not use a checkout session.
195
+ checkout_session_id: nil,
160
196
  # The most recent dispute status for this payment. None if no disputes exist.
161
197
  dispute_status: nil,
162
198
  # Invoice ID for this payment. Uses India-specific invoice ID if available.
@@ -187,10 +223,13 @@ module Dodopayments
187
223
  payment_id: String,
188
224
  payment_provider:
189
225
  Dodopayments::Models::PaymentListResponse::PaymentProvider::TaggedSymbol,
226
+ retry_attempt: Integer,
227
+ service_periods: T::Array[Dodopayments::SubscriptionServicePeriod],
190
228
  subscription_ids: T::Array[String],
191
229
  total_amount: Integer,
192
230
  card_last_four: T.nilable(String),
193
231
  card_network: T.nilable(String),
232
+ checkout_session_id: T.nilable(String),
194
233
  dispute_status:
195
234
  T.nilable(Dodopayments::DisputeStatus::TaggedSymbol),
196
235
  invoice_id: T.nilable(String),
@@ -350,6 +350,11 @@ module Dodopayments
350
350
  :do_not_bill,
351
351
  Dodopayments::ProductCollection::ProrationBillingModeOnDowngrade::TaggedSymbol
352
352
  )
353
+ PRORATED_IMMEDIATELY_KEEP_CYCLE =
354
+ T.let(
355
+ :prorated_immediately_keep_cycle,
356
+ Dodopayments::ProductCollection::ProrationBillingModeOnDowngrade::TaggedSymbol
357
+ )
353
358
 
354
359
  sig do
355
360
  override.returns(
@@ -396,6 +401,11 @@ module Dodopayments
396
401
  :do_not_bill,
397
402
  Dodopayments::ProductCollection::ProrationBillingModeOnUpgrade::TaggedSymbol
398
403
  )
404
+ PRORATED_IMMEDIATELY_KEEP_CYCLE =
405
+ T.let(
406
+ :prorated_immediately_keep_cycle,
407
+ Dodopayments::ProductCollection::ProrationBillingModeOnUpgrade::TaggedSymbol
408
+ )
399
409
 
400
410
  sig do
401
411
  override.returns(
@@ -330,6 +330,11 @@ module Dodopayments
330
330
  :do_not_bill,
331
331
  Dodopayments::ProductCollectionCreateParams::ProrationBillingModeOnDowngrade::TaggedSymbol
332
332
  )
333
+ PRORATED_IMMEDIATELY_KEEP_CYCLE =
334
+ T.let(
335
+ :prorated_immediately_keep_cycle,
336
+ Dodopayments::ProductCollectionCreateParams::ProrationBillingModeOnDowngrade::TaggedSymbol
337
+ )
333
338
 
334
339
  sig do
335
340
  override.returns(
@@ -376,6 +381,11 @@ module Dodopayments
376
381
  :do_not_bill,
377
382
  Dodopayments::ProductCollectionCreateParams::ProrationBillingModeOnUpgrade::TaggedSymbol
378
383
  )
384
+ PRORATED_IMMEDIATELY_KEEP_CYCLE =
385
+ T.let(
386
+ :prorated_immediately_keep_cycle,
387
+ Dodopayments::ProductCollectionCreateParams::ProrationBillingModeOnUpgrade::TaggedSymbol
388
+ )
379
389
 
380
390
  sig do
381
391
  override.returns(
@@ -332,6 +332,11 @@ module Dodopayments
332
332
  :do_not_bill,
333
333
  Dodopayments::ProductCollectionUpdateParams::ProrationBillingModeOnDowngrade::TaggedSymbol
334
334
  )
335
+ PRORATED_IMMEDIATELY_KEEP_CYCLE =
336
+ T.let(
337
+ :prorated_immediately_keep_cycle,
338
+ Dodopayments::ProductCollectionUpdateParams::ProrationBillingModeOnDowngrade::TaggedSymbol
339
+ )
335
340
 
336
341
  sig do
337
342
  override.returns(
@@ -378,6 +383,11 @@ module Dodopayments
378
383
  :do_not_bill,
379
384
  Dodopayments::ProductCollectionUpdateParams::ProrationBillingModeOnUpgrade::TaggedSymbol
380
385
  )
386
+ PRORATED_IMMEDIATELY_KEEP_CYCLE =
387
+ T.let(
388
+ :prorated_immediately_keep_cycle,
389
+ Dodopayments::ProductCollectionUpdateParams::ProrationBillingModeOnUpgrade::TaggedSymbol
390
+ )
381
391
 
382
392
  sig do
383
393
  override.returns(
@@ -71,6 +71,12 @@ module Dodopayments
71
71
  end
72
72
  attr_accessor :network_reference_type
73
73
 
74
+ # The time in UTC when `network_reference` became available. It is null when the
75
+ # reference is not available, or when it became available before this field
76
+ # existed.
77
+ sig { returns(T.nilable(Time)) }
78
+ attr_accessor :network_reference_updated_at
79
+
74
80
  # The reason provided for the refund, if any. Optional.
75
81
  sig { returns(T.nilable(String)) }
76
82
  attr_accessor :reason
@@ -91,6 +97,7 @@ module Dodopayments
91
97
  network_reference: T.nilable(String),
92
98
  network_reference_type:
93
99
  T.nilable(Dodopayments::RefundNetworkReferenceType::OrSymbol),
100
+ network_reference_updated_at: T.nilable(Time),
94
101
  reason: T.nilable(String)
95
102
  ).returns(T.attached_class)
96
103
  end
@@ -123,6 +130,10 @@ module Dodopayments
123
130
  network_reference: nil,
124
131
  # The kind of `network_reference`: ARN, STAN or RRN.
125
132
  network_reference_type: nil,
133
+ # The time in UTC when `network_reference` became available. It is null when the
134
+ # reference is not available, or when it became available before this field
135
+ # existed.
136
+ network_reference_updated_at: nil,
126
137
  # The reason provided for the refund, if any. Optional.
127
138
  reason: nil
128
139
  )
@@ -145,6 +156,7 @@ module Dodopayments
145
156
  network_reference: T.nilable(String),
146
157
  network_reference_type:
147
158
  T.nilable(Dodopayments::RefundNetworkReferenceType::TaggedSymbol),
159
+ network_reference_updated_at: T.nilable(Time),
148
160
  reason: T.nilable(String)
149
161
  }
150
162
  )
@@ -54,6 +54,12 @@ module Dodopayments
54
54
  end
55
55
  attr_accessor :network_reference_type
56
56
 
57
+ # The time in UTC when `network_reference` became available. It is null when the
58
+ # reference is not available, or when it became available before this field
59
+ # existed.
60
+ sig { returns(T.nilable(Time)) }
61
+ attr_accessor :network_reference_updated_at
62
+
57
63
  # The reason provided for the refund, if any. Optional.
58
64
  sig { returns(T.nilable(String)) }
59
65
  attr_accessor :reason
@@ -71,6 +77,7 @@ module Dodopayments
71
77
  network_reference: T.nilable(String),
72
78
  network_reference_type:
73
79
  T.nilable(Dodopayments::RefundNetworkReferenceType::OrSymbol),
80
+ network_reference_updated_at: T.nilable(Time),
74
81
  reason: T.nilable(String)
75
82
  ).returns(T.attached_class)
76
83
  end
@@ -97,6 +104,10 @@ module Dodopayments
97
104
  network_reference: nil,
98
105
  # The kind of `network_reference`: ARN, STAN or RRN.
99
106
  network_reference_type: nil,
107
+ # The time in UTC when `network_reference` became available. It is null when the
108
+ # reference is not available, or when it became available before this field
109
+ # existed.
110
+ network_reference_updated_at: nil,
100
111
  # The reason provided for the refund, if any. Optional.
101
112
  reason: nil
102
113
  )
@@ -116,6 +127,7 @@ module Dodopayments
116
127
  network_reference: T.nilable(String),
117
128
  network_reference_type:
118
129
  T.nilable(Dodopayments::RefundNetworkReferenceType::TaggedSymbol),
130
+ network_reference_updated_at: T.nilable(Time),
119
131
  reason: T.nilable(String)
120
132
  }
121
133
  )
@@ -88,10 +88,18 @@ module Dodopayments
88
88
  sig { returns(T.nilable(Time)) }
89
89
  attr_accessor :past_due_ends_at
90
90
 
91
+ # Identifier of the payment that caused this event. It is set only for
92
+ # `subscription.renewed`. It is null for all other subscription events.
93
+ sig { returns(T.nilable(String)) }
94
+ attr_accessor :payment_id
95
+
91
96
  # Subscription payload sent on a webhook. It carries every field of
92
97
  # `SubscriptionResponse`, plus the grace-period deadline.
93
98
  sig do
94
- params(past_due_ends_at: T.nilable(Time)).returns(T.attached_class)
99
+ params(
100
+ past_due_ends_at: T.nilable(Time),
101
+ payment_id: T.nilable(String)
102
+ ).returns(T.attached_class)
95
103
  end
96
104
  def self.new(
97
105
  # Time when the grace period ends. The subscription moves to `on_hold` or to
@@ -101,11 +109,18 @@ module Dodopayments
101
109
  # row snapshot that produced `status`. It is set whenever the subscription sits in
102
110
  # a window at that moment. A delayed event of another type therefore carries the
103
111
  # deadline too, next to a `past_due` status.
104
- past_due_ends_at: nil
112
+ past_due_ends_at: nil,
113
+ # Identifier of the payment that caused this event. It is set only for
114
+ # `subscription.renewed`. It is null for all other subscription events.
115
+ payment_id: nil
105
116
  )
106
117
  end
107
118
 
108
- sig { override.returns({ past_due_ends_at: T.nilable(Time) }) }
119
+ sig do
120
+ override.returns(
121
+ { past_due_ends_at: T.nilable(Time), payment_id: T.nilable(String) }
122
+ )
123
+ end
109
124
  def to_hash
110
125
  end
111
126
  end
@@ -88,10 +88,18 @@ module Dodopayments
88
88
  sig { returns(T.nilable(Time)) }
89
89
  attr_accessor :past_due_ends_at
90
90
 
91
+ # Identifier of the payment that caused this event. It is set only for
92
+ # `subscription.renewed`. It is null for all other subscription events.
93
+ sig { returns(T.nilable(String)) }
94
+ attr_accessor :payment_id
95
+
91
96
  # Subscription payload sent on a webhook. It carries every field of
92
97
  # `SubscriptionResponse`, plus the grace-period deadline.
93
98
  sig do
94
- params(past_due_ends_at: T.nilable(Time)).returns(T.attached_class)
99
+ params(
100
+ past_due_ends_at: T.nilable(Time),
101
+ payment_id: T.nilable(String)
102
+ ).returns(T.attached_class)
95
103
  end
96
104
  def self.new(
97
105
  # Time when the grace period ends. The subscription moves to `on_hold` or to
@@ -101,11 +109,18 @@ module Dodopayments
101
109
  # row snapshot that produced `status`. It is set whenever the subscription sits in
102
110
  # a window at that moment. A delayed event of another type therefore carries the
103
111
  # deadline too, next to a `past_due` status.
104
- past_due_ends_at: nil
112
+ past_due_ends_at: nil,
113
+ # Identifier of the payment that caused this event. It is set only for
114
+ # `subscription.renewed`. It is null for all other subscription events.
115
+ payment_id: nil
105
116
  )
106
117
  end
107
118
 
108
- sig { override.returns({ past_due_ends_at: T.nilable(Time) }) }
119
+ sig do
120
+ override.returns(
121
+ { past_due_ends_at: T.nilable(Time), payment_id: T.nilable(String) }
122
+ )
123
+ end
109
124
  def to_hash
110
125
  end
111
126
  end
@@ -88,10 +88,18 @@ module Dodopayments
88
88
  sig { returns(T.nilable(Time)) }
89
89
  attr_accessor :past_due_ends_at
90
90
 
91
+ # Identifier of the payment that caused this event. It is set only for
92
+ # `subscription.renewed`. It is null for all other subscription events.
93
+ sig { returns(T.nilable(String)) }
94
+ attr_accessor :payment_id
95
+
91
96
  # Subscription payload sent on a webhook. It carries every field of
92
97
  # `SubscriptionResponse`, plus the grace-period deadline.
93
98
  sig do
94
- params(past_due_ends_at: T.nilable(Time)).returns(T.attached_class)
99
+ params(
100
+ past_due_ends_at: T.nilable(Time),
101
+ payment_id: T.nilable(String)
102
+ ).returns(T.attached_class)
95
103
  end
96
104
  def self.new(
97
105
  # Time when the grace period ends. The subscription moves to `on_hold` or to
@@ -101,11 +109,18 @@ module Dodopayments
101
109
  # row snapshot that produced `status`. It is set whenever the subscription sits in
102
110
  # a window at that moment. A delayed event of another type therefore carries the
103
111
  # deadline too, next to a `past_due` status.
104
- past_due_ends_at: nil
112
+ past_due_ends_at: nil,
113
+ # Identifier of the payment that caused this event. It is set only for
114
+ # `subscription.renewed`. It is null for all other subscription events.
115
+ payment_id: nil
105
116
  )
106
117
  end
107
118
 
108
- sig { override.returns({ past_due_ends_at: T.nilable(Time) }) }
119
+ sig do
120
+ override.returns(
121
+ { past_due_ends_at: T.nilable(Time), payment_id: T.nilable(String) }
122
+ )
123
+ end
109
124
  def to_hash
110
125
  end
111
126
  end