whop_sdk 0.0.9 → 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 (78) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/README.md +1 -1
  4. data/lib/whop_sdk/client.rb +8 -0
  5. data/lib/whop_sdk/models/app_build_create_params.rb +9 -1
  6. data/lib/whop_sdk/models/payment.rb +90 -1
  7. data/lib/whop_sdk/models/payment_create_params.rb +307 -0
  8. data/lib/whop_sdk/models/payment_list_response.rb +90 -1
  9. data/lib/whop_sdk/models/payment_token_list_params.rb +78 -0
  10. data/lib/whop_sdk/models/payment_token_list_response.rb +86 -0
  11. data/lib/whop_sdk/models/payment_token_retrieve_params.rb +22 -0
  12. data/lib/whop_sdk/models/payment_token_retrieve_response.rb +86 -0
  13. data/lib/whop_sdk/models/setup_intent.rb +253 -0
  14. data/lib/whop_sdk/models/setup_intent_canceled_webhook_event.rb +52 -0
  15. data/lib/whop_sdk/models/setup_intent_list_params.rb +78 -0
  16. data/lib/whop_sdk/models/setup_intent_list_response.rb +255 -0
  17. data/lib/whop_sdk/models/setup_intent_requires_action_webhook_event.rb +52 -0
  18. data/lib/whop_sdk/models/setup_intent_retrieve_params.rb +14 -0
  19. data/lib/whop_sdk/models/setup_intent_status.rb +18 -0
  20. data/lib/whop_sdk/models/setup_intent_succeeded_webhook_event.rb +52 -0
  21. data/lib/whop_sdk/models/unwrap_webhook_event.rb +7 -1
  22. data/lib/whop_sdk/models.rb +20 -0
  23. data/lib/whop_sdk/resources/app_builds.rb +3 -1
  24. data/lib/whop_sdk/resources/payment_tokens.rb +83 -0
  25. data/lib/whop_sdk/resources/payments.rb +48 -0
  26. data/lib/whop_sdk/resources/setup_intents.rb +83 -0
  27. data/lib/whop_sdk/resources/webhooks.rb +1 -1
  28. data/lib/whop_sdk/version.rb +1 -1
  29. data/lib/whop_sdk.rb +15 -0
  30. data/rbi/whop_sdk/client.rbi +6 -0
  31. data/rbi/whop_sdk/models/app_build_create_params.rbi +8 -0
  32. data/rbi/whop_sdk/models/payment.rbi +142 -0
  33. data/rbi/whop_sdk/models/payment_create_params.rbi +384 -0
  34. data/rbi/whop_sdk/models/payment_list_response.rbi +167 -0
  35. data/rbi/whop_sdk/models/payment_token_list_params.rbi +99 -0
  36. data/rbi/whop_sdk/models/payment_token_list_response.rbi +139 -0
  37. data/rbi/whop_sdk/models/payment_token_retrieve_params.rbi +40 -0
  38. data/rbi/whop_sdk/models/payment_token_retrieve_response.rbi +144 -0
  39. data/rbi/whop_sdk/models/setup_intent.rbi +412 -0
  40. data/rbi/whop_sdk/models/setup_intent_canceled_webhook_event.rbi +77 -0
  41. data/rbi/whop_sdk/models/setup_intent_list_params.rbi +99 -0
  42. data/rbi/whop_sdk/models/setup_intent_list_response.rbi +492 -0
  43. data/rbi/whop_sdk/models/setup_intent_requires_action_webhook_event.rbi +77 -0
  44. data/rbi/whop_sdk/models/setup_intent_retrieve_params.rbi +27 -0
  45. data/rbi/whop_sdk/models/setup_intent_status.rbi +25 -0
  46. data/rbi/whop_sdk/models/setup_intent_succeeded_webhook_event.rbi +77 -0
  47. data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +3 -0
  48. data/rbi/whop_sdk/models.rbi +23 -0
  49. data/rbi/whop_sdk/resources/app_builds.rbi +3 -0
  50. data/rbi/whop_sdk/resources/payment_tokens.rbi +76 -0
  51. data/rbi/whop_sdk/resources/payments.rbi +42 -0
  52. data/rbi/whop_sdk/resources/setup_intents.rbi +77 -0
  53. data/rbi/whop_sdk/resources/webhooks.rbi +3 -0
  54. data/sig/whop_sdk/client.rbs +4 -0
  55. data/sig/whop_sdk/models/app_build_create_params.rbs +5 -0
  56. data/sig/whop_sdk/models/payment.rbs +69 -0
  57. data/sig/whop_sdk/models/payment_create_params.rbs +210 -0
  58. data/sig/whop_sdk/models/payment_list_response.rbs +69 -0
  59. data/sig/whop_sdk/models/payment_token_list_params.rbs +61 -0
  60. data/sig/whop_sdk/models/payment_token_list_response.rbs +67 -0
  61. data/sig/whop_sdk/models/payment_token_retrieve_params.rbs +23 -0
  62. data/sig/whop_sdk/models/payment_token_retrieve_response.rbs +67 -0
  63. data/sig/whop_sdk/models/setup_intent.rbs +189 -0
  64. data/sig/whop_sdk/models/setup_intent_canceled_webhook_event.rbs +40 -0
  65. data/sig/whop_sdk/models/setup_intent_list_params.rbs +61 -0
  66. data/sig/whop_sdk/models/setup_intent_list_response.rbs +193 -0
  67. data/sig/whop_sdk/models/setup_intent_requires_action_webhook_event.rbs +40 -0
  68. data/sig/whop_sdk/models/setup_intent_retrieve_params.rbs +15 -0
  69. data/sig/whop_sdk/models/setup_intent_status.rbs +17 -0
  70. data/sig/whop_sdk/models/setup_intent_succeeded_webhook_event.rbs +40 -0
  71. data/sig/whop_sdk/models/unwrap_webhook_event.rbs +3 -0
  72. data/sig/whop_sdk/models.rbs +20 -0
  73. data/sig/whop_sdk/resources/app_builds.rbs +1 -0
  74. data/sig/whop_sdk/resources/payment_tokens.rbs +25 -0
  75. data/sig/whop_sdk/resources/payments.rbs +9 -0
  76. data/sig/whop_sdk/resources/setup_intents.rbs +24 -0
  77. data/sig/whop_sdk/resources/webhooks.rbs +3 -0
  78. metadata +47 -2
