dodopayments 2.32.1 → 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 (87) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/internal/cursor_page_pagination.rb +1 -1
  5. data/lib/dodopayments/models/balance_ledger_entry.rb +3 -0
  6. data/lib/dodopayments/models/balance_retrieve_ledger_params.rb +3 -0
  7. data/lib/dodopayments/models/checkout_session_flags.rb +3 -0
  8. data/lib/dodopayments/models/manual_retry_state.rb +27 -1
  9. data/lib/dodopayments/models/payment.rb +14 -1
  10. data/lib/dodopayments/models/payment_list_response.rb +33 -1
  11. data/lib/dodopayments/models/product_collection.rb +2 -0
  12. data/lib/dodopayments/models/product_collection_create_params.rb +2 -0
  13. data/lib/dodopayments/models/product_collection_update_params.rb +2 -0
  14. data/lib/dodopayments/models/refund.rb +11 -1
  15. data/lib/dodopayments/models/refund_list_item.rb +11 -1
  16. data/lib/dodopayments/models/subscription_active_webhook_event.rb +10 -1
  17. data/lib/dodopayments/models/subscription_cancelled_webhook_event.rb +10 -1
  18. data/lib/dodopayments/models/subscription_expired_webhook_event.rb +10 -1
  19. data/lib/dodopayments/models/subscription_failed_webhook_event.rb +10 -1
  20. data/lib/dodopayments/models/subscription_on_hold_webhook_event.rb +10 -1
  21. data/lib/dodopayments/models/subscription_past_due_webhook_event.rb +10 -1
  22. data/lib/dodopayments/models/subscription_paused_webhook_event.rb +10 -1
  23. data/lib/dodopayments/models/subscription_plan_changed_webhook_event.rb +10 -1
  24. data/lib/dodopayments/models/subscription_renewed_webhook_event.rb +10 -1
  25. data/lib/dodopayments/models/subscription_service_period.rb +39 -0
  26. data/lib/dodopayments/models/subscription_unpaused_webhook_event.rb +10 -1
  27. data/lib/dodopayments/models/subscription_update_payment_method_webhook_event.rb +10 -1
  28. data/lib/dodopayments/models/subscription_updated_webhook_event.rb +10 -1
  29. data/lib/dodopayments/models/update_subscription_plan_req.rb +1 -0
  30. data/lib/dodopayments/models/webhook_payload.rb +10 -1
  31. data/lib/dodopayments/models.rb +2 -0
  32. data/lib/dodopayments/version.rb +1 -1
  33. data/lib/dodopayments.rb +1 -0
  34. data/rbi/dodopayments/models/balance_ledger_entry.rbi +15 -0
  35. data/rbi/dodopayments/models/balance_retrieve_ledger_params.rbi +15 -0
  36. data/rbi/dodopayments/models/checkout_session_flags.rbi +6 -0
  37. data/rbi/dodopayments/models/manual_retry_state.rbi +28 -0
  38. data/rbi/dodopayments/models/payment.rbi +17 -0
  39. data/rbi/dodopayments/models/payment_list_response.rbi +39 -0
  40. data/rbi/dodopayments/models/product_collection.rbi +10 -0
  41. data/rbi/dodopayments/models/product_collection_create_params.rbi +10 -0
  42. data/rbi/dodopayments/models/product_collection_update_params.rbi +10 -0
  43. data/rbi/dodopayments/models/refund.rbi +12 -0
  44. data/rbi/dodopayments/models/refund_list_item.rbi +12 -0
  45. data/rbi/dodopayments/models/subscription_active_webhook_event.rbi +18 -3
  46. data/rbi/dodopayments/models/subscription_cancelled_webhook_event.rbi +18 -3
  47. data/rbi/dodopayments/models/subscription_expired_webhook_event.rbi +18 -3
  48. data/rbi/dodopayments/models/subscription_failed_webhook_event.rbi +18 -3
  49. data/rbi/dodopayments/models/subscription_on_hold_webhook_event.rbi +18 -3
  50. data/rbi/dodopayments/models/subscription_past_due_webhook_event.rbi +18 -3
  51. data/rbi/dodopayments/models/subscription_paused_webhook_event.rbi +18 -3
  52. data/rbi/dodopayments/models/subscription_plan_changed_webhook_event.rbi +18 -3
  53. data/rbi/dodopayments/models/subscription_renewed_webhook_event.rbi +18 -3
  54. data/rbi/dodopayments/models/subscription_service_period.rbi +55 -0
  55. data/rbi/dodopayments/models/subscription_unpaused_webhook_event.rbi +18 -3
  56. data/rbi/dodopayments/models/subscription_update_payment_method_webhook_event.rbi +18 -3
  57. data/rbi/dodopayments/models/subscription_updated_webhook_event.rbi +18 -3
  58. data/rbi/dodopayments/models/update_subscription_plan_req.rbi +5 -0
  59. data/rbi/dodopayments/models/webhook_payload.rbi +14 -1
  60. data/rbi/dodopayments/models.rbi +2 -0
  61. data/sig/dodopayments/models/balance_ledger_entry.rbs +6 -0
  62. data/sig/dodopayments/models/balance_retrieve_ledger_params.rbs +6 -0
  63. data/sig/dodopayments/models/manual_retry_state.rbs +15 -0
  64. data/sig/dodopayments/models/payment.rbs +5 -0
  65. data/sig/dodopayments/models/payment_list_response.rbs +15 -0
  66. data/sig/dodopayments/models/product_collection.rbs +4 -0
  67. data/sig/dodopayments/models/product_collection_create_params.rbs +4 -0
  68. data/sig/dodopayments/models/product_collection_update_params.rbs +4 -0
  69. data/sig/dodopayments/models/refund.rbs +5 -0
  70. data/sig/dodopayments/models/refund_list_item.rbs +5 -0
  71. data/sig/dodopayments/models/subscription_active_webhook_event.rbs +7 -3
  72. data/sig/dodopayments/models/subscription_cancelled_webhook_event.rbs +7 -3
  73. data/sig/dodopayments/models/subscription_expired_webhook_event.rbs +7 -3
  74. data/sig/dodopayments/models/subscription_failed_webhook_event.rbs +7 -3
  75. data/sig/dodopayments/models/subscription_on_hold_webhook_event.rbs +7 -3
  76. data/sig/dodopayments/models/subscription_past_due_webhook_event.rbs +7 -3
  77. data/sig/dodopayments/models/subscription_paused_webhook_event.rbs +7 -3
  78. data/sig/dodopayments/models/subscription_plan_changed_webhook_event.rbs +7 -3
  79. data/sig/dodopayments/models/subscription_renewed_webhook_event.rbs +7 -3
  80. data/sig/dodopayments/models/subscription_service_period.rbs +26 -0
  81. data/sig/dodopayments/models/subscription_unpaused_webhook_event.rbs +7 -3
  82. data/sig/dodopayments/models/subscription_update_payment_method_webhook_event.rbs +7 -3
  83. data/sig/dodopayments/models/subscription_updated_webhook_event.rbs +7 -3
  84. data/sig/dodopayments/models/update_subscription_plan_req.rbs +2 -0
  85. data/sig/dodopayments/models/webhook_payload.rbs +12 -2
  86. data/sig/dodopayments/models.rbs +2 -0
  87. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef1be38d6c9556b1c146575b34a4f4d8ad2db18b190d918cb191d84d39b64fa1
