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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8b7cafc248338a4ade0c7286d952538e01a9bf5d37c8055a00334dcadf4f704
4
- data.tar.gz: f09302d55a6bb456e7be074623b1028461b3f2a06be0a473c20861ef5ee72009
3
+ metadata.gz: 61c6a925f218355a2aba34cb88fa3d7c8437ee680117a6680d391f910b84b0aa
4
+ data.tar.gz: 8c87f0e94b56fa287717e63ce036a7a446658614002b28661f2a210ff5cf9238
5
5
  SHA512:
6
- metadata.gz: e1eb4476c66201ce9fcc8f9c64604d33fa1f725f48f267683559a73657bf36f6a9572a8ae45290f3f0a92a2eb939e5fd30eecd7e6067d92d76196774cd24b3d5
7
- data.tar.gz: 1a5f5a769335be408661bd207290c2c54f0cc8a93f8df439566d7cc49b2b643b2a84319f933ba7892fb0bf0f17733f7ec899c5ce0e42b3dffb289dc1c5d28475
6
+ metadata.gz: 6d5fd0af281615885f02185d8e8f1d7aba85ff06ca74ee05983d1f314a4f4c8388940a44686ba22c0f15e213b79b4cbf815c4cd94398f5f6ea1e6cb6f6fbc15d
7
+ data.tar.gz: 64b8eea6e263ec017b549b68749504eeea4269f99e5867351af6ad1658186b9f07c4cc3075df247919e658569a4832d31765e0c41fc9525c71eee70b3b3c7c48
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.27.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.26.0...v2.27.0) (2026-09-01)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** add customer blocklist and manual payment retry ([05c0fdc](https://github.com/dodopayments/dodopayments-ruby/commit/05c0fdc1049a6e375c4c6091ea0142aa2f6ad2ca))
9
+ * **api:** add customer blocklist and manual payment retry ([3d61750](https://github.com/dodopayments/dodopayments-ruby/commit/3d6175004e3e30d39719c6c08fd541398a287487))
10
+
3
11
  ## [2.26.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.25.0...v2.26.0) (2026-08-24)
4
12
 
5
13
 
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.26.0"
26
+ gem "dodopayments", "~> 2.27.0"
27
27
  ```
28
28
 
29
29
  <!-- x-release-please-end -->
@@ -51,6 +51,9 @@ module Dodopayments
51
51
  # @return [Dodopayments::Resources::Customers]
52
52
  attr_reader :customers
53
53
 
54
+ # @return [Dodopayments::Resources::Blocklist]
55
+ attr_reader :blocklist
56
+
54
57
  # @return [Dodopayments::Resources::Refunds]
55
58
  attr_reader :refunds
56
59
 
@@ -183,6 +186,7 @@ module Dodopayments
183
186
  @license_keys = Dodopayments::Resources::LicenseKeys.new(client: self)
184
187
  @license_key_instances = Dodopayments::Resources::LicenseKeyInstances.new(client: self)
185
188
  @customers = Dodopayments::Resources::Customers.new(client: self)
189
+ @blocklist = Dodopayments::Resources::Blocklist.new(client: self)
186
190
  @refunds = Dodopayments::Resources::Refunds.new(client: self)
187
191
  @disputes = Dodopayments::Resources::Disputes.new(client: self)
188
192
  @payouts = Dodopayments::Resources::Payouts.new(client: self)
@@ -59,12 +59,17 @@ module Dodopayments
59
59
  # @return [String, nil]
60
60
  optional :description, String, nil?: true
61
61
 
62
+ # @!attribute payout_id
63
+ #
64
+ # @return [String, nil]
65
+ optional :payout_id, String, nil?: true
66
+
62
67
  # @!attribute reference_object_id
63
68
  #
64
69
  # @return [String, nil]
65
70
  optional :reference_object_id, String, nil?: true
66
71
 
67
- # @!method initialize(id:, amount:, business_id:, created_at:, currency:, event_type:, is_credit:, usd_equivalent_amount:, after_balance: nil, before_balance: nil, description: nil, reference_object_id: nil)
72
+ # @!method initialize(id:, amount:, business_id:, created_at:, currency:, event_type:, is_credit:, usd_equivalent_amount:, after_balance: nil, before_balance: nil, description: nil, payout_id: nil, reference_object_id: nil)
68
73
  # @param id [String]
69
74
  # @param amount [Integer]
70
75
  # @param business_id [String]
@@ -76,6 +81,7 @@ module Dodopayments
76
81
  # @param after_balance [Integer, nil]
77
82
  # @param before_balance [Integer, nil]
78
83
  # @param description [String, nil]
84
+ # @param payout_id [String, nil]
79
85
  # @param reference_object_id [String, nil]
80
86
 
81
87
  # @see Dodopayments::Models::BalanceLedgerEntry#event_type
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Blocklist
6
+ class BlockByCustomerID < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute customer_id
8
+ # Customer to block. The block still applies to that customer's email.
9
+ #
10
+ # @return [String]
11
+ required :customer_id, String
12
+
13
+ # @!method initialize(customer_id:)
14
+ # @param customer_id [String] Customer to block. The block still applies to that customer's email.
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Blocklist
6
+ class BlockByEmail < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute email
8
+ # Email to block. It must belong to an existing customer of this business.
9
+ #
10
+ # @return [String]
11
+ required :email, String
12
+
13
+ # @!method initialize(email:)
14
+ # @param email [String] Email to block. It must belong to an existing customer of this business.
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Blocklist
6
+ # Which customer to block. Untagged, so the caller sends `customer_id` or `email`
7
+ # at the top level, as `CustomerRequest` does on the payment routes. A body that
8
+ # carries both matches the first variant, so `customer_id` wins.
9
+ module BlockIdentifier
10
+ extend Dodopayments::Internal::Type::Union
11
+
12
+ variant -> { Dodopayments::Blocklist::BlockByCustomerID }
13
+
14
+ variant -> { Dodopayments::Blocklist::BlockByEmail }
15
+
16
+ # @!method self.variants
17
+ # @return [Array(Dodopayments::Models::Blocklist::BlockByCustomerID, Dodopayments::Models::Blocklist::BlockByEmail)]
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,128 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Blocklist
6
+ # @see Dodopayments::Resources::Blocklist::Customers#create
7
+ class BlockedCustomer < Dodopayments::Internal::Type::BaseModel
8
+ # @!attribute id
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute created_at
14
+ #
15
+ # @return [Time]
16
+ required :created_at, Time
17
+
18
+ # @!attribute customer_email
19
+ #
20
+ # @return [String]
21
+ required :customer_email, String
22
+
23
+ # @!attribute customer_id
24
+ #
25
+ # @return [String]
26
+ required :customer_id, String
27
+
28
+ # @!attribute customer_name
29
+ #
30
+ # @return [String]
31
+ required :customer_name, String
32
+
33
+ # @!attribute identifier
34
+ # Customer id or email that the merchant supplied.
35
+ #
36
+ # @return [String]
37
+ required :identifier, String
38
+
39
+ # @!attribute source
40
+ # Where a block came from. `Api` marks an API-key caller, which carries no
41
+ # dashboard actor. The other values name the screen the merchant used.
42
+ #
43
+ # @return [Symbol, Dodopayments::Models::Blocklist::BlockedCustomerSource]
44
+ required :source, enum: -> { Dodopayments::Blocklist::BlockedCustomerSource }
45
+
46
+ # @!attribute blocked_by_email
47
+ # Dashboard user who blocked the customer. `null` for an API-key caller.
48
+ #
49
+ # @return [String, nil]
50
+ optional :blocked_by_email, String, nil?: true
51
+
52
+ # @!attribute cancelled_subscription_ids
53
+ # Subscriptions this block cancelled. Present on the create response only.
54
+ #
55
+ # @return [Array<String>, nil]
56
+ optional :cancelled_subscription_ids, Dodopayments::Internal::Type::ArrayOf[String], nil?: true
57
+
58
+ # @!attribute notes
59
+ # Activity log. Present on the detail response only.
60
+ #
61
+ # @return [Array<Dodopayments::Models::Blocklist::Customers::BlockedCustomerNote>, nil]
62
+ optional :notes,
63
+ -> {
64
+ Dodopayments::Internal::Type::ArrayOf[Dodopayments::Blocklist::Customers::BlockedCustomerNote]
65
+ },
66
+ nil?: true
67
+
68
+ # @!attribute reason
69
+ #
70
+ # @return [String, nil]
71
+ optional :reason, String, nil?: true
72
+
73
+ # @!attribute remaining_subscription_ids
74
+ # Subscriptions this block left live, because the cancel failed or the inline
75
+ # batch filled up. Repeat the create call to continue; the block itself is already
76
+ # in force.
77
+ #
78
+ # @return [Array<String>, nil]
79
+ optional :remaining_subscription_ids, Dodopayments::Internal::Type::ArrayOf[String], nil?: true
80
+
81
+ # @!attribute subscriptions_swept
82
+ # False when the block left live subscriptions behind, including the case where
83
+ # the sweep could not list them and `remaining_subscription_ids` is therefore
84
+ # unknown. Repeat the create call until it reads true.
85
+ #
86
+ # @return [Boolean, nil]
87
+ optional :subscriptions_swept, Dodopayments::Internal::Type::Boolean, nil?: true
88
+
89
+ # @!attribute unblocked_at
90
+ #
91
+ # @return [Time, nil]
92
+ optional :unblocked_at, Time, nil?: true
93
+
94
+ # @!method initialize(id:, created_at:, customer_email:, customer_id:, customer_name:, identifier:, source:, blocked_by_email: nil, cancelled_subscription_ids: nil, notes: nil, reason: nil, remaining_subscription_ids: nil, subscriptions_swept: nil, unblocked_at: nil)
95
+ # Some parameter documentations has been truncated, see
96
+ # {Dodopayments::Models::Blocklist::BlockedCustomer} for more details.
97
+ #
98
+ # @param id [String]
99
+ #
100
+ # @param created_at [Time]
101
+ #
102
+ # @param customer_email [String]
103
+ #
104
+ # @param customer_id [String]
105
+ #
106
+ # @param customer_name [String]
107
+ #
108
+ # @param identifier [String] Customer id or email that the merchant supplied.
109
+ #
110
+ # @param source [Symbol, Dodopayments::Models::Blocklist::BlockedCustomerSource] Where a block came from. `Api` marks an API-key caller, which carries no
111
+ #
112
+ # @param blocked_by_email [String, nil] Dashboard user who blocked the customer. `null` for an API-key caller.
113
+ #
114
+ # @param cancelled_subscription_ids [Array<String>, nil] Subscriptions this block cancelled. Present on the create response only.
115
+ #
116
+ # @param notes [Array<Dodopayments::Models::Blocklist::Customers::BlockedCustomerNote>, nil] Activity log. Present on the detail response only.
117
+ #
118
+ # @param reason [String, nil]
119
+ #
120
+ # @param remaining_subscription_ids [Array<String>, nil] Subscriptions this block left live, because the cancel failed or the
121
+ #
122
+ # @param subscriptions_swept [Boolean, nil] False when the block left live subscriptions behind, including the case
123
+ #
124
+ # @param unblocked_at [Time, nil]
125
+ end
126
+ end
127
+ end
128
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Blocklist
6
+ # Where a block came from. `Api` marks an API-key caller, which carries no
7
+ # dashboard actor. The other values name the screen the merchant used.
8
+ module BlockedCustomerSource
9
+ extend Dodopayments::Internal::Type::Enum
10
+
11
+ BLOCKLIST_PAGE = :blocklist_page
12
+ CUSTOMER_PAGE = :customer_page
13
+ PAYMENT_PAGE = :payment_page
14
+ DISPUTE_PAGE = :dispute_page
15
+ API = :api
16
+
17
+ # @!method self.values
18
+ # @return [Array<Symbol>]
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Blocklist
6
+ module CreateBlockedCustomerRequest
7
+ extend Dodopayments::Internal::Type::Union
8
+
9
+ variant -> { Dodopayments::Blocklist::CreateBlockedCustomerRequest::BlocklistCustomersBlockByCustomerID }
10
+
11
+ variant -> { Dodopayments::Blocklist::CreateBlockedCustomerRequest::BlocklistCustomersBlockByEmail }
12
+
13
+ class BlocklistCustomersBlockByCustomerID < Dodopayments::Models::Blocklist::BlockByCustomerID
14
+ # @!attribute reason
15
+ # Why the merchant blocked this customer. The entry page shows it.
16
+ #
17
+ # @return [String, nil]
18
+ optional :reason, String, nil?: true
19
+
20
+ # @!attribute source
21
+ # Screen the merchant blocked from. Ignored for an API-key caller, whose entry
22
+ # always records `api`. A dashboard caller that omits it records `blocklist_page`.
23
+ #
24
+ # @return [Symbol, Dodopayments::Models::Blocklist::BlockedCustomerSource, nil]
25
+ optional :source, enum: -> { Dodopayments::Blocklist::BlockedCustomerSource }, nil?: true
26
+
27
+ # @!method initialize(reason: nil, source: nil)
28
+ # Some parameter documentations has been truncated, see
29
+ # {Dodopayments::Models::Blocklist::CreateBlockedCustomerRequest::BlocklistCustomersBlockByCustomerID}
30
+ # for more details.
31
+ #
32
+ # @param reason [String, nil] Why the merchant blocked this customer. The entry page shows it.
33
+ #
34
+ # @param source [Symbol, Dodopayments::Models::Blocklist::BlockedCustomerSource, nil] Screen the merchant blocked from. Ignored for an API-key caller, whose
35
+ end
36
+
37
+ class BlocklistCustomersBlockByEmail < Dodopayments::Models::Blocklist::BlockByEmail
38
+ # @!attribute reason
39
+ # Why the merchant blocked this customer. The entry page shows it.
40
+ #
41
+ # @return [String, nil]
42
+ optional :reason, String, nil?: true
43
+
44
+ # @!attribute source
45
+ # Screen the merchant blocked from. Ignored for an API-key caller, whose entry
46
+ # always records `api`. A dashboard caller that omits it records `blocklist_page`.
47
+ #
48
+ # @return [Symbol, Dodopayments::Models::Blocklist::BlockedCustomerSource, nil]
49
+ optional :source, enum: -> { Dodopayments::Blocklist::BlockedCustomerSource }, nil?: true
50
+
51
+ # @!method initialize(reason: nil, source: nil)
52
+ # Some parameter documentations has been truncated, see
53
+ # {Dodopayments::Models::Blocklist::CreateBlockedCustomerRequest::BlocklistCustomersBlockByEmail}
54
+ # for more details.
55
+ #
56
+ # @param reason [String, nil] Why the merchant blocked this customer. The entry page shows it.
57
+ #
58
+ # @param source [Symbol, Dodopayments::Models::Blocklist::BlockedCustomerSource, nil] Screen the merchant blocked from. Ignored for an API-key caller, whose
59
+ end
60
+
61
+ # @!method self.variants
62
+ # @return [Array(Dodopayments::Models::Blocklist::CreateBlockedCustomerRequest::BlocklistCustomersBlockByCustomerID, Dodopayments::Models::Blocklist::CreateBlockedCustomerRequest::BlocklistCustomersBlockByEmail)]
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Blocklist
6
+ # @see Dodopayments::Resources::Blocklist::Customers#create
7
+ class CustomerCreateParams < Dodopayments::Internal::Type::BaseModel
8
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
9
+ include Dodopayments::Internal::Type::RequestParameters
10
+
11
+ # @!method initialize(request_options: {})
12
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Blocklist
6
+ # @see Dodopayments::Resources::Blocklist::Customers#delete
7
+ class CustomerDeleteParams < Dodopayments::Internal::Type::BaseModel
8
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
9
+ include Dodopayments::Internal::Type::RequestParameters
10
+
11
+ # @!attribute entry_id
12
+ #
13
+ # @return [String]
14
+ required :entry_id, String
15
+
16
+ # @!method initialize(entry_id:, request_options: {})
17
+ # @param entry_id [String]
18
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Blocklist
6
+ # @see Dodopayments::Resources::Blocklist::Customers#list
7
+ class CustomerListParams < Dodopayments::Internal::Type::BaseModel
8
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
9
+ include Dodopayments::Internal::Type::RequestParameters
10
+
11
+ # @!attribute blocked_by_email
12
+ # Filter by the dashboard user who blocked the customer.
13
+ #
14
+ # @return [String, nil]
15
+ optional :blocked_by_email, String, nil?: true
16
+
17
+ # @!attribute created_at_gte
18
+ # Blocked on or after this time.
19
+ #
20
+ # @return [Time, nil]
21
+ optional :created_at_gte, Time, nil?: true
22
+
23
+ # @!attribute created_at_lte
24
+ # Blocked on or before this time.
25
+ #
26
+ # @return [Time, nil]
27
+ optional :created_at_lte, Time, nil?: true
28
+
29
+ # @!attribute identifier
30
+ # Partial, case-insensitive match on the email and on the customer id.
31
+ #
32
+ # @return [String, nil]
33
+ optional :identifier, String, nil?: true
34
+
35
+ # @!attribute page_number
36
+ # Page number. Default 0.
37
+ #
38
+ # @return [Integer, nil]
39
+ optional :page_number, Integer, nil?: true
40
+
41
+ # @!attribute page_size
42
+ # Page size. Default 10, maximum 100.
43
+ #
44
+ # @return [Integer, nil]
45
+ optional :page_size, Integer, nil?: true
46
+
47
+ # @!method initialize(blocked_by_email: nil, created_at_gte: nil, created_at_lte: nil, identifier: nil, page_number: nil, page_size: nil, request_options: {})
48
+ # @param blocked_by_email [String, nil] Filter by the dashboard user who blocked the customer.
49
+ #
50
+ # @param created_at_gte [Time, nil] Blocked on or after this time.
51
+ #
52
+ # @param created_at_lte [Time, nil] Blocked on or before this time.
53
+ #
54
+ # @param identifier [String, nil] Partial, case-insensitive match on the email and on the customer id.
55
+ #
56
+ # @param page_number [Integer, nil] Page number. Default 0.
57
+ #
58
+ # @param page_size [Integer, nil] Page size. Default 10, maximum 100.
59
+ #
60
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Blocklist
6
+ # @see Dodopayments::Resources::Blocklist::Customers#retrieve
7
+ class CustomerRetrieveParams < Dodopayments::Internal::Type::BaseModel
8
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
9
+ include Dodopayments::Internal::Type::RequestParameters
10
+
11
+ # @!attribute entry_id
12
+ #
13
+ # @return [String]
14
+ required :entry_id, String
15
+
16
+ # @!method initialize(entry_id:, request_options: {})
17
+ # @param entry_id [String]
18
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Blocklist
6
+ module Customers
7
+ # @see Dodopayments::Resources::Blocklist::Customers::Notes#create
8
+ class BlockedCustomerNote < Dodopayments::Internal::Type::BaseModel
9
+ # @!attribute id
10
+ #
11
+ # @return [String]
12
+ required :id, String
13
+
14
+ # @!attribute created_at
15
+ #
16
+ # @return [Time]
17
+ required :created_at, Time
18
+
19
+ # @!attribute note
20
+ #
21
+ # @return [String]
22
+ required :note, String
23
+
24
+ # @!attribute author_email
25
+ #
26
+ # @return [String, nil]
27
+ optional :author_email, String, nil?: true
28
+
29
+ # @!attribute updated_at
30
+ #
31
+ # @return [Time, nil]
32
+ optional :updated_at, Time, nil?: true
33
+
34
+ # @!method initialize(id:, created_at:, note:, author_email: nil, updated_at: nil)
35
+ # @param id [String]
36
+ # @param created_at [Time]
37
+ # @param note [String]
38
+ # @param author_email [String, nil]
39
+ # @param updated_at [Time, nil]
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Blocklist
6
+ module Customers
7
+ # @see Dodopayments::Resources::Blocklist::Customers::Notes#create
8
+ class NoteCreateParams < Dodopayments::Models::Blocklist::Customers::NoteRequest
9
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
10
+ include Dodopayments::Internal::Type::RequestParameters
11
+
12
+ # @!attribute entry_id
13
+ #
14
+ # @return [String]
15
+ required :entry_id, String
16
+
17
+ # @!method initialize(entry_id:, request_options: {})
18
+ # @param entry_id [String]
19
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Blocklist
6
+ module Customers
7
+ class NoteRequest < Dodopayments::Internal::Type::BaseModel
8
+ # @!attribute note
9
+ #
10
+ # @return [String]
11
+ required :note, String
12
+
13
+ # @!method initialize(note:)
14
+ # @param note [String]
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Blocklist
6
+ module Customers
7
+ # @see Dodopayments::Resources::Blocklist::Customers::Notes#update
8
+ class NoteUpdateParams < Dodopayments::Models::Blocklist::Customers::NoteRequest
9
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
10
+ include Dodopayments::Internal::Type::RequestParameters
11
+
12
+ # @!attribute entry_id
13
+ #
14
+ # @return [String]
15
+ required :entry_id, String
16
+
17
+ # @!attribute note_id
18
+ #
19
+ # @return [String]
20
+ required :note_id, String
21
+
22
+ # @!method initialize(entry_id:, note_id:, request_options: {})
23
+ # @param entry_id [String]
24
+ # @param note_id [String]
25
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -29,6 +29,20 @@ module Dodopayments
29
29
  # @return [String]
30
30
  required :name, String
31
31
 
32
+ # @!attribute blocked_at
33
+ # When the merchant blocked this customer. The dashboard shows the "Blocked" badge
34
+ # and the unblock action from it. The list route leaves it empty; only the
35
+ # single-customer route resolves it.
36
+ #
37
+ # @return [Time, nil]
38
+ optional :blocked_at, Time, nil?: true
39
+
40
+ # @!attribute blocklist_entry_id
41
+ # Blocklist entry behind `blocked_at`, so the dashboard can link to it.
42
+ #
43
+ # @return [String, nil]
44
+ optional :blocklist_entry_id, String, nil?: true
45
+
32
46
  # @!attribute metadata
33
47
  # Additional metadata for the customer
34
48
  #
@@ -40,7 +54,10 @@ module Dodopayments
40
54
  # @return [String, nil]
41
55
  optional :phone_number, String, nil?: true
42
56
 
43
- # @!method initialize(business_id:, created_at:, customer_id:, email:, name:, metadata: nil, phone_number: nil)
57
+ # @!method initialize(business_id:, created_at:, customer_id:, email:, name:, blocked_at: nil, blocklist_entry_id: nil, metadata: nil, phone_number: nil)
58
+ # Some parameter documentations has been truncated, see
59
+ # {Dodopayments::Models::Customer} for more details.
60
+ #
44
61
  # @param business_id [String]
45
62
  #
46
63
  # @param created_at [Time]
@@ -51,6 +68,10 @@ module Dodopayments
51
68
  #
52
69
  # @param name [String]
53
70
  #
71
+ # @param blocked_at [Time, nil] When the merchant blocked this customer. The dashboard shows the
72
+ #
73
+ # @param blocklist_entry_id [String, nil] Blocklist entry behind `blocked_at`, so the dashboard can link to it.
74
+ #
54
75
  # @param metadata [Hash{Symbol=>String, Float, Boolean}] Additional metadata for the customer
55
76
  #
56
77
  # @param phone_number [String, nil]
@@ -109,6 +109,7 @@ module Dodopayments
109
109
 
110
110
  ON_HOLD = :on_hold
111
111
  CANCELLED = :cancelled
112
+ PAST_DUE = :past_due
112
113
 
113
114
  # @!method self.values
114
115
  # @return [Array<Symbol>]
@@ -109,6 +109,7 @@ module Dodopayments
109
109
 
110
110
  ON_HOLD = :on_hold
111
111
  CANCELLED = :cancelled
112
+ PAST_DUE = :past_due
112
113
 
113
114
  # @!method self.values
114
115
  # @return [Array<Symbol>]