whop_sdk 0.0.8 → 0.0.10

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 (181) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +1 -1
  4. data/lib/whop_sdk/client.rb +12 -0
  5. data/lib/whop_sdk/models/account_link_create_params.rb +62 -0
  6. data/lib/whop_sdk/models/account_link_create_response.rb +28 -0
  7. data/lib/whop_sdk/models/app_build_create_params.rb +9 -1
  8. data/lib/whop_sdk/models/app_build_list_params.rb +17 -1
  9. data/lib/whop_sdk/models/app_list_params.rb +1 -0
  10. data/lib/whop_sdk/models/authorized_user_list_params.rb +17 -1
  11. data/lib/whop_sdk/models/checkout_configuration_list_params.rb +17 -1
  12. data/lib/whop_sdk/models/company_list_params.rb +17 -1
  13. data/lib/whop_sdk/models/dispute_list_params.rb +17 -1
  14. data/lib/whop_sdk/models/entry_list_params.rb +17 -1
  15. data/lib/whop_sdk/models/experience_list_params.rb +17 -1
  16. data/lib/whop_sdk/models/invoice_list_params.rb +17 -1
  17. data/lib/whop_sdk/models/payment.rb +90 -1
  18. data/lib/whop_sdk/models/payment_create_params.rb +307 -0
  19. data/lib/whop_sdk/models/payment_list_response.rb +90 -1
  20. data/lib/whop_sdk/models/payment_method_types.rb +1 -0
  21. data/lib/whop_sdk/models/payment_token_list_params.rb +78 -0
  22. data/lib/whop_sdk/models/payment_token_list_response.rb +86 -0
  23. data/lib/whop_sdk/models/payment_token_retrieve_params.rb +22 -0
  24. data/lib/whop_sdk/models/payment_token_retrieve_response.rb +86 -0
  25. data/lib/whop_sdk/models/plan_create_params.rb +3 -21
  26. data/lib/whop_sdk/models/plan_list_params.rb +17 -1
  27. data/lib/whop_sdk/models/product_list_params.rb +17 -1
  28. data/lib/whop_sdk/models/product_update_params.rb +1 -61
  29. data/lib/whop_sdk/models/promo_code_list_params.rb +17 -1
  30. data/lib/whop_sdk/models/refund_list_params.rb +17 -1
  31. data/lib/whop_sdk/models/review_list_params.rb +17 -1
  32. data/lib/whop_sdk/models/setup_intent.rb +253 -0
  33. data/lib/whop_sdk/models/setup_intent_canceled_webhook_event.rb +52 -0
  34. data/lib/whop_sdk/models/setup_intent_list_params.rb +78 -0
  35. data/lib/whop_sdk/models/setup_intent_list_response.rb +255 -0
  36. data/lib/whop_sdk/models/setup_intent_requires_action_webhook_event.rb +52 -0
  37. data/lib/whop_sdk/models/setup_intent_retrieve_params.rb +14 -0
  38. data/lib/whop_sdk/models/setup_intent_status.rb +18 -0
  39. data/lib/whop_sdk/models/setup_intent_succeeded_webhook_event.rb +52 -0
  40. data/lib/whop_sdk/models/transfer_list_params.rb +17 -1
  41. data/lib/whop_sdk/models/unwrap_webhook_event.rb +7 -1
  42. data/lib/whop_sdk/models.rb +22 -0
  43. data/lib/whop_sdk/resources/account_links.rb +47 -0
  44. data/lib/whop_sdk/resources/app_builds.rb +8 -2
  45. data/lib/whop_sdk/resources/authorized_users.rb +5 -1
  46. data/lib/whop_sdk/resources/checkout_configurations.rb +5 -1
  47. data/lib/whop_sdk/resources/companies.rb +5 -1
  48. data/lib/whop_sdk/resources/disputes.rb +5 -1
  49. data/lib/whop_sdk/resources/entries.rb +5 -1
  50. data/lib/whop_sdk/resources/experiences.rb +5 -1
  51. data/lib/whop_sdk/resources/invoices.rb +5 -1
  52. data/lib/whop_sdk/resources/payment_tokens.rb +83 -0
  53. data/lib/whop_sdk/resources/payments.rb +48 -0
  54. data/lib/whop_sdk/resources/plans.rb +7 -7
  55. data/lib/whop_sdk/resources/products.rb +6 -4
  56. data/lib/whop_sdk/resources/promo_codes.rb +5 -1
  57. data/lib/whop_sdk/resources/refunds.rb +5 -1
  58. data/lib/whop_sdk/resources/reviews.rb +5 -1
  59. data/lib/whop_sdk/resources/setup_intents.rb +83 -0
  60. data/lib/whop_sdk/resources/transfers.rb +5 -1
  61. data/lib/whop_sdk/resources/webhooks.rb +1 -1
  62. data/lib/whop_sdk/version.rb +1 -1
  63. data/lib/whop_sdk.rb +19 -0
  64. data/manifest.yaml +1 -0
  65. data/rbi/whop_sdk/client.rbi +9 -0
  66. data/rbi/whop_sdk/models/account_link_create_params.rbi +101 -0
  67. data/rbi/whop_sdk/models/account_link_create_response.rbi +38 -0
  68. data/rbi/whop_sdk/models/app_build_create_params.rbi +8 -0
  69. data/rbi/whop_sdk/models/app_build_list_params.rbi +16 -0
  70. data/rbi/whop_sdk/models/app_list_params.rbi +5 -0
  71. data/rbi/whop_sdk/models/authorized_user_list_params.rbi +16 -0
  72. data/rbi/whop_sdk/models/checkout_configuration_list_params.rbi +16 -0
  73. data/rbi/whop_sdk/models/company_list_params.rbi +16 -0
  74. data/rbi/whop_sdk/models/dispute_list_params.rbi +16 -0
  75. data/rbi/whop_sdk/models/entry_list_params.rbi +16 -0
  76. data/rbi/whop_sdk/models/experience_list_params.rbi +16 -0
  77. data/rbi/whop_sdk/models/invoice_list_params.rbi +16 -0
  78. data/rbi/whop_sdk/models/payment.rbi +142 -0
  79. data/rbi/whop_sdk/models/payment_create_params.rbi +384 -0
  80. data/rbi/whop_sdk/models/payment_list_response.rbi +167 -0
  81. data/rbi/whop_sdk/models/payment_method_types.rbi +1 -0
  82. data/rbi/whop_sdk/models/payment_token_list_params.rbi +99 -0
  83. data/rbi/whop_sdk/models/payment_token_list_response.rbi +139 -0
  84. data/rbi/whop_sdk/models/payment_token_retrieve_params.rbi +40 -0
  85. data/rbi/whop_sdk/models/payment_token_retrieve_response.rbi +144 -0
  86. data/rbi/whop_sdk/models/plan_create_params.rbi +2 -22
  87. data/rbi/whop_sdk/models/plan_list_params.rbi +16 -0
  88. data/rbi/whop_sdk/models/product_list_params.rbi +16 -0
  89. data/rbi/whop_sdk/models/product_update_params.rbi +0 -110
  90. data/rbi/whop_sdk/models/promo_code_list_params.rbi +16 -0
  91. data/rbi/whop_sdk/models/refund_list_params.rbi +16 -0
  92. data/rbi/whop_sdk/models/review_list_params.rbi +16 -0
  93. data/rbi/whop_sdk/models/setup_intent.rbi +412 -0
  94. data/rbi/whop_sdk/models/setup_intent_canceled_webhook_event.rbi +77 -0
  95. data/rbi/whop_sdk/models/setup_intent_list_params.rbi +99 -0
  96. data/rbi/whop_sdk/models/setup_intent_list_response.rbi +492 -0
  97. data/rbi/whop_sdk/models/setup_intent_requires_action_webhook_event.rbi +77 -0
  98. data/rbi/whop_sdk/models/setup_intent_retrieve_params.rbi +27 -0
  99. data/rbi/whop_sdk/models/setup_intent_status.rbi +25 -0
  100. data/rbi/whop_sdk/models/setup_intent_succeeded_webhook_event.rbi +77 -0
  101. data/rbi/whop_sdk/models/transfer_list_params.rbi +16 -0
  102. data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +3 -0
  103. data/rbi/whop_sdk/models.rbi +25 -0
  104. data/rbi/whop_sdk/resources/account_links.rbi +39 -0
  105. data/rbi/whop_sdk/resources/app_builds.rbi +9 -0
  106. data/rbi/whop_sdk/resources/authorized_users.rbi +6 -0
  107. data/rbi/whop_sdk/resources/checkout_configurations.rbi +6 -0
  108. data/rbi/whop_sdk/resources/companies.rbi +6 -0
  109. data/rbi/whop_sdk/resources/disputes.rbi +6 -0
  110. data/rbi/whop_sdk/resources/entries.rbi +6 -0
  111. data/rbi/whop_sdk/resources/experiences.rbi +6 -0
  112. data/rbi/whop_sdk/resources/invoices.rbi +6 -0
  113. data/rbi/whop_sdk/resources/payment_tokens.rbi +76 -0
  114. data/rbi/whop_sdk/resources/payments.rbi +42 -0
  115. data/rbi/whop_sdk/resources/plans.rbi +7 -9
  116. data/rbi/whop_sdk/resources/products.rbi +6 -9
  117. data/rbi/whop_sdk/resources/promo_codes.rbi +6 -0
  118. data/rbi/whop_sdk/resources/refunds.rbi +6 -0
  119. data/rbi/whop_sdk/resources/reviews.rbi +6 -0
  120. data/rbi/whop_sdk/resources/setup_intents.rbi +77 -0
  121. data/rbi/whop_sdk/resources/transfers.rbi +6 -0
  122. data/rbi/whop_sdk/resources/webhooks.rbi +3 -0
  123. data/sig/whop_sdk/client.rbs +6 -0
  124. data/sig/whop_sdk/models/account_link_create_params.rbs +52 -0
  125. data/sig/whop_sdk/models/account_link_create_response.rbs +15 -0
  126. data/sig/whop_sdk/models/app_build_create_params.rbs +5 -0
  127. data/sig/whop_sdk/models/app_build_list_params.rbs +10 -0
  128. data/sig/whop_sdk/models/app_list_params.rbs +2 -0
  129. data/sig/whop_sdk/models/authorized_user_list_params.rbs +10 -0
  130. data/sig/whop_sdk/models/checkout_configuration_list_params.rbs +10 -0
  131. data/sig/whop_sdk/models/company_list_params.rbs +10 -0
  132. data/sig/whop_sdk/models/dispute_list_params.rbs +10 -0
  133. data/sig/whop_sdk/models/entry_list_params.rbs +10 -0
  134. data/sig/whop_sdk/models/experience_list_params.rbs +10 -0
  135. data/sig/whop_sdk/models/invoice_list_params.rbs +10 -0
  136. data/sig/whop_sdk/models/payment.rbs +69 -0
  137. data/sig/whop_sdk/models/payment_create_params.rbs +210 -0
  138. data/sig/whop_sdk/models/payment_list_response.rbs +69 -0
  139. data/sig/whop_sdk/models/payment_method_types.rbs +2 -0
  140. data/sig/whop_sdk/models/payment_token_list_params.rbs +61 -0
  141. data/sig/whop_sdk/models/payment_token_list_response.rbs +67 -0
  142. data/sig/whop_sdk/models/payment_token_retrieve_params.rbs +23 -0
  143. data/sig/whop_sdk/models/payment_token_retrieve_response.rbs +67 -0
  144. data/sig/whop_sdk/models/plan_create_params.rbs +0 -10
  145. data/sig/whop_sdk/models/plan_list_params.rbs +10 -0
  146. data/sig/whop_sdk/models/product_list_params.rbs +10 -0
  147. data/sig/whop_sdk/models/product_update_params.rbs +0 -36
  148. data/sig/whop_sdk/models/promo_code_list_params.rbs +10 -0
  149. data/sig/whop_sdk/models/refund_list_params.rbs +10 -0
  150. data/sig/whop_sdk/models/review_list_params.rbs +10 -0
  151. data/sig/whop_sdk/models/setup_intent.rbs +189 -0
  152. data/sig/whop_sdk/models/setup_intent_canceled_webhook_event.rbs +40 -0
  153. data/sig/whop_sdk/models/setup_intent_list_params.rbs +61 -0
  154. data/sig/whop_sdk/models/setup_intent_list_response.rbs +193 -0
  155. data/sig/whop_sdk/models/setup_intent_requires_action_webhook_event.rbs +40 -0
  156. data/sig/whop_sdk/models/setup_intent_retrieve_params.rbs +15 -0
  157. data/sig/whop_sdk/models/setup_intent_status.rbs +17 -0
  158. data/sig/whop_sdk/models/setup_intent_succeeded_webhook_event.rbs +40 -0
  159. data/sig/whop_sdk/models/transfer_list_params.rbs +10 -0
  160. data/sig/whop_sdk/models/unwrap_webhook_event.rbs +3 -0
  161. data/sig/whop_sdk/models.rbs +22 -0
  162. data/sig/whop_sdk/resources/account_links.rbs +15 -0
  163. data/sig/whop_sdk/resources/app_builds.rbs +3 -0
  164. data/sig/whop_sdk/resources/authorized_users.rbs +2 -0
  165. data/sig/whop_sdk/resources/checkout_configurations.rbs +2 -0
  166. data/sig/whop_sdk/resources/companies.rbs +2 -0
  167. data/sig/whop_sdk/resources/disputes.rbs +2 -0
  168. data/sig/whop_sdk/resources/entries.rbs +2 -0
  169. data/sig/whop_sdk/resources/experiences.rbs +2 -0
  170. data/sig/whop_sdk/resources/invoices.rbs +2 -0
  171. data/sig/whop_sdk/resources/payment_tokens.rbs +25 -0
  172. data/sig/whop_sdk/resources/payments.rbs +9 -0
  173. data/sig/whop_sdk/resources/plans.rbs +2 -2
  174. data/sig/whop_sdk/resources/products.rbs +2 -1
  175. data/sig/whop_sdk/resources/promo_codes.rbs +2 -0
  176. data/sig/whop_sdk/resources/refunds.rbs +2 -0
  177. data/sig/whop_sdk/resources/reviews.rbs +2 -0
  178. data/sig/whop_sdk/resources/setup_intents.rbs +24 -0
  179. data/sig/whop_sdk/resources/transfers.rbs +2 -0
  180. data/sig/whop_sdk/resources/webhooks.rbs +3 -0
  181. metadata +56 -2