4
- data.tar.gz: c4cbac2db3c1b11b4c6abb932fee6040c70ef3b9be1e336636f605814eb69a51
3
+ metadata.gz: 27eda33527f7fc36507b133919bcf76f5bfe1d537e875e0ed762c3b3fd5aad53
4
+ data.tar.gz: 904efd6de1bbdc9e54a65483709a8d9d3c7f0b4496011d46e9f69bb753e26083
5
5
  SHA512:
6
- metadata.gz: baafc8d5785e2698aba3a7901c04b4120f49ea95b277da059eaf26e48d663ddc54709ad87bc7cf73066171b79838fc5630ef034baa0bd918b257366ccabf05e0
7
- data.tar.gz: b82b6b4f3ec62d210363c1510be0f8d915f62fc93c4fbb1530f92cff26ec71cc61ee9b6a73268c952a1e1df870bcac749a6e4725b7f5097c19d86202b96fc1a8
6
+ metadata.gz: b4eb25c02f04ca12ea6b41f3b3d254d7afbdce14137dd5213b52994d172b227ec5a87db193a6ed4c0330fcda867f79e522a1b0f74ebc6e6a8e23d81dc2615bab
7
+ data.tar.gz: f72f531842560027f90d5fc5ec789025487305ec95993829a79b704210803d81cb8a33c357cb09a79be7abef9e030673b325663a2d27b6427d78737ade894f0e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.33.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.32.2...v2.33.0) (2026-10-14)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** payment service periods, retry attempts and subscription renewal payment_id ([4fc54c1](https://github.com/dodopayments/dodopayments-ruby/commit/4fc54c154ba2b49a904249f27d30a7b5b7fb165d))
9
+ * **api:** payment service periods, retry attempts and subscription renewal payment_id ([53b94e3](https://github.com/dodopayments/dodopayments-ruby/commit/53b94e35bbff1d1882582852e58e9cc592ab1772))
10
+
11
+ ## [2.32.2](https://github.com/dodopayments/dodopayments-ruby/compare/v2.32.1...v2.32.2) (2026-10-09)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * **deps:** upgrade SDK toolchains (pnpm, uv, TypeScript 7, Gradle 9, okhttp 5, zod 4) and stop cursor pagination on done ([a5672d8](https://github.com/dodopayments/dodopayments-ruby/commit/a5672d8d65e5bc9d738fae31f708aae54984034a))
17
+ * **deps:** upgrade SDK toolchains (pnpm, uv, TypeScript 7, Gradle 9, okhttp 5, zod 4) and stop cursor pagination on done ([7e80b1c](https://github.com/dodopayments/dodopayments-ruby/commit/7e80b1c860b58e16d08c8d6b6bb5822199726ab2))
18
+
3
19
  ## [2.32.1](https://github.com/dodopayments/dodopayments-ruby/compare/v2.32.0...v2.32.1) (2026-10-09)
4
20
 
5
21
 
data/README.md CHANGED
@@ -23,7 +23,7 @@ To use this gem, install via Bundler by adding the following to your application
23
23
  <!-- x-release-please-start-version -->
24
24
 
25
25
  ```ruby
26
- gem "dodopayments", "~> 2.32.1"
26
+ gem "dodopayments", "~> 2.33.0"
27
27
  ```
28
28
 
29
29
  <!-- x-release-please-end -->
@@ -27,7 +27,7 @@ module Dodopayments
27
27
 
28
28
  # @return [Boolean]
29
29
  def next_page?
30
- !data.to_a.empty? && !iterator.to_s.empty?
30
+ (done != true) && !data.to_a.empty? && !iterator.to_s.empty?
31
31
  end
32
32
 
33
33
  # @raise [Dodopayments::HTTP::Error]
@@ -119,6 +119,9 @@ module Dodopayments
119
119
  RESERVE_HOLD = :reserve_hold
120
120
  RESERVE_RELEASE = :reserve_release
121
121
  MODERATION_FEES = :moderation_fees
122
+ DODO_FIXED_FEE = :dodo_fixed_fee
123
+ INTERCHANGE_FEE = :interchange_fee
124
+ SCHEME_FEE = :scheme_fee
122
125
 
123
126
  # @!method self.values
124
127
  # @return [Array<Symbol>]
@@ -266,6 +266,9 @@ module Dodopayments
266
266
  RESERVE_HOLD = :reserve_hold
267
267
  RESERVE_RELEASE = :reserve_release
268
268
  MODERATION_FEES = :moderation_fees
269
+ DODO_FIXED_FEE = :dodo_fixed_fee
270
+ INTERCHANGE_FEE = :interchange_fee
271
+ SCHEME_FEE = :scheme_fee
269
272
 
270
273
  # @!method self.values
271
274
  # @return [Array<Symbol>]
@@ -66,6 +66,9 @@ module Dodopayments
66
66
  # @!attribute allow_discount_code
67
67
  # If the customer is allowed to apply discount code, set it to true.
68
68
  #
69
+ # If this flag is false, the customer cannot change the discount codes. The
70
+ # discount codes that you give when you create the session still apply.
71
+ #
69
72
  # Default is true
70
73
  #
71
74
  # @return [Boolean, nil]
@@ -19,6 +19,26 @@ module Dodopayments
19
19
  # @return [Integer]
20
20
  required :sends_used, Integer
21
21
 
22
+ # @!attribute automatic_retry_number
23
+ # The number of the queued automatic retry, starting at 1.
24
+ #
25
+ # @return [Integer, nil]
26
+ optional :automatic_retry_number, Integer, nil?: true
27
+
28
+ # @!attribute automatic_retry_total
29
+ # The number of automatic retries that the current configuration plans for this
30
+ # invoice. It is never less than `automatic_retry_number`.
31
+ #
32
+ # @return [Integer, nil]
33
+ optional :automatic_retry_total, Integer, nil?: true
34
+
35
+ # @!attribute next_automatic_retry_at
36
+ # When the next automatic retry on this invoice is scheduled. Null when no
37
+ # automatic retry is queued or automatic retries are disabled.
38
+ #
39
+ # @return [Time, nil]
40
+ optional :next_automatic_retry_at, Time, nil?: true
41
+
22
42
  # @!attribute reason
23
43
  # The code `POST` would fail with. Null when `can_retry` is true.
24
44
  #
@@ -32,7 +52,7 @@ module Dodopayments
32
52
  # @return [Time, nil]
33
53
  optional :retry_available_at, Time, nil?: true
34
54
 
35
- # @!method initialize(can_retry:, sends_allowed:, sends_used:, reason: nil, retry_available_at: nil)
55
+ # @!method initialize(can_retry:, sends_allowed:, sends_used:, automatic_retry_number: nil, automatic_retry_total: nil, next_automatic_retry_at: nil, reason: nil, retry_available_at: nil)
36
56
  # Some parameter documentations has been truncated, see
37
57
  # {Dodopayments::Models::ManualRetryState} for more details.
38
58
  #
@@ -42,6 +62,12 @@ module Dodopayments
42
62
  #
43
63
  # @param sends_used [Integer]
44
64
  #
65
+ # @param automatic_retry_number [Integer, nil] The number of the queued automatic retry, starting at 1.
66
+ #
67
+ # @param automatic_retry_total [Integer, nil] The number of automatic retries that the current configuration plans for
68
+ #
69
+ # @param next_automatic_retry_at [Time, nil] When the next automatic retry on this invoice is scheduled. Null when no
70
+ #
45
71
  # @param reason [String, nil] The code `POST` would fail with. Null when `can_retry` is true.
46
72
  #
47
73
  # @param retry_available_at [Time, nil] When the next send becomes available. Null when no send is left, or when
@@ -100,6 +100,17 @@ module Dodopayments
100
100
  # @return [Integer]
101
101
  required :retry_attempt, Integer
102
102
 
103
+ # @!attribute service_periods
104
+ # The service period of each subscription that this payment pays for. The order is
105
+ # the same as `subscription_ids`. For a plan change charge, the period starts at
106
+ # the plan change and ends at the next billing date. The list is empty unless the
107
+ # payment status is `succeeded`. The list is also empty for a one-time payment, an
108
+ # on-demand charge, or a payment method update.
109
+ #
110
+ # @return [Array<Dodopayments::Models::SubscriptionServicePeriod>]
111
+ required :service_periods,
112
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::SubscriptionServicePeriod] }
113
+
103
114
  # @!attribute settlement_amount
104
115
  # The amount that will be credited to your Dodo balance after currency conversion
105
116
  # and processing. Especially relevant for adaptive pricing where the customer's
@@ -293,7 +304,7 @@ module Dodopayments
293
304
  # @return [Time, nil]
294
305
  optional :updated_at, Time, nil?: true
295
306
 
296
- # @!method initialize(billing:, brand_id:, business_id:, created_at:, currency:, customer:, digital_products_delivered:, disputes:, is_multi_subscription:, is_update_payment_method:, metadata:, payment_id:, payment_provider:, refunds:, retry_attempt:, settlement_amount:, settlement_currency:, subscription_ids:, total_amount:, card_holder_name: nil, card_issuing_country: nil, card_last_four: nil, card_network: nil, card_type: nil, checkout_session_id: nil, custom_field_responses: nil, discount_id: nil, discounts: nil, error_code: nil, error_message: nil, invoice_id: nil, invoice_url: nil, payment_link: nil, payment_method: nil, payment_method_id: nil, payment_method_type: nil, product_cart: nil, refund_status: nil, settlement_tax: nil, status: nil, subscription_id: nil, tax: nil, updated_at: nil)
307
+ # @!method initialize(billing:, brand_id:, business_id:, created_at:, currency:, customer:, digital_products_delivered:, disputes:, is_multi_subscription:, is_update_payment_method:, metadata:, payment_id:, payment_provider:, refunds:, retry_attempt:, service_periods:, settlement_amount:, settlement_currency:, subscription_ids:, total_amount:, card_holder_name: nil, card_issuing_country: nil, card_last_four: nil, card_network: nil, card_type: nil, checkout_session_id: nil, custom_field_responses: nil, discount_id: nil, discounts: nil, error_code: nil, error_message: nil, invoice_id: nil, invoice_url: nil, payment_link: nil, payment_method: nil, payment_method_id: nil, payment_method_type: nil, product_cart: nil, refund_status: nil, settlement_tax: nil, status: nil, subscription_id: nil, tax: nil, updated_at: nil)
297
308
  # Some parameter documentations has been truncated, see
298
309
  # {Dodopayments::Models::Payment} for more details.
299
310
  #
@@ -327,6 +338,8 @@ module Dodopayments
327
338
  #
328
339
  # @param retry_attempt [Integer] Retry attempt number for subscription renewal payments.
329
340
  #
341
+ # @param service_periods [Array<Dodopayments::Models::SubscriptionServicePeriod>] The service period of each subscription that this payment pays for.
342
+ #
330
343
  # @param settlement_amount [Integer] The amount that will be credited to your Dodo balance after currency conversion
331
344
  #
332
345
  # @param settlement_currency [Symbol, Dodopayments::Models::Currency] The currency in which the settlement_amount will be credited to your Dodo balanc
@@ -60,6 +60,25 @@ module Dodopayments
60
60
  # @return [Symbol, Dodopayments::Models::PaymentListResponse::PaymentProvider]
61
61
  required :payment_provider, enum: -> { Dodopayments::Models::PaymentListResponse::PaymentProvider }
62
62
 
63
+ # @!attribute retry_attempt
64
+ # The retry attempt number of this payment. The value is `0` for the original
65
+ # payment. Each retry after a failed subscription renewal adds `1`. The value is
66
+ # always `0` for a payment that is not for a subscription.
67
+ #
68
+ # @return [Integer]
69
+ required :retry_attempt, Integer
70
+
71
+ # @!attribute service_periods
72
+ # The service period of each subscription that this payment pays for. The order is
73
+ # the same as `subscription_ids`. For a plan change charge, the period starts at
74
+ # the plan change and ends at the next billing date. The list is empty unless the
75
+ # payment status is `succeeded`. The list is also empty for a one-time payment, an
76
+ # on-demand charge, or a payment method update.
77
+ #
78
+ # @return [Array<Dodopayments::Models::SubscriptionServicePeriod>]
79
+ required :service_periods,
80
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::SubscriptionServicePeriod] }
81
+
63
82
  # @!attribute subscription_ids
64
83
  # Every subscription that this payment starts or charges, in a stable order. It is
65
84
  # empty for a one-time payment. It holds the value of `subscription_id` when the
@@ -85,6 +104,13 @@ module Dodopayments
85
104
  # @return [String, nil]
86
105
  optional :card_network, String, nil?: true
87
106
 
107
+ # @!attribute checkout_session_id
108
+ # The ID of the checkout session for this payment. The value is null when the
109
+ # payment does not use a checkout session.
110
+ #
111
+ # @return [String, nil]
112
+ optional :checkout_session_id, String, nil?: true
113
+
88
114
  # @!attribute dispute_status
89
115
  # The most recent dispute status for this payment. None if no disputes exist.
90
116
  #
@@ -130,7 +156,7 @@ module Dodopayments
130
156
  # @return [String, nil]
131
157
  optional :subscription_id, String, nil?: true
132
158
 
133
- # @!method initialize(brand_id:, created_at:, currency:, customer:, digital_products_delivered:, has_license_key:, is_multi_subscription:, metadata:, payment_id:, payment_provider:, subscription_ids:, total_amount:, card_last_four: nil, card_network: nil, dispute_status: nil, invoice_id: nil, invoice_url: nil, payment_method: nil, payment_method_type: nil, refund_status: nil, status: nil, subscription_id: nil)
159
+ # @!method initialize(brand_id:, created_at:, currency:, customer:, digital_products_delivered:, has_license_key:, is_multi_subscription:, metadata:, payment_id:, payment_provider:, retry_attempt:, service_periods:, subscription_ids:, total_amount:, card_last_four: nil, card_network: nil, checkout_session_id: nil, dispute_status: nil, invoice_id: nil, invoice_url: nil, payment_method: nil, payment_method_type: nil, refund_status: nil, status: nil, subscription_id: nil)
134
160
  # Some parameter documentations has been truncated, see
135
161
  # {Dodopayments::Models::PaymentListResponse} for more details.
136
162
  #
@@ -154,6 +180,10 @@ module Dodopayments
154
180
  #
155
181
  # @param payment_provider [Symbol, Dodopayments::Models::PaymentListResponse::PaymentProvider] Which processor handled this payment. `stripe` / `adyen` for BYOP routes
156
182
  #
183
+ # @param retry_attempt [Integer] The retry attempt number of this payment. The value is `0` for the original
184
+ #
185
+ # @param service_periods [Array<Dodopayments::Models::SubscriptionServicePeriod>] The service period of each subscription that this payment pays for.
186
+ #
157
187
  # @param subscription_ids [Array<String>] Every subscription that this payment starts or charges, in a stable order.
158
188
  #
159
189
  # @param total_amount [Integer]
@@ -162,6 +192,8 @@ module Dodopayments
162
192
  #
163
193
  # @param card_network [String, nil] Card network like VISA, MASTERCARD etc.
164
194
  #
195
+ # @param checkout_session_id [String, nil] The ID of the checkout session for this payment. The value is null when
196
+ #
165
197
  # @param dispute_status [Symbol, Dodopayments::Models::DisputeStatus, nil] The most recent dispute status for this payment. None if no disputes exist.
166
198
  #
167
199
  # @param invoice_id [String, nil] Invoice ID for this payment. Uses India-specific invoice ID if available.
@@ -179,6 +179,7 @@ module Dodopayments
179
179
  FULL_IMMEDIATELY = :full_immediately
180
180
  DIFFERENCE_IMMEDIATELY = :difference_immediately
181
181
  DO_NOT_BILL = :do_not_bill
182
+ PRORATED_IMMEDIATELY_KEEP_CYCLE = :prorated_immediately_keep_cycle
182
183
 
183
184
  # @!method self.values
184
185
  # @return [Array<Symbol>]
@@ -195,6 +196,7 @@ module Dodopayments
195
196
  FULL_IMMEDIATELY = :full_immediately
196
197
  DIFFERENCE_IMMEDIATELY = :difference_immediately
197
198
  DO_NOT_BILL = :do_not_bill
199
+ PRORATED_IMMEDIATELY_KEEP_CYCLE = :prorated_immediately_keep_cycle
198
200
 
199
201
  # @!method self.values
200
202
  # @return [Array<Symbol>]
@@ -146,6 +146,7 @@ module Dodopayments
146
146
  FULL_IMMEDIATELY = :full_immediately
147
147
  DIFFERENCE_IMMEDIATELY = :difference_immediately
148
148
  DO_NOT_BILL = :do_not_bill
149
+ PRORATED_IMMEDIATELY_KEEP_CYCLE = :prorated_immediately_keep_cycle
149
150
 
150
151
  # @!method self.values
151
152
  # @return [Array<Symbol>]
@@ -160,6 +161,7 @@ module Dodopayments
160
161
  FULL_IMMEDIATELY = :full_immediately
161
162
  DIFFERENCE_IMMEDIATELY = :difference_immediately
162
163
  DO_NOT_BILL = :do_not_bill
164
+ PRORATED_IMMEDIATELY_KEEP_CYCLE = :prorated_immediately_keep_cycle
163
165
 
164
166
  # @!method self.values
165
167
  # @return [Array<Symbol>]
@@ -160,6 +160,7 @@ module Dodopayments
160
160
  FULL_IMMEDIATELY = :full_immediately
161
161
  DIFFERENCE_IMMEDIATELY = :difference_immediately
162
162
  DO_NOT_BILL = :do_not_bill
163
+ PRORATED_IMMEDIATELY_KEEP_CYCLE = :prorated_immediately_keep_cycle
163
164
 
164
165
  # @!method self.values
165
166
  # @return [Array<Symbol>]
@@ -174,6 +175,7 @@ module Dodopayments
174
175
  FULL_IMMEDIATELY = :full_immediately
175
176
  DIFFERENCE_IMMEDIATELY = :difference_immediately
176
177
  DO_NOT_BILL = :do_not_bill
178
+ PRORATED_IMMEDIATELY_KEEP_CYCLE = :prorated_immediately_keep_cycle
177
179
 
178
180
  # @!method self.values
179
181
  # @return [Array<Symbol>]
@@ -84,13 +84,21 @@ module Dodopayments
84
84
  # @return [Symbol, Dodopayments::Models::RefundNetworkReferenceType, nil]
85
85
  optional :network_reference_type, enum: -> { Dodopayments::RefundNetworkReferenceType }, nil?: true
86
86
 
87
+ # @!attribute network_reference_updated_at
88
+ # The time in UTC when `network_reference` became available. It is null when the
89
+ # reference is not available, or when it became available before this field
90
+ # existed.
91
+ #
92
+ # @return [Time, nil]
93
+ optional :network_reference_updated_at, Time, nil?: true
94
+
87
95
  # @!attribute reason
88
96
  # The reason provided for the refund, if any. Optional.
89
97
  #
90
98
  # @return [String, nil]
91
99
  optional :reason, String, nil?: true
92
100
 
93
- # @!method initialize(brand_id:, business_id:, created_at:, customer:, is_partial:, metadata:, payment_id:, refund_id:, status:, amount: nil, currency: nil, network_reference: nil, network_reference_type: nil, reason: nil)
101
+ # @!method initialize(brand_id:, business_id:, created_at:, customer:, is_partial:, metadata:, payment_id:, refund_id:, status:, amount: nil, currency: nil, network_reference: nil, network_reference_type: nil, network_reference_updated_at: nil, reason: nil)
94
102
  # Some parameter documentations has been truncated, see
95
103
  # {Dodopayments::Models::Refund} for more details.
96
104
  #
@@ -120,6 +128,8 @@ module Dodopayments
120
128
  #
121
129
  # @param network_reference_type [Symbol, Dodopayments::Models::RefundNetworkReferenceType, nil] The kind of `network_reference`: ARN, STAN or RRN.
122
130
  #
131
+ # @param network_reference_updated_at [Time, nil] The time in UTC when `network_reference` became available. It is null when the
132
+ #
123
133
  # @param reason [String, nil] The reason provided for the refund, if any. Optional.
124
134
  end
125
135
  end
@@ -65,13 +65,21 @@ module Dodopayments
65
65
  # @return [Symbol, Dodopayments::Models::RefundNetworkReferenceType, nil]
66
66
  optional :network_reference_type, enum: -> { Dodopayments::RefundNetworkReferenceType }, nil?: true
67
67
 
68
+ # @!attribute network_reference_updated_at
69
+ # The time in UTC when `network_reference` became available. It is null when the
70
+ # reference is not available, or when it became available before this field
71
+ # existed.
72
+ #
73
+ # @return [Time, nil]
74
+ optional :network_reference_updated_at, Time, nil?: true
75
+
68
76
  # @!attribute reason
69
77
  # The reason provided for the refund, if any. Optional.
70
78
  #
71
79
  # @return [String, nil]
72
80
  optional :reason, String, nil?: true
73
81
 
74
- # @!method initialize(business_id:, created_at:, is_partial:, payment_id:, refund_id:, status:, amount: nil, currency: nil, network_reference: nil, network_reference_type: nil, reason: nil)
82
+ # @!method initialize(business_id:, created_at:, is_partial:, payment_id:, refund_id:, status:, amount: nil, currency: nil, network_reference: nil, network_reference_type: nil, network_reference_updated_at: nil, reason: nil)
75
83
  # Some parameter documentations has been truncated, see
76
84
  # {Dodopayments::Models::RefundListItem} for more details.
77
85
  #
@@ -95,6 +103,8 @@ module Dodopayments
95
103
  #
96
104
  # @param network_reference_type [Symbol, Dodopayments::Models::RefundNetworkReferenceType, nil] The kind of `network_reference`: ARN, STAN or RRN.
97
105
  #
106
+ # @param network_reference_updated_at [Time, nil] The time in UTC when `network_reference` became available. It is null when the
107
+ #
98
108
  # @param reason [String, nil] The reason provided for the refund, if any. Optional.
99
109
  end
100
110
  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::SubscriptionActiveWebhookEvent::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
@@ -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::SubscriptionCancelledWebhookEvent::Data} for more
60
67
  # details.
@@ -63,6 +70,8 @@ module Dodopayments
63
70
  # `SubscriptionResponse`, plus the grace-period deadline.
64
71
  #
65
72
  # @param past_due_ends_at [Time, nil] Time when the grace period ends. The subscription moves to `on_hold` or
73
+ #
74
+ # @param payment_id [String, nil] Identifier of the payment that caused this event.
66
75
  end
67
76
  end
68
77
  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::SubscriptionExpiredWebhookEvent::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
@@ -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::SubscriptionFailedWebhookEvent::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
@@ -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::SubscriptionOnHoldWebhookEvent::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
@@ -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::SubscriptionPastDueWebhookEvent::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
@@ -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::SubscriptionPausedWebhookEvent::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
@@ -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::SubscriptionPlanChangedWebhookEvent::Data} for more
60
67
  # details.
