whop_sdk 0.0.9 → 0.0.11

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 (85) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +1 -1
  4. data/lib/whop_sdk/client.rb +8 -0
  5. data/lib/whop_sdk/internal/type/union.rb +12 -0
  6. data/lib/whop_sdk/models/app_build_create_params.rb +9 -1
  7. data/lib/whop_sdk/models/invoice_create_params.rb +10 -1
  8. data/lib/whop_sdk/models/payment.rb +88 -1
  9. data/lib/whop_sdk/models/payment_create_params.rb +307 -0
  10. data/lib/whop_sdk/models/payment_list_response.rb +88 -1
  11. data/lib/whop_sdk/models/payment_method_list_params.rb +78 -0
  12. data/lib/whop_sdk/models/payment_method_list_response.rb +85 -0
  13. data/lib/whop_sdk/models/payment_method_retrieve_params.rb +22 -0
  14. data/lib/whop_sdk/models/payment_method_retrieve_response.rb +85 -0
  15. data/lib/whop_sdk/models/setup_intent.rb +251 -0
  16. data/lib/whop_sdk/models/setup_intent_canceled_webhook_event.rb +52 -0
  17. data/lib/whop_sdk/models/setup_intent_list_params.rb +78 -0
  18. data/lib/whop_sdk/models/setup_intent_list_response.rb +253 -0
  19. data/lib/whop_sdk/models/setup_intent_requires_action_webhook_event.rb +52 -0
  20. data/lib/whop_sdk/models/setup_intent_retrieve_params.rb +14 -0
  21. data/lib/whop_sdk/models/setup_intent_status.rb +18 -0
  22. data/lib/whop_sdk/models/setup_intent_succeeded_webhook_event.rb +52 -0
  23. data/lib/whop_sdk/models/unwrap_webhook_event.rb +28 -19
  24. data/lib/whop_sdk/models.rb +20 -0
  25. data/lib/whop_sdk/resources/app_builds.rb +3 -1
  26. data/lib/whop_sdk/resources/invoices.rb +3 -1
  27. data/lib/whop_sdk/resources/payment_methods.rb +91 -0
  28. data/lib/whop_sdk/resources/payments.rb +50 -0
  29. data/lib/whop_sdk/resources/setup_intents.rb +91 -0
  30. data/lib/whop_sdk/resources/webhooks.rb +1 -1
  31. data/lib/whop_sdk/version.rb +1 -1
  32. data/lib/whop_sdk.rb +15 -0
  33. data/rbi/whop_sdk/client.rbi +6 -0
  34. data/rbi/whop_sdk/models/app_build_create_params.rbi +8 -0
  35. data/rbi/whop_sdk/models/invoice_create_params.rbi +10 -0
  36. data/rbi/whop_sdk/models/payment.rbi +139 -0
  37. data/rbi/whop_sdk/models/payment_create_params.rbi +384 -0
  38. data/rbi/whop_sdk/models/payment_list_response.rbi +164 -0
  39. data/rbi/whop_sdk/models/payment_method_list_params.rbi +99 -0
  40. data/rbi/whop_sdk/models/payment_method_list_response.rbi +137 -0
  41. data/rbi/whop_sdk/models/payment_method_retrieve_params.rbi +43 -0
  42. data/rbi/whop_sdk/models/payment_method_retrieve_response.rbi +142 -0
  43. data/rbi/whop_sdk/models/setup_intent.rbi +410 -0
  44. data/rbi/whop_sdk/models/setup_intent_canceled_webhook_event.rbi +77 -0
  45. data/rbi/whop_sdk/models/setup_intent_list_params.rbi +99 -0
  46. data/rbi/whop_sdk/models/setup_intent_list_response.rbi +491 -0
  47. data/rbi/whop_sdk/models/setup_intent_requires_action_webhook_event.rbi +77 -0
  48. data/rbi/whop_sdk/models/setup_intent_retrieve_params.rbi +27 -0
  49. data/rbi/whop_sdk/models/setup_intent_status.rbi +25 -0
  50. data/rbi/whop_sdk/models/setup_intent_succeeded_webhook_event.rbi +77 -0
  51. data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +3 -0
  52. data/rbi/whop_sdk/models.rbi +23 -0
  53. data/rbi/whop_sdk/resources/app_builds.rbi +3 -0
  54. data/rbi/whop_sdk/resources/invoices.rbi +4 -0
  55. data/rbi/whop_sdk/resources/payment_methods.rbi +84 -0
  56. data/rbi/whop_sdk/resources/payments.rbi +44 -0
  57. data/rbi/whop_sdk/resources/setup_intents.rbi +85 -0
  58. data/rbi/whop_sdk/resources/webhooks.rbi +3 -0
  59. data/sig/whop_sdk/client.rbs +4 -0
  60. data/sig/whop_sdk/models/app_build_create_params.rbs +5 -0
  61. data/sig/whop_sdk/models/invoice_create_params.rbs +5 -0
  62. data/sig/whop_sdk/models/payment.rbs +69 -0
  63. data/sig/whop_sdk/models/payment_create_params.rbs +210 -0
  64. data/sig/whop_sdk/models/payment_list_response.rbs +69 -0
  65. data/sig/whop_sdk/models/payment_method_list_params.rbs +61 -0
  66. data/sig/whop_sdk/models/payment_method_list_response.rbs +67 -0
  67. data/sig/whop_sdk/models/payment_method_retrieve_params.rbs +23 -0
  68. data/sig/whop_sdk/models/payment_method_retrieve_response.rbs +67 -0
  69. data/sig/whop_sdk/models/setup_intent.rbs +189 -0
  70. data/sig/whop_sdk/models/setup_intent_canceled_webhook_event.rbs +40 -0
  71. data/sig/whop_sdk/models/setup_intent_list_params.rbs +61 -0
  72. data/sig/whop_sdk/models/setup_intent_list_response.rbs +193 -0
  73. data/sig/whop_sdk/models/setup_intent_requires_action_webhook_event.rbs +40 -0
  74. data/sig/whop_sdk/models/setup_intent_retrieve_params.rbs +15 -0
  75. data/sig/whop_sdk/models/setup_intent_status.rbs +17 -0
  76. data/sig/whop_sdk/models/setup_intent_succeeded_webhook_event.rbs +40 -0
  77. data/sig/whop_sdk/models/unwrap_webhook_event.rbs +3 -0
  78. data/sig/whop_sdk/models.rbs +20 -0
  79. data/sig/whop_sdk/resources/app_builds.rbs +1 -0
  80. data/sig/whop_sdk/resources/invoices.rbs +1 -0
  81. data/sig/whop_sdk/resources/payment_methods.rbs +25 -0
  82. data/sig/whop_sdk/resources/payments.rbs +9 -0
  83. data/sig/whop_sdk/resources/setup_intents.rbs +24 -0
  84. data/sig/whop_sdk/resources/webhooks.rbs +3 -0
  85. metadata +47 -2