@@ -0,0 +1,412 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class SetupIntent < WhopSDK::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias { T.any(WhopSDK::SetupIntent, WhopSDK::Internal::AnyHash) }
8
+
9
+ # The setup intent ID
10
+ sig { returns(String) }
11
+ attr_accessor :id
12
+
13
+ # The checkout configuration associated with the setup intent
14
+ sig { returns(T.nilable(WhopSDK::SetupIntent::CheckoutConfiguration)) }
15
+ attr_reader :checkout_configuration
16
+
17
+ sig do
18
+ params(
19
+ checkout_configuration:
20
+ T.nilable(WhopSDK::SetupIntent::CheckoutConfiguration::OrHash)
21
+ ).void
22
+ end
23
+ attr_writer :checkout_configuration
24
+
25
+ # The company of the setup intent
26
+ sig { returns(T.nilable(WhopSDK::SetupIntent::Company)) }
27
+ attr_reader :company
28
+
29
+ sig do
30
+ params(company: T.nilable(WhopSDK::SetupIntent::Company::OrHash)).void
31
+ end
32
+ attr_writer :company
33
+
34
+ # The datetime the payment was created
35
+ sig { returns(Time) }
36
+ attr_accessor :created_at
37
+
38
+ # The error message, if any.
39
+ sig { returns(T.nilable(String)) }
40
+ attr_accessor :error_message
41
+
42
+ # The member connected to the setup intent
43
+ sig { returns(T.nilable(WhopSDK::SetupIntent::Member)) }
44
+ attr_reader :member
45
+
46
+ sig do
47
+ params(member: T.nilable(WhopSDK::SetupIntent::Member::OrHash)).void
48
+ end
49
+ attr_writer :member
50
+
51
+ # The metadata associated with the setup intent
52
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
53
+ attr_accessor :metadata
54
+
55
+ # The payment token created during the setup, if available.
56
+ sig { returns(T.nilable(WhopSDK::SetupIntent::PaymentToken)) }
57
+ attr_reader :payment_token
58
+
59
+ sig do
60
+ params(
61
+ payment_token: T.nilable(WhopSDK::SetupIntent::PaymentToken::OrHash)
62
+ ).void
63
+ end
64
+ attr_writer :payment_token
65
+
66
+ # The status of the setup intent
67
+ sig { returns(WhopSDK::SetupIntentStatus::TaggedSymbol) }
68
+ attr_accessor :status
69
+
70
+ # An object representing a setup intent, which is a flow for allowing a customer
71
+ # to add a payment method to their account without making a purchase.
72
+ sig do
73
+ params(
74
+ id: String,
75
+ checkout_configuration:
76
+ T.nilable(WhopSDK::SetupIntent::CheckoutConfiguration::OrHash),
77
+ company: T.nilable(WhopSDK::SetupIntent::Company::OrHash),
78
+ created_at: Time,
79
+ error_message: T.nilable(String),
80
+ member: T.nilable(WhopSDK::SetupIntent::Member::OrHash),
81
+ metadata: T.nilable(T::Hash[Symbol, T.anything]),
82
+ payment_token: T.nilable(WhopSDK::SetupIntent::PaymentToken::OrHash),
83
+ status: WhopSDK::SetupIntentStatus::OrSymbol
84
+ ).returns(T.attached_class)
85
+ end
86
+ def self.new(
87
+ # The setup intent ID
88
+ id:,
89
+ # The checkout configuration associated with the setup intent
90
+ checkout_configuration:,
91
+ # The company of the setup intent
92
+ company:,
93
+ # The datetime the payment was created
94
+ created_at:,
95
+ # The error message, if any.
96
+ error_message:,
97
+ # The member connected to the setup intent
98
+ member:,
99
+ # The metadata associated with the setup intent
100
+ metadata:,
101
+ # The payment token created during the setup, if available.
102
+ payment_token:,
103
+ # The status of the setup intent
104
+ status:
105
+ )
106
+ end
107
+
108
+ sig do
109
+ override.returns(
110
+ {
111
+ id: String,
112
+ checkout_configuration:
113
+ T.nilable(WhopSDK::SetupIntent::CheckoutConfiguration),
114
+ company: T.nilable(WhopSDK::SetupIntent::Company),
115
+ created_at: Time,
116
+ error_message: T.nilable(String),
117
+ member: T.nilable(WhopSDK::SetupIntent::Member),
118
+ metadata: T.nilable(T::Hash[Symbol, T.anything]),
119
+ payment_token: T.nilable(WhopSDK::SetupIntent::PaymentToken),
120
+ status: WhopSDK::SetupIntentStatus::TaggedSymbol
121
+ }
122
+ )
123
+ end
124
+ def to_hash
125
+ end
126
+
127
+ class CheckoutConfiguration < WhopSDK::Internal::Type::BaseModel
128
+ OrHash =
129
+ T.type_alias do
130
+ T.any(
131
+ WhopSDK::SetupIntent::CheckoutConfiguration,
132
+ WhopSDK::Internal::AnyHash
133
+ )
134
+ end
135
+
136
+ # The ID of the checkout configuration
137
+ sig { returns(String) }
138
+ attr_accessor :id
139
+
140
+ # The checkout configuration associated with the setup intent
141
+ sig { params(id: String).returns(T.attached_class) }
142
+ def self.new(
143
+ # The ID of the checkout configuration
144
+ id:
145
+ )
146
+ end
147
+
148
+ sig { override.returns({ id: String }) }
149
+ def to_hash
150
+ end
151
+ end
152
+
153
+ class Company < WhopSDK::Internal::Type::BaseModel
154
+ OrHash =
155
+ T.type_alias do
156
+ T.any(WhopSDK::SetupIntent::Company, WhopSDK::Internal::AnyHash)
157
+ end
158
+
159
+ # The ID (tag) of the company.
160
+ sig { returns(String) }
161
+ attr_accessor :id
162
+
163
+ # The company of the setup intent
164
+ sig { params(id: String).returns(T.attached_class) }
165
+ def self.new(
166
+ # The ID (tag) of the company.
167
+ id:
168
+ )
169
+ end
170
+
171
+ sig { override.returns({ id: String }) }
172
+ def to_hash
173
+ end
174
+ end
175
+
176
+ class Member < WhopSDK::Internal::Type::BaseModel
177
+ OrHash =
178
+ T.type_alias do
179
+ T.any(WhopSDK::SetupIntent::Member, WhopSDK::Internal::AnyHash)
180
+ end
181
+
182
+ # The ID of the member
183
+ sig { returns(String) }
184
+ attr_accessor :id
185
+
186
+ # The user for this member, if any.
187
+ sig { returns(T.nilable(WhopSDK::SetupIntent::Member::User)) }
188
+ attr_reader :user
189
+
190
+ sig do
191
+ params(
192
+ user: T.nilable(WhopSDK::SetupIntent::Member::User::OrHash)
193
+ ).void
194
+ end
195
+ attr_writer :user
196
+
197
+ # The member connected to the setup intent
198
+ sig do
199
+ params(
200
+ id: String,
201
+ user: T.nilable(WhopSDK::SetupIntent::Member::User::OrHash)
202
+ ).returns(T.attached_class)
203
+ end
204
+ def self.new(
205
+ # The ID of the member
206
+ id:,
207
+ # The user for this member, if any.
208
+ user:
209
+ )
210
+ end
211
+
212
+ sig do
213
+ override.returns(
214
+ { id: String, user: T.nilable(WhopSDK::SetupIntent::Member::User) }
215
+ )
216
+ end
217
+ def to_hash
218
+ end
219
+
220
+ class User < WhopSDK::Internal::Type::BaseModel
221
+ OrHash =
222
+ T.type_alias do
223
+ T.any(
224
+ WhopSDK::SetupIntent::Member::User,
225
+ WhopSDK::Internal::AnyHash
226
+ )
227
+ end
228
+
229
+ # The internal ID of the user account.
230
+ sig { returns(String) }
231
+ attr_accessor :id
232
+
233
+ # The digital mailing address of the user.
234
+ sig { returns(T.nilable(String)) }
235
+ attr_accessor :email
236
+
237
+ # The user's full name.
238
+ sig { returns(T.nilable(String)) }
239
+ attr_accessor :name
240
+
241
+ # The whop username.
242
+ sig { returns(String) }
243
+ attr_accessor :username
244
+
245
+ # The user for this member, if any.
246
+ sig do
247
+ params(
248
+ id: String,
249
+ email: T.nilable(String),
250
+ name: T.nilable(String),
251
+ username: String
252
+ ).returns(T.attached_class)
253
+ end
254
+ def self.new(
255
+ # The internal ID of the user account.
256
+ id:,
257
+ # The digital mailing address of the user.
258
+ email:,
259
+ # The user's full name.
260
+ name:,
261
+ # The whop username.
262
+ username:
263
+ )
264
+ end
265
+
266
+ sig do
267
+ override.returns(
268
+ {
269
+ id: String,
270
+ email: T.nilable(String),
271
+ name: T.nilable(String),
272
+ username: String
273
+ }
274
+ )
275
+ end
276
+ def to_hash
277
+ end
278
+ end
279
+ end
280
+
281
+ class PaymentToken < WhopSDK::Internal::Type::BaseModel
282
+ OrHash =
283
+ T.type_alias do
284
+ T.any(
285
+ WhopSDK::SetupIntent::PaymentToken,
286
+ WhopSDK::Internal::AnyHash
287
+ )
288
+ end
289
+
290
+ # The ID of the payment token
291
+ sig { returns(String) }
292
+ attr_accessor :id
293
+
294
+ # The card data associated with the payment token, if its a debit or credit card
295
+ # token.
296
+ sig { returns(T.nilable(WhopSDK::SetupIntent::PaymentToken::Card)) }
297
+ attr_reader :card
298
+
299
+ sig do
300
+ params(
301
+ card: T.nilable(WhopSDK::SetupIntent::PaymentToken::Card::OrHash)
302
+ ).void
303
+ end
304
+ attr_writer :card
305
+
306
+ # The date and time the payment token was created
307
+ sig { returns(Time) }
308
+ attr_accessor :created_at
309
+
310
+ # The payment method type of the payment token
311
+ sig { returns(WhopSDK::PaymentMethodTypes::TaggedSymbol) }
312
+ attr_accessor :payment_method_type
313
+
314
+ # The payment token created during the setup, if available.
315
+ sig do
316
+ params(
317
+ id: String,
318
+ card: T.nilable(WhopSDK::SetupIntent::PaymentToken::Card::OrHash),
319
+ created_at: Time,
320
+ payment_method_type: WhopSDK::PaymentMethodTypes::OrSymbol
321
+ ).returns(T.attached_class)
322
+ end
323
+ def self.new(
324
+ # The ID of the payment token
325
+ id:,
326
+ # The card data associated with the payment token, if its a debit or credit card
327
+ # token.
328
+ card:,
329
+ # The date and time the payment token was created
330
+ created_at:,
331
+ # The payment method type of the payment token
332
+ payment_method_type:
333
+ )
334
+ end
335
+
336
+ sig do
337
+ override.returns(
338
+ {
339
+ id: String,
340
+ card: T.nilable(WhopSDK::SetupIntent::PaymentToken::Card),
341
+ created_at: Time,
342
+ payment_method_type: WhopSDK::PaymentMethodTypes::TaggedSymbol
343
+ }
344
+ )
345
+ end
346
+ def to_hash
347
+ end
348
+
349
+ class Card < WhopSDK::Internal::Type::BaseModel
350
+ OrHash =
351
+ T.type_alias do
352
+ T.any(
353
+ WhopSDK::SetupIntent::PaymentToken::Card,
354
+ WhopSDK::Internal::AnyHash
355
+ )
356
+ end
357
+
358
+ # Possible card brands that a payment token can have
359
+ sig { returns(T.nilable(WhopSDK::CardBrands::TaggedSymbol)) }
360
+ attr_accessor :brand
361
+
362
+ # Card expiration month, like 03 for March.
363
+ sig { returns(T.nilable(Integer)) }
364
+ attr_accessor :exp_month
365
+
366
+ # Card expiration year, like 27 for 2027.
367
+ sig { returns(T.nilable(Integer)) }
368
+ attr_accessor :exp_year
369
+
370
+ # Last four digits of the card.
371
+ sig { returns(T.nilable(String)) }
372
+ attr_accessor :last4
373
+
374
+ # The card data associated with the payment token, if its a debit or credit card
375
+ # token.
376
+ sig do
377
+ params(
378
+ brand: T.nilable(WhopSDK::CardBrands::OrSymbol),
379
+ exp_month: T.nilable(Integer),
380
+ exp_year: T.nilable(Integer),
381
+ last4: T.nilable(String)
382
+ ).returns(T.attached_class)
383
+ end
384
+ def self.new(
385
+ # Possible card brands that a payment token can have
386
+ brand:,
387
+ # Card expiration month, like 03 for March.
388
+ exp_month:,
389
+ # Card expiration year, like 27 for 2027.
390
+ exp_year:,
391
+ # Last four digits of the card.
392
+ last4:
393
+ )
394
+ end
395
+
396
+ sig do
397
+ override.returns(
398
+ {
399
+ brand: T.nilable(WhopSDK::CardBrands::TaggedSymbol),
400
+ exp_month: T.nilable(Integer),
401
+ exp_year: T.nilable(Integer),
402
+ last4: T.nilable(String)
403
+ }
404
+ )
405
+ end
406
+ def to_hash
407
+ end
408
+ end
409
+ end
410
+ end
411
+ end
412
+ end
@@ -0,0 +1,77 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class SetupIntentCanceledWebhookEvent < WhopSDK::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ WhopSDK::SetupIntentCanceledWebhookEvent,
10
+ WhopSDK::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # A unique ID for every single webhook request
15
+ sig { returns(String) }
16
+ attr_accessor :id
17
+
18
+ # The API version for this webhook
19
+ sig { returns(Symbol) }
20
+ attr_accessor :api_version
21
+
22
+ # An object representing a setup intent, which is a flow for allowing a customer
23
+ # to add a payment method to their account without making a purchase.
24
+ sig { returns(WhopSDK::SetupIntent) }
25
+ attr_reader :data
26
+
27
+ sig { params(data: WhopSDK::SetupIntent::OrHash).void }
28
+ attr_writer :data
29
+
30
+ # The timestamp in ISO 8601 format that the webhook was sent at on the server
31
+ sig { returns(Time) }
32
+ attr_accessor :timestamp
33
+
34
+ # The webhook event type
35
+ sig { returns(Symbol) }
36
+ attr_accessor :type
37
+
38
+ sig do
39
+ params(
40
+ id: String,
41
+ data: WhopSDK::SetupIntent::OrHash,
42
+ timestamp: Time,
43
+ api_version: Symbol,
44
+ type: Symbol
45
+ ).returns(T.attached_class)
46
+ end
47
+ def self.new(
48
+ # A unique ID for every single webhook request
49
+ id:,
50
+ # An object representing a setup intent, which is a flow for allowing a customer
51
+ # to add a payment method to their account without making a purchase.
52
+ data:,
53
+ # The timestamp in ISO 8601 format that the webhook was sent at on the server
54
+ timestamp:,
55
+ # The API version for this webhook
56
+ api_version: :v1,
57
+ # The webhook event type
58
+ type: :"setup_intent.canceled"
59
+ )
60
+ end
61
+
62
+ sig do
63
+ override.returns(
64
+ {
65
+ id: String,
66
+ api_version: Symbol,
67
+ data: WhopSDK::SetupIntent,
68
+ timestamp: Time,
69
+ type: Symbol
70
+ }
71
+ )
72
+ end
73
+ def to_hash
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,99 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class SetupIntentListParams < WhopSDK::Internal::Type::BaseModel
6
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
7
+ include WhopSDK::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(WhopSDK::SetupIntentListParams, WhopSDK::Internal::AnyHash)
12
+ end
13
+
14
+ # The ID of the company to list setup intents for
15
+ sig { returns(String) }
16
+ attr_accessor :company_id
17
+
18
+ # Returns the elements in the list that come after the specified cursor.
19
+ sig { returns(T.nilable(String)) }
20
+ attr_accessor :after
21
+
22
+ # Returns the elements in the list that come before the specified cursor.
23
+ sig { returns(T.nilable(String)) }
24
+ attr_accessor :before
25
+
26
+ # The minimum creation date to filter by
27
+ sig { returns(T.nilable(Time)) }
28
+ attr_accessor :created_after
29
+
30
+ # The maximum creation date to filter by
31
+ sig { returns(T.nilable(Time)) }
32
+ attr_accessor :created_before
33
+
34
+ # The direction of the sort.
35
+ sig { returns(T.nilable(WhopSDK::Direction::OrSymbol)) }
36
+ attr_accessor :direction
37
+
38
+ # Returns the first _n_ elements from the list.
39
+ sig { returns(T.nilable(Integer)) }
40
+ attr_accessor :first
41
+
42
+ # Returns the last _n_ elements from the list.
43
+ sig { returns(T.nilable(Integer)) }
44
+ attr_accessor :last
45
+
46
+ sig do
47
+ params(
48
+ company_id: String,
49
+ after: T.nilable(String),
50
+ before: T.nilable(String),
51
+ created_after: T.nilable(Time),
52
+ created_before: T.nilable(Time),
53
+ direction: T.nilable(WhopSDK::Direction::OrSymbol),
54
+ first: T.nilable(Integer),
55
+ last: T.nilable(Integer),
56
+ request_options: WhopSDK::RequestOptions::OrHash
57
+ ).returns(T.attached_class)
58
+ end
59
+ def self.new(
60
+ # The ID of the company to list setup intents for
61
+ company_id:,
62
+ # Returns the elements in the list that come after the specified cursor.
63
+ after: nil,
64
+ # Returns the elements in the list that come before the specified cursor.
65
+ before: nil,
66
+ # The minimum creation date to filter by
67
+ created_after: nil,
68
+ # The maximum creation date to filter by
69
+ created_before: nil,
70
+ # The direction of the sort.
71
+ direction: nil,
72
+ # Returns the first _n_ elements from the list.
73
+ first: nil,
74
+ # Returns the last _n_ elements from the list.
75
+ last: nil,
76
+ request_options: {}
77
+ )
78
+ end
79
+
80
+ sig do
81
+ override.returns(
82
+ {
83
+ company_id: String,
84
+ after: T.nilable(String),
85
+ before: T.nilable(String),
86
+ created_after: T.nilable(Time),
87
+ created_before: T.nilable(Time),
88
+ direction: T.nilable(WhopSDK::Direction::OrSymbol),
89
+ first: T.nilable(Integer),
90
+ last: T.nilable(Integer),
91
+ request_options: WhopSDK::RequestOptions
92
+ }
93
+ )
94
+ end
95
+ def to_hash
96
+ end
97
+ end
98
+ end
99
+ end