dodopayments 2.26.0 → 2.27.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 (150) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/client.rb +4 -0
  5. data/lib/dodopayments/models/balance_ledger_entry.rb +7 -1
  6. data/lib/dodopayments/models/blocklist/block_by_customer_id.rb +18 -0
  7. data/lib/dodopayments/models/blocklist/block_by_email.rb +18 -0
  8. data/lib/dodopayments/models/blocklist/block_identifier.rb +21 -0
  9. data/lib/dodopayments/models/blocklist/blocked_customer.rb +128 -0
  10. data/lib/dodopayments/models/blocklist/blocked_customer_source.rb +22 -0
  11. data/lib/dodopayments/models/blocklist/create_blocked_customer_request.rb +66 -0
  12. data/lib/dodopayments/models/blocklist/customer_create_params.rb +16 -0
  13. data/lib/dodopayments/models/blocklist/customer_delete_params.rb +22 -0
  14. data/lib/dodopayments/models/blocklist/customer_list_params.rb +64 -0
  15. data/lib/dodopayments/models/blocklist/customer_retrieve_params.rb +22 -0
  16. data/lib/dodopayments/models/blocklist/customers/blocked_customer_note.rb +44 -0
  17. data/lib/dodopayments/models/blocklist/customers/note_create_params.rb +24 -0
  18. data/lib/dodopayments/models/blocklist/customers/note_request.rb +19 -0
  19. data/lib/dodopayments/models/blocklist/customers/note_update_params.rb +30 -0
  20. data/lib/dodopayments/models/customer.rb +22 -1
  21. data/lib/dodopayments/models/dunning_recovered_webhook_event.rb +1 -0
  22. data/lib/dodopayments/models/dunning_started_webhook_event.rb +1 -0
  23. data/lib/dodopayments/models/manual_retry.rb +76 -0
  24. data/lib/dodopayments/models/manual_retry_state.rb +50 -0
  25. data/lib/dodopayments/models/payment_retrieve_retry_state_params.rb +20 -0
  26. data/lib/dodopayments/models/payment_retry_params.rb +20 -0
  27. data/lib/dodopayments/models/subscription_active_webhook_event.rb +32 -4
  28. data/lib/dodopayments/models/subscription_cancelled_webhook_event.rb +33 -4
  29. data/lib/dodopayments/models/subscription_expired_webhook_event.rb +32 -4
  30. data/lib/dodopayments/models/subscription_failed_webhook_event.rb +32 -4
  31. data/lib/dodopayments/models/subscription_list_params.rb +1 -0
  32. data/lib/dodopayments/models/subscription_on_hold_webhook_event.rb +32 -4
  33. data/lib/dodopayments/models/subscription_past_due_webhook_event.rb +68 -0
  34. data/lib/dodopayments/models/subscription_paused_webhook_event.rb +32 -4
  35. data/lib/dodopayments/models/subscription_plan_changed_webhook_event.rb +33 -4
  36. data/lib/dodopayments/models/subscription_renewed_webhook_event.rb +32 -4
  37. data/lib/dodopayments/models/subscription_status.rb +1 -0
  38. data/lib/dodopayments/models/subscription_unpaused_webhook_event.rb +32 -4
  39. data/lib/dodopayments/models/subscription_update_params.rb +1 -0
  40. data/lib/dodopayments/models/subscription_update_payment_method_webhook_event.rb +34 -4
  41. data/lib/dodopayments/models/subscription_updated_webhook_event.rb +32 -4
  42. data/lib/dodopayments/models/unsafe_unwrap_webhook_event.rb +3 -1
  43. data/lib/dodopayments/models/unwrap_webhook_event.rb +3 -1
  44. data/lib/dodopayments/models/webhook_event_type.rb +1 -0
  45. data/lib/dodopayments/models/webhook_payload.rb +19 -1
  46. data/lib/dodopayments/models.rb +12 -0
  47. data/lib/dodopayments/resources/blocklist/customers/notes.rb +68 -0
  48. data/lib/dodopayments/resources/blocklist/customers.rb +107 -0
  49. data/lib/dodopayments/resources/blocklist.rb +18 -0
  50. data/lib/dodopayments/resources/payments.rb +36 -0
  51. data/lib/dodopayments/resources/webhooks.rb +2 -2
  52. data/lib/dodopayments/version.rb +1 -1
  53. data/lib/dodopayments.rb +23 -1
  54. data/rbi/dodopayments/client.rbi +3 -0
  55. data/rbi/dodopayments/models/balance_ledger_entry.rbi +6 -0
  56. data/rbi/dodopayments/models/blocklist/block_by_customer_id.rbi +32 -0
  57. data/rbi/dodopayments/models/blocklist/block_by_email.rbi +32 -0
  58. data/rbi/dodopayments/models/blocklist/block_identifier.rbi +30 -0
  59. data/rbi/dodopayments/models/blocklist/blocked_customer.rbi +161 -0
  60. data/rbi/dodopayments/models/blocklist/blocked_customer_source.rbi +55 -0
  61. data/rbi/dodopayments/models/blocklist/create_blocked_customer_request.rbi +143 -0
  62. data/rbi/dodopayments/models/blocklist/customer_create_params.rbi +34 -0
  63. data/rbi/dodopayments/models/blocklist/customer_delete_params.rbi +40 -0
  64. data/rbi/dodopayments/models/blocklist/customer_list_params.rbi +88 -0
  65. data/rbi/dodopayments/models/blocklist/customer_retrieve_params.rbi +40 -0
  66. data/rbi/dodopayments/models/blocklist/customers/blocked_customer_note.rbi +66 -0
  67. data/rbi/dodopayments/models/blocklist/customers/note_create_params.rbi +45 -0
  68. data/rbi/dodopayments/models/blocklist/customers/note_request.rbi +30 -0
  69. data/rbi/dodopayments/models/blocklist/customers/note_update_params.rbi +50 -0
  70. data/rbi/dodopayments/models/customer.rbi +20 -0
  71. data/rbi/dodopayments/models/dunning_recovered_webhook_event.rbi +5 -0
  72. data/rbi/dodopayments/models/dunning_started_webhook_event.rbi +5 -0
  73. data/rbi/dodopayments/models/manual_retry.rbi +93 -0
  74. data/rbi/dodopayments/models/manual_retry_state.rbi +65 -0
  75. data/rbi/dodopayments/models/payment_retrieve_retry_state_params.rbi +38 -0
  76. data/rbi/dodopayments/models/payment_retry_params.rbi +38 -0
  77. data/rbi/dodopayments/models/subscription_active_webhook_event.rbi +53 -6
  78. data/rbi/dodopayments/models/subscription_cancelled_webhook_event.rbi +53 -6
  79. data/rbi/dodopayments/models/subscription_expired_webhook_event.rbi +53 -6
  80. data/rbi/dodopayments/models/subscription_failed_webhook_event.rbi +53 -6
  81. data/rbi/dodopayments/models/subscription_list_params.rbi +5 -0
  82. data/rbi/dodopayments/models/subscription_on_hold_webhook_event.rbi +53 -6
  83. data/rbi/dodopayments/models/subscription_past_due_webhook_event.rbi +114 -0
  84. data/rbi/dodopayments/models/subscription_paused_webhook_event.rbi +53 -6
  85. data/rbi/dodopayments/models/subscription_plan_changed_webhook_event.rbi +53 -6
  86. data/rbi/dodopayments/models/subscription_renewed_webhook_event.rbi +53 -6
  87. data/rbi/dodopayments/models/subscription_status.rbi +2 -0
  88. data/rbi/dodopayments/models/subscription_unpaused_webhook_event.rbi +53 -6
  89. data/rbi/dodopayments/models/subscription_update_params.rbi +5 -0
  90. data/rbi/dodopayments/models/subscription_update_payment_method_webhook_event.rbi +58 -6
  91. data/rbi/dodopayments/models/subscription_updated_webhook_event.rbi +53 -6
  92. data/rbi/dodopayments/models/unsafe_unwrap_webhook_event.rbi +1 -0
  93. data/rbi/dodopayments/models/unwrap_webhook_event.rbi +1 -0
  94. data/rbi/dodopayments/models/webhook_event_type.rbi +5 -0
  95. data/rbi/dodopayments/models/webhook_payload.rbi +37 -3
  96. data/rbi/dodopayments/models.rbi +14 -0
  97. data/rbi/dodopayments/resources/blocklist/customers/notes.rbi +50 -0
  98. data/rbi/dodopayments/resources/blocklist/customers.rbi +88 -0
  99. data/rbi/dodopayments/resources/blocklist.rbi +15 -0
  100. data/rbi/dodopayments/resources/payments.rbi +26 -0
  101. data/rbi/dodopayments/resources/webhooks.rbi +2 -0
  102. data/sig/dodopayments/client.rbs +2 -0
  103. data/sig/dodopayments/models/balance_ledger_entry.rbs +5 -0
  104. data/sig/dodopayments/models/blocklist/block_by_customer_id.rbs +15 -0
  105. data/sig/dodopayments/models/blocklist/block_by_email.rbs +15 -0
  106. data/sig/dodopayments/models/blocklist/block_identifier.rbs +15 -0
  107. data/sig/dodopayments/models/blocklist/blocked_customer.rbs +87 -0
  108. data/sig/dodopayments/models/blocklist/blocked_customer_source.rbs +20 -0
  109. data/sig/dodopayments/models/blocklist/create_blocked_customer_request.rbs +71 -0
  110. data/sig/dodopayments/models/blocklist/customer_create_params.rbs +17 -0
  111. data/sig/dodopayments/models/blocklist/customer_delete_params.rbs +25 -0
  112. data/sig/dodopayments/models/blocklist/customer_list_params.rbs +53 -0
  113. data/sig/dodopayments/models/blocklist/customer_retrieve_params.rbs +25 -0
  114. data/sig/dodopayments/models/blocklist/customers/blocked_customer_note.rbs +44 -0
  115. data/sig/dodopayments/models/blocklist/customers/note_create_params.rbs +30 -0
  116. data/sig/dodopayments/models/blocklist/customers/note_request.rbs +17 -0
  117. data/sig/dodopayments/models/blocklist/customers/note_update_params.rbs +36 -0
  118. data/sig/dodopayments/models/customer.rbs +10 -0
  119. data/sig/dodopayments/models/dunning_recovered_webhook_event.rbs +2 -1
  120. data/sig/dodopayments/models/dunning_started_webhook_event.rbs +2 -1
  121. data/sig/dodopayments/models/manual_retry.rbs +55 -0
  122. data/sig/dodopayments/models/manual_retry_state.rbs +40 -0
  123. data/sig/dodopayments/models/payment_retrieve_retry_state_params.rbs +23 -0
  124. data/sig/dodopayments/models/payment_retry_params.rbs +23 -0
  125. data/sig/dodopayments/models/subscription_active_webhook_event.rbs +16 -4
  126. data/sig/dodopayments/models/subscription_cancelled_webhook_event.rbs +16 -4
  127. data/sig/dodopayments/models/subscription_expired_webhook_event.rbs +16 -4
  128. data/sig/dodopayments/models/subscription_failed_webhook_event.rbs +16 -4
  129. data/sig/dodopayments/models/subscription_list_params.rbs +2 -0
  130. data/sig/dodopayments/models/subscription_on_hold_webhook_event.rbs +16 -4
  131. data/sig/dodopayments/models/subscription_past_due_webhook_event.rbs +47 -0
  132. data/sig/dodopayments/models/subscription_paused_webhook_event.rbs +16 -4
  133. data/sig/dodopayments/models/subscription_plan_changed_webhook_event.rbs +16 -4
  134. data/sig/dodopayments/models/subscription_renewed_webhook_event.rbs +16 -4
  135. data/sig/dodopayments/models/subscription_status.rbs +9 -1
  136. data/sig/dodopayments/models/subscription_unpaused_webhook_event.rbs +16 -4
  137. data/sig/dodopayments/models/subscription_update_params.rbs +2 -0
  138. data/sig/dodopayments/models/subscription_update_payment_method_webhook_event.rbs +16 -4
  139. data/sig/dodopayments/models/subscription_updated_webhook_event.rbs +16 -4
  140. data/sig/dodopayments/models/unsafe_unwrap_webhook_event.rbs +1 -0
  141. data/sig/dodopayments/models/unwrap_webhook_event.rbs +1 -0
  142. data/sig/dodopayments/models/webhook_event_type.rbs +2 -0
  143. data/sig/dodopayments/models/webhook_payload.rbs +16 -4
  144. data/sig/dodopayments/models.rbs +12 -0
  145. data/sig/dodopayments/resources/blocklist/customers/notes.rbs +24 -0
  146. data/sig/dodopayments/resources/blocklist/customers.rbs +36 -0
  147. data/sig/dodopayments/resources/blocklist.rbs +9 -0
  148. data/sig/dodopayments/resources/payments.rbs +10 -0
  149. data/sig/dodopayments/resources/webhooks.rbs +2 -0
  150. metadata +68 -2
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Payments#retry_
6
+ class ManualRetry < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute invoice_id
8
+ # The invoice the send charged.
9
+ #
10
+ # @return [String]
11
+ required :invoice_id, String
12
+
13
+ # @!attribute is_manual_retry
14
+ # Always true on this route. Tells the row apart from an automatic attempt.
15
+ #
16
+ # @return [Boolean]
17
+ required :is_manual_retry, Dodopayments::Internal::Type::Boolean
18
+
19
+ # @!attribute payment_id
20
+ # The payment row this send created.
21
+ #
22
+ # @return [String]
23
+ required :payment_id, String
24
+
25
+ # @!attribute retry_attempt
26
+ # Which attempt this send is, counting manual sends on the invoice.
27
+ #
28
+ # @return [Integer]
29
+ required :retry_attempt, Integer
30
+
31
+ # @!attribute sends_allowed
32
+ #
33
+ # @return [Integer]
34
+ required :sends_allowed, Integer
35
+
36
+ # @!attribute sends_used
37
+ # Manual sends spent on this invoice, including this one.
38
+ #
39
+ # @return [Integer]
40
+ required :sends_used, Integer
41
+
42
+ # @!attribute retry_available_at
43
+ # When the next send becomes available. Null when no send is left.
44
+ #
45
+ # @return [Time, nil]
46
+ optional :retry_available_at, Time, nil?: true
47
+
48
+ # @!attribute status
49
+ # Outcome of the charge. `processing` means the processor has not settled it yet,
50
+ # and the payment webhooks report the result.
51
+ #
52
+ # @return [Symbol, Dodopayments::Models::IntentStatus, nil]
53
+ optional :status, enum: -> { Dodopayments::IntentStatus }, nil?: true
54
+
55
+ # @!method initialize(invoice_id:, is_manual_retry:, payment_id:, retry_attempt:, sends_allowed:, sends_used:, retry_available_at: nil, status: nil)
56
+ # Some parameter documentations has been truncated, see
57
+ # {Dodopayments::Models::ManualRetry} for more details.
58
+ #
59
+ # @param invoice_id [String] The invoice the send charged.
60
+ #
61
+ # @param is_manual_retry [Boolean] Always true on this route. Tells the row apart from an automatic attempt.
62
+ #
63
+ # @param payment_id [String] The payment row this send created.
64
+ #
65
+ # @param retry_attempt [Integer] Which attempt this send is, counting manual sends on the invoice.
66
+ #
67
+ # @param sends_allowed [Integer]
68
+ #
69
+ # @param sends_used [Integer] Manual sends spent on this invoice, including this one.
70
+ #
71
+ # @param retry_available_at [Time, nil] When the next send becomes available. Null when no send is left.
72
+ #
73
+ # @param status [Symbol, Dodopayments::Models::IntentStatus, nil] Outcome of the charge. `processing` means the processor has not settled it
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Payments#retrieve_retry_state
6
+ class ManualRetryState < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute can_retry
8
+ #
9
+ # @return [Boolean]
10
+ required :can_retry, Dodopayments::Internal::Type::Boolean
11
+
12
+ # @!attribute sends_allowed
13
+ #
14
+ # @return [Integer]
15
+ required :sends_allowed, Integer
16
+
17
+ # @!attribute sends_used
18
+ #
19
+ # @return [Integer]
20
+ required :sends_used, Integer
21
+
22
+ # @!attribute reason
23
+ # The code `POST` would fail with. Null when `can_retry` is true.
24
+ #
25
+ # @return [String, nil]
26
+ optional :reason, String, nil?: true
27
+
28
+ # @!attribute retry_available_at
29
+ # When the next send becomes available. Null when no send is left, or when the
30
+ # block has nothing to do with the cooldown.
31
+ #
32
+ # @return [Time, nil]
33
+ optional :retry_available_at, Time, nil?: true
34
+
35
+ # @!method initialize(can_retry:, sends_allowed:, sends_used:, reason: nil, retry_available_at: nil)
36
+ # Some parameter documentations has been truncated, see
37
+ # {Dodopayments::Models::ManualRetryState} for more details.
38
+ #
39
+ # @param can_retry [Boolean]
40
+ #
41
+ # @param sends_allowed [Integer]
42
+ #
43
+ # @param sends_used [Integer]
44
+ #
45
+ # @param reason [String, nil] The code `POST` would fail with. Null when `can_retry` is true.
46
+ #
47
+ # @param retry_available_at [Time, nil] When the next send becomes available. Null when no send is left, or when
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Payments#retrieve_retry_state
6
+ class PaymentRetrieveRetryStateParams < 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
@@ -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
@@ -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
@@ -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>]
@@ -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
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ class SubscriptionPastDueWebhookEvent < Dodopayments::Internal::Type::BaseModel
6
+ # @!attribute business_id
7
+ # The business identifier
8
+ #
9
+ # @return [String]
10
+ required :business_id, String
11
+
12
+ # @!attribute data
13
+ # Subscription payload sent on a webhook. It carries every field of
14
+ # `SubscriptionResponse`, plus the grace-period deadline.
15
+ #
16
+ # @return [Dodopayments::Models::SubscriptionPastDueWebhookEvent::Data]
17
+ required :data, -> { Dodopayments::SubscriptionPastDueWebhookEvent::Data }
18
+
19
+ # @!attribute timestamp
20
+ # The timestamp of when the event occurred
21
+ #
22
+ # @return [Time]
23
+ required :timestamp, Time
24
+
25
+ # @!attribute type
26
+ # The event type
27
+ #
28
+ # @return [Symbol, :"subscription.past_due"]
29
+ required :type, const: :"subscription.past_due"
30
+
31
+ # @!method initialize(business_id:, data:, timestamp:, type: :"subscription.past_due")
32
+ # Some parameter documentations has been truncated, see
33
+ # {Dodopayments::Models::SubscriptionPastDueWebhookEvent} for more details.
34
+ #
35
+ # @param business_id [String] The business identifier
36
+ #
37
+ # @param data [Dodopayments::Models::SubscriptionPastDueWebhookEvent::Data] Subscription payload sent on a webhook. It carries every field of
38
+ #
39
+ # @param timestamp [Time] The timestamp of when the event occurred
40
+ #
41
+ # @param type [Symbol, :"subscription.past_due"] The event type
42
+
43
+ # @see Dodopayments::Models::SubscriptionPastDueWebhookEvent#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::SubscriptionPastDueWebhookEvent::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
66
+ end
67
+ end
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::SubscriptionPausedWebhookEvent::Data]
17
+ required :data, -> { Dodopayments::SubscriptionPausedWebhookEvent::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.paused"
29
30
 
30
31
  # @!method initialize(business_id:, data:, timestamp:, type: :"subscription.paused")
32
+ # Some parameter documentations has been truncated, see
33
+ # {Dodopayments::Models::SubscriptionPausedWebhookEvent} 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::SubscriptionPausedWebhookEvent::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.paused"] The event type
42
+
43
+ # @see Dodopayments::Models::SubscriptionPausedWebhookEvent#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::SubscriptionPausedWebhookEvent::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::SubscriptionPlanChangedWebhookEvent::Data]
17
+ required :data, -> { Dodopayments::SubscriptionPlanChangedWebhookEvent::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.plan_changed"
29
30
 
30
31
  # @!method initialize(business_id:, data:, timestamp:, type: :"subscription.plan_changed")
32
+ # Some parameter documentations has been truncated, see
33
+ # {Dodopayments::Models::SubscriptionPlanChangedWebhookEvent} 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::SubscriptionPlanChangedWebhookEvent::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.plan_changed"] The event type
42
+
43
+ # @see Dodopayments::Models::SubscriptionPlanChangedWebhookEvent#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::SubscriptionPlanChangedWebhookEvent::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