@@ -0,0 +1,491 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class SetupIntentListResponse < WhopSDK::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ WhopSDK::Models::SetupIntentListResponse,
10
+ WhopSDK::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The setup intent ID
15
+ sig { returns(String) }
16
+ attr_accessor :id
17
+
18
+ # The checkout configuration associated with the setup intent
19
+ sig do
20
+ returns(
21
+ T.nilable(
22
+ WhopSDK::Models::SetupIntentListResponse::CheckoutConfiguration
23
+ )
24
+ )
25
+ end
26
+ attr_reader :checkout_configuration
27
+
28
+ sig do
29
+ params(
30
+ checkout_configuration:
31
+ T.nilable(
32
+ WhopSDK::Models::SetupIntentListResponse::CheckoutConfiguration::OrHash
33
+ )
34
+ ).void
35
+ end
36
+ attr_writer :checkout_configuration
37
+
38
+ # The company of the setup intent
39
+ sig do
40
+ returns(T.nilable(WhopSDK::Models::SetupIntentListResponse::Company))
41
+ end
42
+ attr_reader :company
43
+
44
+ sig do
45
+ params(
46
+ company:
47
+ T.nilable(WhopSDK::Models::SetupIntentListResponse::Company::OrHash)
48
+ ).void
49
+ end
50
+ attr_writer :company
51
+
52
+ # The datetime the payment was created
53
+ sig { returns(Time) }
54
+ attr_accessor :created_at
55
+
56
+ # The error message, if any.
57
+ sig { returns(T.nilable(String)) }
58
+ attr_accessor :error_message
59
+
60
+ # The member connected to the setup intent
61
+ sig do
62
+ returns(T.nilable(WhopSDK::Models::SetupIntentListResponse::Member))
63
+ end
64
+ attr_reader :member
65
+
66
+ sig do
67
+ params(
68
+ member:
69
+ T.nilable(WhopSDK::Models::SetupIntentListResponse::Member::OrHash)
70
+ ).void
71
+ end
72
+ attr_writer :member
73
+
74
+ # The metadata associated with the setup intent
75
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
76
+ attr_accessor :metadata
77
+
78
+ # The payment method created during the setup, if available.
79
+ sig do
80
+ returns(
81
+ T.nilable(WhopSDK::Models::SetupIntentListResponse::PaymentMethod)
82
+ )
83
+ end
84
+ attr_reader :payment_method
85
+
86
+ sig do
87
+ params(
88
+ payment_method:
89
+ T.nilable(
90
+ WhopSDK::Models::SetupIntentListResponse::PaymentMethod::OrHash
91
+ )
92
+ ).void
93
+ end
94
+ attr_writer :payment_method
95
+
96
+ # The status of the setup intent
97
+ sig { returns(WhopSDK::SetupIntentStatus::TaggedSymbol) }
98
+ attr_accessor :status
99
+
100
+ # An object representing a setup intent, which is a flow for allowing a customer
101
+ # to add a payment method to their account without making a purchase.
102
+ sig do
103
+ params(
104
+ id: String,
105
+ checkout_configuration:
106
+ T.nilable(
107
+ WhopSDK::Models::SetupIntentListResponse::CheckoutConfiguration::OrHash
108
+ ),
109
+ company:
110
+ T.nilable(
111
+ WhopSDK::Models::SetupIntentListResponse::Company::OrHash
112
+ ),
113
+ created_at: Time,
114
+ error_message: T.nilable(String),
115
+ member:
116
+ T.nilable(WhopSDK::Models::SetupIntentListResponse::Member::OrHash),
117
+ metadata: T.nilable(T::Hash[Symbol, T.anything]),
118
+ payment_method:
119
+ T.nilable(
120
+ WhopSDK::Models::SetupIntentListResponse::PaymentMethod::OrHash
121
+ ),
122
+ status: WhopSDK::SetupIntentStatus::OrSymbol
123
+ ).returns(T.attached_class)
124
+ end
125
+ def self.new(
126
+ # The setup intent ID
127
+ id:,
128
+ # The checkout configuration associated with the setup intent
129
+ checkout_configuration:,
130
+ # The company of the setup intent
131
+ company:,
132
+ # The datetime the payment was created
133
+ created_at:,
134
+ # The error message, if any.
135
+ error_message:,
136
+ # The member connected to the setup intent
137
+ member:,
138
+ # The metadata associated with the setup intent
139
+ metadata:,
140
+ # The payment method created during the setup, if available.
141
+ payment_method:,
142
+ # The status of the setup intent
143
+ status:
144
+ )
145
+ end
146
+
147
+ sig do
148
+ override.returns(
149
+ {
150
+ id: String,
151
+ checkout_configuration:
152
+ T.nilable(
153
+ WhopSDK::Models::SetupIntentListResponse::CheckoutConfiguration
154
+ ),
155
+ company:
156
+ T.nilable(WhopSDK::Models::SetupIntentListResponse::Company),
157
+ created_at: Time,
158
+ error_message: T.nilable(String),
159
+ member: T.nilable(WhopSDK::Models::SetupIntentListResponse::Member),
160
+ metadata: T.nilable(T::Hash[Symbol, T.anything]),
161
+ payment_method:
162
+ T.nilable(
163
+ WhopSDK::Models::SetupIntentListResponse::PaymentMethod
164
+ ),
165
+ status: WhopSDK::SetupIntentStatus::TaggedSymbol
166
+ }
167
+ )
168
+ end
169
+ def to_hash
170
+ end
171
+
172
+ class CheckoutConfiguration < WhopSDK::Internal::Type::BaseModel
173
+ OrHash =
174
+ T.type_alias do
175
+ T.any(
176
+ WhopSDK::Models::SetupIntentListResponse::CheckoutConfiguration,
177
+ WhopSDK::Internal::AnyHash
178
+ )
179
+ end
180
+
181
+ # The ID of the checkout configuration
182
+ sig { returns(String) }
183
+ attr_accessor :id
184
+
185
+ # The checkout configuration associated with the setup intent
186
+ sig { params(id: String).returns(T.attached_class) }
187
+ def self.new(
188
+ # The ID of the checkout configuration
189
+ id:
190
+ )
191
+ end
192
+
193
+ sig { override.returns({ id: String }) }
194
+ def to_hash
195
+ end
196
+ end
197
+
198
+ class Company < WhopSDK::Internal::Type::BaseModel
199
+ OrHash =
200
+ T.type_alias do
201
+ T.any(
202
+ WhopSDK::Models::SetupIntentListResponse::Company,
203
+ WhopSDK::Internal::AnyHash
204
+ )
205
+ end
206
+
207
+ # The ID (tag) of the company.
208
+ sig { returns(String) }
209
+ attr_accessor :id
210
+
211
+ # The company of the setup intent
212
+ sig { params(id: String).returns(T.attached_class) }
213
+ def self.new(
214
+ # The ID (tag) of the company.
215
+ id:
216
+ )
217
+ end
218
+
219
+ sig { override.returns({ id: String }) }
220
+ def to_hash
221
+ end
222
+ end
223
+
224
+ class Member < WhopSDK::Internal::Type::BaseModel
225
+ OrHash =
226
+ T.type_alias do
227
+ T.any(
228
+ WhopSDK::Models::SetupIntentListResponse::Member,
229
+ WhopSDK::Internal::AnyHash
230
+ )
231
+ end
232
+
233
+ # The ID of the member
234
+ sig { returns(String) }
235
+ attr_accessor :id
236
+
237
+ # The user for this member, if any.
238
+ sig do
239
+ returns(
240
+ T.nilable(WhopSDK::Models::SetupIntentListResponse::Member::User)
241
+ )
242
+ end
243
+ attr_reader :user
244
+
245
+ sig do
246
+ params(
247
+ user:
248
+ T.nilable(
249
+ WhopSDK::Models::SetupIntentListResponse::Member::User::OrHash
250
+ )
251
+ ).void
252
+ end
253
+ attr_writer :user
254
+
255
+ # The member connected to the setup intent
256
+ sig do
257
+ params(
258
+ id: String,
259
+ user:
260
+ T.nilable(
261
+ WhopSDK::Models::SetupIntentListResponse::Member::User::OrHash
262
+ )
263
+ ).returns(T.attached_class)
264
+ end
265
+ def self.new(
266
+ # The ID of the member
267
+ id:,
268
+ # The user for this member, if any.
269
+ user:
270
+ )
271
+ end
272
+
273
+ sig do
274
+ override.returns(
275
+ {
276
+ id: String,
277
+ user:
278
+ T.nilable(
279
+ WhopSDK::Models::SetupIntentListResponse::Member::User
280
+ )
281
+ }
282
+ )
283
+ end
284
+ def to_hash
285
+ end
286
+
287
+ class User < WhopSDK::Internal::Type::BaseModel
288
+ OrHash =
289
+ T.type_alias do
290
+ T.any(
291
+ WhopSDK::Models::SetupIntentListResponse::Member::User,
292
+ WhopSDK::Internal::AnyHash
293
+ )
294
+ end
295
+
296
+ # The internal ID of the user account.
297
+ sig { returns(String) }
298
+ attr_accessor :id
299
+
300
+ # The digital mailing address of the user.
301
+ sig { returns(T.nilable(String)) }
302
+ attr_accessor :email
303
+
304
+ # The user's full name.
305
+ sig { returns(T.nilable(String)) }
306
+ attr_accessor :name
307
+
308
+ # The whop username.
309
+ sig { returns(String) }
310
+ attr_accessor :username
311
+
312
+ # The user for this member, if any.
313
+ sig do
314
+ params(
315
+ id: String,
316
+ email: T.nilable(String),
317
+ name: T.nilable(String),
318
+ username: String
319
+ ).returns(T.attached_class)
320
+ end
321
+ def self.new(
322
+ # The internal ID of the user account.
323
+ id:,
324
+ # The digital mailing address of the user.
325
+ email:,
326
+ # The user's full name.
327
+ name:,
328
+ # The whop username.
329
+ username:
330
+ )
331
+ end
332
+
333
+ sig do
334
+ override.returns(
335
+ {
336
+ id: String,
337
+ email: T.nilable(String),
338
+ name: T.nilable(String),
339
+ username: String
340
+ }
341
+ )
342
+ end
343
+ def to_hash
344
+ end
345
+ end
346
+ end
347
+
348
+ class PaymentMethod < WhopSDK::Internal::Type::BaseModel
349
+ OrHash =
350
+ T.type_alias do
351
+ T.any(
352
+ WhopSDK::Models::SetupIntentListResponse::PaymentMethod,
353
+ WhopSDK::Internal::AnyHash
354
+ )
355
+ end
356
+
357
+ # The ID of the payment method
358
+ sig { returns(String) }
359
+ attr_accessor :id
360
+
361
+ # The card data associated with the payment method, if its a debit or credit card.
362
+ sig do
363
+ returns(
364
+ T.nilable(
365
+ WhopSDK::Models::SetupIntentListResponse::PaymentMethod::Card
366
+ )
367
+ )
368
+ end
369
+ attr_reader :card
370
+
371
+ sig do
372
+ params(
373
+ card:
374
+ T.nilable(
375
+ WhopSDK::Models::SetupIntentListResponse::PaymentMethod::Card::OrHash
376
+ )
377
+ ).void
378
+ end
379
+ attr_writer :card
380
+
381
+ # The date and time the payment method was created
382
+ sig { returns(Time) }
383
+ attr_accessor :created_at
384
+
385
+ # The payment method type of the payment method
386
+ sig { returns(WhopSDK::PaymentMethodTypes::TaggedSymbol) }
387
+ attr_accessor :payment_method_type
388
+
389
+ # The payment method created during the setup, if available.
390
+ sig do
391
+ params(
392
+ id: String,
393
+ card:
394
+ T.nilable(
395
+ WhopSDK::Models::SetupIntentListResponse::PaymentMethod::Card::OrHash
396
+ ),
397
+ created_at: Time,
398
+ payment_method_type: WhopSDK::PaymentMethodTypes::OrSymbol
399
+ ).returns(T.attached_class)
400
+ end
401
+ def self.new(
402
+ # The ID of the payment method
403
+ id:,
404
+ # The card data associated with the payment method, if its a debit or credit card.
405
+ card:,
406
+ # The date and time the payment method was created
407
+ created_at:,
408
+ # The payment method type of the payment method
409
+ payment_method_type:
410
+ )
411
+ end
412
+
413
+ sig do
414
+ override.returns(
415
+ {
416
+ id: String,
417
+ card:
418
+ T.nilable(
419
+ WhopSDK::Models::SetupIntentListResponse::PaymentMethod::Card
420
+ ),
421
+ created_at: Time,
422
+ payment_method_type: WhopSDK::PaymentMethodTypes::TaggedSymbol
423
+ }
424
+ )
425
+ end
426
+ def to_hash
427
+ end
428
+
429
+ class Card < WhopSDK::Internal::Type::BaseModel
430
+ OrHash =
431
+ T.type_alias do
432
+ T.any(
433
+ WhopSDK::Models::SetupIntentListResponse::PaymentMethod::Card,
434
+ WhopSDK::Internal::AnyHash
435
+ )
436
+ end
437
+
438
+ # Possible card brands that a payment token can have
439
+ sig { returns(T.nilable(WhopSDK::CardBrands::TaggedSymbol)) }
440
+ attr_accessor :brand
441
+
442
+ # Card expiration month, like 03 for March.
443
+ sig { returns(T.nilable(Integer)) }
444
+ attr_accessor :exp_month
445
+
446
+ # Card expiration year, like 27 for 2027.
447
+ sig { returns(T.nilable(Integer)) }
448
+ attr_accessor :exp_year
449
+
450
+ # Last four digits of the card.
451
+ sig { returns(T.nilable(String)) }
452
+ attr_accessor :last4
453
+
454
+ # The card data associated with the payment method, if its a debit or credit card.
455
+ sig do
456
+ params(
457
+ brand: T.nilable(WhopSDK::CardBrands::OrSymbol),
458
+ exp_month: T.nilable(Integer),
459
+ exp_year: T.nilable(Integer),
460
+ last4: T.nilable(String)
461
+ ).returns(T.attached_class)
462
+ end
463
+ def self.new(
464
+ # Possible card brands that a payment token can have
465
+ brand:,
466
+ # Card expiration month, like 03 for March.
467
+ exp_month:,
468
+ # Card expiration year, like 27 for 2027.
469
+ exp_year:,
470
+ # Last four digits of the card.
471
+ last4:
472
+ )
473
+ end
474
+
475
+ sig do
476
+ override.returns(
477
+ {
478
+ brand: T.nilable(WhopSDK::CardBrands::TaggedSymbol),
479
+ exp_month: T.nilable(Integer),
480
+ exp_year: T.nilable(Integer),
481
+ last4: T.nilable(String)
482
+ }
483
+ )
484
+ end
485
+ def to_hash
486
+ end
487
+ end
488
+ end
489
+ end
490
+ end
491
+ end
@@ -0,0 +1,77 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class SetupIntentRequiresActionWebhookEvent < WhopSDK::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ WhopSDK::SetupIntentRequiresActionWebhookEvent,
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.requires_action"
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,27 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class SetupIntentRetrieveParams < 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::SetupIntentRetrieveParams, WhopSDK::Internal::AnyHash)
12
+ end
13
+
14
+ sig do
15
+ params(request_options: WhopSDK::RequestOptions::OrHash).returns(
16
+ T.attached_class
17
+ )
18
+ end
19
+ def self.new(request_options: {})
20
+ end
21
+
22
+ sig { override.returns({ request_options: WhopSDK::RequestOptions }) }
23
+ def to_hash
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,25 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # The status of the setup intent.
6
+ module SetupIntentStatus
7
+ extend WhopSDK::Internal::Type::Enum
8
+
9
+ TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::SetupIntentStatus) }
10
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
11
+
12
+ PROCESSING = T.let(:processing, WhopSDK::SetupIntentStatus::TaggedSymbol)
13
+ SUCCEEDED = T.let(:succeeded, WhopSDK::SetupIntentStatus::TaggedSymbol)
14
+ CANCELED = T.let(:canceled, WhopSDK::SetupIntentStatus::TaggedSymbol)
15
+ REQUIRES_ACTION =
16
+ T.let(:requires_action, WhopSDK::SetupIntentStatus::TaggedSymbol)
17
+
18
+ sig do
19
+ override.returns(T::Array[WhopSDK::SetupIntentStatus::TaggedSymbol])
20
+ end
21
+ def self.values
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,77 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class SetupIntentSucceededWebhookEvent < WhopSDK::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ WhopSDK::SetupIntentSucceededWebhookEvent,
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.succeeded"
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
@@ -18,6 +18,9 @@ module WhopSDK
18
18
  WhopSDK::EntryApprovedWebhookEvent,
19
19
  WhopSDK::EntryDeniedWebhookEvent,
20
20
  WhopSDK::EntryDeletedWebhookEvent,
21
+ WhopSDK::SetupIntentRequiresActionWebhookEvent,
22
+ WhopSDK::SetupIntentSucceededWebhookEvent,
23
+ WhopSDK::SetupIntentCanceledWebhookEvent,
21
24
  WhopSDK::CourseLessonInteractionCompletedWebhookEvent,
22
25
  WhopSDK::PaymentSucceededWebhookEvent,
23
26
  WhopSDK::PaymentFailedWebhookEvent,