@@ -63,6 +70,8 @@ module Dodopayments
63
70
  # `SubscriptionResponse`, plus the grace-period deadline.
64
71
  #
65
72
  # @param past_due_ends_at [Time, nil] Time when the grace period ends. The subscription moves to `on_hold` or
73
+ #
74
+ # @param payment_id [String, nil] Identifier of the payment that caused this event.
66
75
  end
67
76
  end
68
77
  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::SubscriptionRenewedWebhookEvent::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
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ class SubscriptionServicePeriod < Dodopayments::Internal::Type::BaseModel
6
+ # @!attribute ends_at
7
+ # End of the service period.
8
+ #
9
+ # @return [Time]
10
+ required :ends_at, Time
11
+
12
+ # @!attribute starts_at
13
+ # Start of the service period. For a renewal, this is the billing date. For a plan
14
+ # change that applies at the next billing date, this is the time when the change
15
+ # applied. This time can be some minutes after the billing date.
16
+ #
17
+ # @return [Time]
18
+ required :starts_at, Time
19
+
20
+ # @!attribute subscription_id
21
+ # Identifier of the subscription.
22
+ #
23
+ # @return [String]
24
+ required :subscription_id, String
25
+
26
+ # @!method initialize(ends_at:, starts_at:, subscription_id:)
27
+ # Some parameter documentations has been truncated, see
28
+ # {Dodopayments::Models::SubscriptionServicePeriod} for more details.
29
+ #
30
+ # The service period that a payment pays for, for one subscription.
31
+ #
32
+ # @param ends_at [Time] End of the service period.
33
+ #
34
+ # @param starts_at [Time] Start of the service period. For a renewal, this is the billing date. For a
35
+ #
36
+ # @param subscription_id [String] Identifier of the subscription.
37
+ end
38
+ end
39
+ 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::SubscriptionUnpausedWebhookEvent::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