@@ -0,0 +1,492 @@
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 token created during the setup, if available.
79
+ sig do
80
+ returns(
81
+ T.nilable(WhopSDK::Models::SetupIntentListResponse::PaymentToken)
82
+ )
83
+ end
84
+ attr_reader :payment_token
85
+
86
+ sig do
87
+ params(
88
+ payment_token:
89
+ T.nilable(
90
+ WhopSDK::Models::SetupIntentListResponse::PaymentToken::OrHash
91
+ )
92
+ ).void
93
+ end
94
+ attr_writer :payment_token
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_token:
119
+ T.nilable(
120
+ WhopSDK::Models::SetupIntentListResponse::PaymentToken::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 token created during the setup, if available.
141
+ payment_token:,
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_token:
162
+ T.nilable(WhopSDK::Models::SetupIntentListResponse::PaymentToken),
163
+ status: WhopSDK::SetupIntentStatus::TaggedSymbol
164
+ }
165
+ )
166
+ end
167
+ def to_hash
168
+ end
169
+
170
+ class CheckoutConfiguration < WhopSDK::Internal::Type::BaseModel
171
+ OrHash =
172
+ T.type_alias do
173
+ T.any(
174
+ WhopSDK::Models::SetupIntentListResponse::CheckoutConfiguration,
175
+ WhopSDK::Internal::AnyHash
176
+ )
177
+ end
178
+
179
+ # The ID of the checkout configuration
180
+ sig { returns(String) }
181
+ attr_accessor :id
182
+
183
+ # The checkout configuration associated with the setup intent
184
+ sig { params(id: String).returns(T.attached_class) }
185
+ def self.new(
186
+ # The ID of the checkout configuration
187
+ id:
188
+ )
189
+ end
190
+
191
+ sig { override.returns({ id: String }) }
192
+ def to_hash
193
+ end
194
+ end
195
+
196
+ class Company < WhopSDK::Internal::Type::BaseModel
197
+ OrHash =
198
+ T.type_alias do
199
+ T.any(
200
+ WhopSDK::Models::SetupIntentListResponse::Company,
201
+ WhopSDK::Internal::AnyHash
202
+ )
203
+ end
204
+
205
+ # The ID (tag) of the company.
206
+ sig { returns(String) }
207
+ attr_accessor :id
208
+
209
+ # The company of the setup intent
210
+ sig { params(id: String).returns(T.attached_class) }
211
+ def self.new(
212
+ # The ID (tag) of the company.
213
+ id:
214
+ )
215
+ end
216
+
217
+ sig { override.returns({ id: String }) }
218
+ def to_hash
219
+ end
220
+ end
221
+
222
+ class Member < WhopSDK::Internal::Type::BaseModel
223
+ OrHash =
224
+ T.type_alias do
225
+ T.any(
226
+ WhopSDK::Models::SetupIntentListResponse::Member,
227
+ WhopSDK::Internal::AnyHash
228
+ )
229
+ end
230
+
231
+ # The ID of the member
232
+ sig { returns(String) }
233
+ attr_accessor :id
234
+
235
+ # The user for this member, if any.
236
+ sig do
237
+ returns(
238
+ T.nilable(WhopSDK::Models::SetupIntentListResponse::Member::User)
239
+ )
240
+ end
241
+ attr_reader :user
242
+
243
+ sig do
244
+ params(
245
+ user:
246
+ T.nilable(
247
+ WhopSDK::Models::SetupIntentListResponse::Member::User::OrHash
248
+ )
249
+ ).void
250
+ end
251
+ attr_writer :user
252
+
253
+ # The member connected to the setup intent
254
+ sig do
255
+ params(
256
+ id: String,
257
+ user:
258
+ T.nilable(
259
+ WhopSDK::Models::SetupIntentListResponse::Member::User::OrHash
260
+ )
261
+ ).returns(T.attached_class)
262
+ end
263
+ def self.new(
264
+ # The ID of the member
265
+ id:,
266
+ # The user for this member, if any.
267
+ user:
268
+ )
269
+ end
270
+
271
+ sig do
272
+ override.returns(
273
+ {
274
+ id: String,
275
+ user:
276
+ T.nilable(
277
+ WhopSDK::Models::SetupIntentListResponse::Member::User
278
+ )
279
+ }
280
+ )
281
+ end
282
+ def to_hash
283
+ end
284
+
285
+ class User < WhopSDK::Internal::Type::BaseModel
286
+ OrHash =
287
+ T.type_alias do
288
+ T.any(
289
+ WhopSDK::Models::SetupIntentListResponse::Member::User,
290
+ WhopSDK::Internal::AnyHash
291
+ )
292
+ end
293
+
294
+ # The internal ID of the user account.
295
+ sig { returns(String) }
296
+ attr_accessor :id
297
+
298
+ # The digital mailing address of the user.
299
+ sig { returns(T.nilable(String)) }
300
+ attr_accessor :email
301
+
302
+ # The user's full name.
303
+ sig { returns(T.nilable(String)) }
304
+ attr_accessor :name
305
+
306
+ # The whop username.
307
+ sig { returns(String) }
308
+ attr_accessor :username
309
+
310
+ # The user for this member, if any.
311
+ sig do
312
+ params(
313
+ id: String,
314
+ email: T.nilable(String),
315
+ name: T.nilable(String),
316
+ username: String
317
+ ).returns(T.attached_class)
318
+ end
319
+ def self.new(
320
+ # The internal ID of the user account.
321
+ id:,
322
+ # The digital mailing address of the user.
323
+ email:,
324
+ # The user's full name.
325
+ name:,
326
+ # The whop username.
327
+ username:
328
+ )
329
+ end
330
+
331
+ sig do
332
+ override.returns(
333
+ {
334
+ id: String,
335
+ email: T.nilable(String),
336
+ name: T.nilable(String),
337
+ username: String
338
+ }
339
+ )
340
+ end
341
+ def to_hash
342
+ end
343
+ end
344
+ end
345
+
346
+ class PaymentToken < WhopSDK::Internal::Type::BaseModel
347
+ OrHash =
348
+ T.type_alias do
349
+ T.any(
350
+ WhopSDK::Models::SetupIntentListResponse::PaymentToken,
351
+ WhopSDK::Internal::AnyHash
352
+ )
353
+ end
354
+
355
+ # The ID of the payment token
356
+ sig { returns(String) }
357
+ attr_accessor :id
358
+
359
+ # The card data associated with the payment token, if its a debit or credit card
360
+ # token.
361
+ sig do
362
+ returns(
363
+ T.nilable(
364
+ WhopSDK::Models::SetupIntentListResponse::PaymentToken::Card
365
+ )
366
+ )
367
+ end
368
+ attr_reader :card
369
+
370
+ sig do
371
+ params(
372
+ card:
373
+ T.nilable(
374
+ WhopSDK::Models::SetupIntentListResponse::PaymentToken::Card::OrHash
375
+ )
376
+ ).void
377
+ end
378
+ attr_writer :card
379
+
380
+ # The date and time the payment token was created
381
+ sig { returns(Time) }
382
+ attr_accessor :created_at
383
+
384
+ # The payment method type of the payment token
385
+ sig { returns(WhopSDK::PaymentMethodTypes::TaggedSymbol) }
386
+ attr_accessor :payment_method_type
387
+
388
+ # The payment token created during the setup, if available.
389
+ sig do
390
+ params(
391
+ id: String,
392
+ card:
393
+ T.nilable(
394
+ WhopSDK::Models::SetupIntentListResponse::PaymentToken::Card::OrHash
395
+ ),
396
+ created_at: Time,
397
+ payment_method_type: WhopSDK::PaymentMethodTypes::OrSymbol
398
+ ).returns(T.attached_class)
399
+ end
400
+ def self.new(
401
+ # The ID of the payment token
402
+ id:,
403
+ # The card data associated with the payment token, if its a debit or credit card
404
+ # token.
405
+ card:,
406
+ # The date and time the payment token was created
407
+ created_at:,
408
+ # The payment method type of the payment token
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::PaymentToken::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::PaymentToken::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 token, if its a debit or credit card
455
+ # token.
456
+ sig do
457
+ params(
458
+ brand: T.nilable(WhopSDK::CardBrands::OrSymbol),
459
+ exp_month: T.nilable(Integer),
460
+ exp_year: T.nilable(Integer),
461
+ last4: T.nilable(String)
462
+ ).returns(T.attached_class)
463
+ end
464
+ def self.new(
465
+ # Possible card brands that a payment token can have
466
+ brand:,
467
+ # Card expiration month, like 03 for March.
468
+ exp_month:,
469
+ # Card expiration year, like 27 for 2027.
470
+ exp_year:,
471
+ # Last four digits of the card.
472
+ last4:
473
+ )
474
+ end
475
+
476
+ sig do
477
+ override.returns(
478
+ {
479
+ brand: T.nilable(WhopSDK::CardBrands::TaggedSymbol),
480
+ exp_month: T.nilable(Integer),
481
+ exp_year: T.nilable(Integer),
482
+ last4: T.nilable(String)
483
+ }
484
+ )
485
+ end
486
+ def to_hash
487
+ end
488
+ end
489
+ end
490
+ end
491
+ end
492
+ 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,