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,384 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class PaymentCreateParams < 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::PaymentCreateParams, WhopSDK::Internal::AnyHash)
12
+ end
13
+
14
+ # The ID of the company to create the payment for.
15
+ sig { returns(String) }
16
+ attr_accessor :company_id
17
+
18
+ # The ID of the member to create the payment for.
19
+ sig { returns(String) }
20
+ attr_accessor :member_id
21
+
22
+ # The ID of the payment token to use for the payment. It must be connected to the
23
+ # Member being charged.
24
+ sig { returns(String) }
25
+ attr_accessor :payment_token_id
26
+
27
+ # Pass this object to create a new plan for this payment
28
+ sig { returns(WhopSDK::PaymentCreateParams::Plan) }
29
+ attr_reader :plan
30
+
31
+ sig { params(plan: WhopSDK::PaymentCreateParams::Plan::OrHash).void }
32
+ attr_writer :plan
33
+
34
+ # An ID of an existing plan to use for the payment.
35
+ sig { returns(String) }
36
+ attr_accessor :plan_id
37
+
38
+ sig do
39
+ params(
40
+ company_id: String,
41
+ member_id: String,
42
+ payment_token_id: String,
43
+ plan: WhopSDK::PaymentCreateParams::Plan::OrHash,
44
+ plan_id: String,
45
+ request_options: WhopSDK::RequestOptions::OrHash
46
+ ).returns(T.attached_class)
47
+ end
48
+ def self.new(
49
+ # The ID of the company to create the payment for.
50
+ company_id:,
51
+ # The ID of the member to create the payment for.
52
+ member_id:,
53
+ # The ID of the payment token to use for the payment. It must be connected to the
54
+ # Member being charged.
55
+ payment_token_id:,
56
+ # Pass this object to create a new plan for this payment
57
+ plan:,
58
+ # An ID of an existing plan to use for the payment.
59
+ plan_id:,
60
+ request_options: {}
61
+ )
62
+ end
63
+
64
+ sig do
65
+ override.returns(
66
+ {
67
+ company_id: String,
68
+ member_id: String,
69
+ payment_token_id: String,
70
+ plan: WhopSDK::PaymentCreateParams::Plan,
71
+ plan_id: String,
72
+ request_options: WhopSDK::RequestOptions
73
+ }
74
+ )
75
+ end
76
+ def to_hash
77
+ end
78
+
79
+ class Plan < WhopSDK::Internal::Type::BaseModel
80
+ OrHash =
81
+ T.type_alias do
82
+ T.any(
83
+ WhopSDK::PaymentCreateParams::Plan,
84
+ WhopSDK::Internal::AnyHash
85
+ )
86
+ end
87
+
88
+ # The respective currency identifier for the plan.
89
+ sig { returns(WhopSDK::Currency::OrSymbol) }
90
+ attr_accessor :currency
91
+
92
+ # The interval at which the plan charges (renewal plans).
93
+ sig { returns(T.nilable(Integer)) }
94
+ attr_accessor :billing_period
95
+
96
+ # The description of the plan.
97
+ sig { returns(T.nilable(String)) }
98
+ attr_accessor :description
99
+
100
+ # The interval at which the plan charges (expiration plans).
101
+ sig { returns(T.nilable(Integer)) }
102
+ attr_accessor :expiration_days
103
+
104
+ # Whether to force the creation of a new plan even if one with the same attributes
105
+ # already exists.
106
+ sig { returns(T.nilable(T::Boolean)) }
107
+ attr_accessor :force_create_new_plan
108
+
109
+ # An additional amount charged upon first purchase.
110
+ sig { returns(T.nilable(Float)) }
111
+ attr_accessor :initial_price
112
+
113
+ # A personal description or notes section for the business.
114
+ sig { returns(T.nilable(String)) }
115
+ attr_accessor :internal_notes
116
+
117
+ # The type of plan that can be attached to a product
118
+ sig { returns(T.nilable(WhopSDK::PlanType::OrSymbol)) }
119
+ attr_accessor :plan_type
120
+
121
+ # Pass this object to create a new product for this plan. We will use the product
122
+ # external identifier to find or create an existing product.
123
+ sig { returns(T.nilable(WhopSDK::PaymentCreateParams::Plan::Product)) }
124
+ attr_reader :product
125
+
126
+ sig do
127
+ params(
128
+ product:
129
+ T.nilable(WhopSDK::PaymentCreateParams::Plan::Product::OrHash)
130
+ ).void
131
+ end
132
+ attr_writer :product
133
+
134
+ # The product the plan is related to. Either this or product is required.
135
+ sig { returns(T.nilable(String)) }
136
+ attr_accessor :product_id
137
+
138
+ # The amount the customer is charged every billing period.
139
+ sig { returns(T.nilable(Float)) }
140
+ attr_accessor :renewal_price
141
+
142
+ # The title of the plan. This will be visible on the product page to customers.
143
+ sig { returns(T.nilable(String)) }
144
+ attr_accessor :title
145
+
146
+ # The number of free trial days added before a renewal plan.
147
+ sig { returns(T.nilable(Integer)) }
148
+ attr_accessor :trial_period_days
149
+
150
+ # Visibility of a resource
151
+ sig { returns(T.nilable(WhopSDK::Visibility::OrSymbol)) }
152
+ attr_accessor :visibility
153
+
154
+ # Pass this object to create a new plan for this payment
155
+ sig do
156
+ params(
157
+ currency: WhopSDK::Currency::OrSymbol,
158
+ billing_period: T.nilable(Integer),
159
+ description: T.nilable(String),
160
+ expiration_days: T.nilable(Integer),
161
+ force_create_new_plan: T.nilable(T::Boolean),
162
+ initial_price: T.nilable(Float),
163
+ internal_notes: T.nilable(String),
164
+ plan_type: T.nilable(WhopSDK::PlanType::OrSymbol),
165
+ product:
166
+ T.nilable(WhopSDK::PaymentCreateParams::Plan::Product::OrHash),
167
+ product_id: T.nilable(String),
168
+ renewal_price: T.nilable(Float),
169
+ title: T.nilable(String),
170
+ trial_period_days: T.nilable(Integer),
171
+ visibility: T.nilable(WhopSDK::Visibility::OrSymbol)
172
+ ).returns(T.attached_class)
173
+ end
174
+ def self.new(
175
+ # The respective currency identifier for the plan.
176
+ currency:,
177
+ # The interval at which the plan charges (renewal plans).
178
+ billing_period: nil,
179
+ # The description of the plan.
180
+ description: nil,
181
+ # The interval at which the plan charges (expiration plans).
182
+ expiration_days: nil,
183
+ # Whether to force the creation of a new plan even if one with the same attributes
184
+ # already exists.
185
+ force_create_new_plan: nil,
186
+ # An additional amount charged upon first purchase.
187
+ initial_price: nil,
188
+ # A personal description or notes section for the business.
189
+ internal_notes: nil,
190
+ # The type of plan that can be attached to a product
191
+ plan_type: nil,
192
+ # Pass this object to create a new product for this plan. We will use the product
193
+ # external identifier to find or create an existing product.
194
+ product: nil,
195
+ # The product the plan is related to. Either this or product is required.
196
+ product_id: nil,
197
+ # The amount the customer is charged every billing period.
198
+ renewal_price: nil,
199
+ # The title of the plan. This will be visible on the product page to customers.
200
+ title: nil,
201
+ # The number of free trial days added before a renewal plan.
202
+ trial_period_days: nil,
203
+ # Visibility of a resource
204
+ visibility: nil
205
+ )
206
+ end
207
+
208
+ sig do
209
+ override.returns(
210
+ {
211
+ currency: WhopSDK::Currency::OrSymbol,
212
+ billing_period: T.nilable(Integer),
213
+ description: T.nilable(String),
214
+ expiration_days: T.nilable(Integer),
215
+ force_create_new_plan: T.nilable(T::Boolean),
216
+ initial_price: T.nilable(Float),
217
+ internal_notes: T.nilable(String),
218
+ plan_type: T.nilable(WhopSDK::PlanType::OrSymbol),
219
+ product: T.nilable(WhopSDK::PaymentCreateParams::Plan::Product),
220
+ product_id: T.nilable(String),
221
+ renewal_price: T.nilable(Float),
222
+ title: T.nilable(String),
223
+ trial_period_days: T.nilable(Integer),
224
+ visibility: T.nilable(WhopSDK::Visibility::OrSymbol)
225
+ }
226
+ )
227
+ end
228
+ def to_hash
229
+ end
230
+
231
+ class Product < WhopSDK::Internal::Type::BaseModel
232
+ OrHash =
233
+ T.type_alias do
234
+ T.any(
235
+ WhopSDK::PaymentCreateParams::Plan::Product,
236
+ WhopSDK::Internal::AnyHash
237
+ )
238
+ end
239
+
240
+ # A unique ID used to find or create a product. When provided during creation, we
241
+ # will look for an existing product with this external identifier — if found, it
242
+ # will be updated; otherwise, a new product will be created.
243
+ sig { returns(String) }
244
+ attr_accessor :external_identifier
245
+
246
+ # The title of the product.
247
+ sig { returns(String) }
248
+ attr_accessor :title
249
+
250
+ # The different business types a company can be.
251
+ sig { returns(T.nilable(WhopSDK::BusinessTypes::OrSymbol)) }
252
+ attr_accessor :business_type
253
+
254
+ # Whether or not to collect shipping information at checkout from the customer.
255
+ sig { returns(T.nilable(T::Boolean)) }
256
+ attr_accessor :collect_shipping_address
257
+
258
+ # The custom statement descriptor for the product i.e. WHOP\*SPORTS, must be
259
+ # between 5 and 22 characters, contain at least one letter, and not contain any of
260
+ # the following characters: <, >, \, ', "
261
+ sig { returns(T.nilable(String)) }
262
+ attr_accessor :custom_statement_descriptor
263
+
264
+ # A written description of the product.
265
+ sig { returns(T.nilable(String)) }
266
+ attr_accessor :description
267
+
268
+ # The percentage of the revenue that goes to the global affiliate program.
269
+ sig { returns(T.nilable(Float)) }
270
+ attr_accessor :global_affiliate_percentage
271
+
272
+ # The different statuses of the global affiliate program for a product.
273
+ sig { returns(T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol)) }
274
+ attr_accessor :global_affiliate_status
275
+
276
+ # The headline of the product.
277
+ sig { returns(T.nilable(String)) }
278
+ attr_accessor :headline
279
+
280
+ # The different industry types a company can be in.
281
+ sig { returns(T.nilable(WhopSDK::IndustryTypes::OrSymbol)) }
282
+ attr_accessor :industry_type
283
+
284
+ # The ID of the product tax code to apply to this product.
285
+ sig { returns(T.nilable(String)) }
286
+ attr_accessor :product_tax_code_id
287
+
288
+ # The URL to redirect the customer to after a purchase.
289
+ sig { returns(T.nilable(String)) }
290
+ attr_accessor :redirect_purchase_url
291
+
292
+ # The route of the product.
293
+ sig { returns(T.nilable(String)) }
294
+ attr_accessor :route
295
+
296
+ # Visibility of a resource
297
+ sig { returns(T.nilable(WhopSDK::Visibility::OrSymbol)) }
298
+ attr_accessor :visibility
299
+
300
+ # Pass this object to create a new product for this plan. We will use the product
301
+ # external identifier to find or create an existing product.
302
+ sig do
303
+ params(
304
+ external_identifier: String,
305
+ title: String,
306
+ business_type: T.nilable(WhopSDK::BusinessTypes::OrSymbol),
307
+ collect_shipping_address: T.nilable(T::Boolean),
308
+ custom_statement_descriptor: T.nilable(String),
309
+ description: T.nilable(String),
310
+ global_affiliate_percentage: T.nilable(Float),
311
+ global_affiliate_status:
312
+ T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol),
313
+ headline: T.nilable(String),
314
+ industry_type: T.nilable(WhopSDK::IndustryTypes::OrSymbol),
315
+ product_tax_code_id: T.nilable(String),
316
+ redirect_purchase_url: T.nilable(String),
317
+ route: T.nilable(String),
318
+ visibility: T.nilable(WhopSDK::Visibility::OrSymbol)
319
+ ).returns(T.attached_class)
320
+ end
321
+ def self.new(
322
+ # A unique ID used to find or create a product. When provided during creation, we
323
+ # will look for an existing product with this external identifier — if found, it
324
+ # will be updated; otherwise, a new product will be created.
325
+ external_identifier:,
326
+ # The title of the product.
327
+ title:,
328
+ # The different business types a company can be.
329
+ business_type: nil,
330
+ # Whether or not to collect shipping information at checkout from the customer.
331
+ collect_shipping_address: nil,
332
+ # The custom statement descriptor for the product i.e. WHOP\*SPORTS, must be
333
+ # between 5 and 22 characters, contain at least one letter, and not contain any of
334
+ # the following characters: <, >, \, ', "
335
+ custom_statement_descriptor: nil,
336
+ # A written description of the product.
337
+ description: nil,
338
+ # The percentage of the revenue that goes to the global affiliate program.
339
+ global_affiliate_percentage: nil,
340
+ # The different statuses of the global affiliate program for a product.
341
+ global_affiliate_status: nil,
342
+ # The headline of the product.
343
+ headline: nil,
344
+ # The different industry types a company can be in.
345
+ industry_type: nil,
346
+ # The ID of the product tax code to apply to this product.
347
+ product_tax_code_id: nil,
348
+ # The URL to redirect the customer to after a purchase.
349
+ redirect_purchase_url: nil,
350
+ # The route of the product.
351
+ route: nil,
352
+ # Visibility of a resource
353
+ visibility: nil
354
+ )
355
+ end
356
+
357
+ sig do
358
+ override.returns(
359
+ {
360
+ external_identifier: String,
361
+ title: String,
362
+ business_type: T.nilable(WhopSDK::BusinessTypes::OrSymbol),
363
+ collect_shipping_address: T.nilable(T::Boolean),
364
+ custom_statement_descriptor: T.nilable(String),
365
+ description: T.nilable(String),
366
+ global_affiliate_percentage: T.nilable(Float),
367
+ global_affiliate_status:
368
+ T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol),
369
+ headline: T.nilable(String),
370
+ industry_type: T.nilable(WhopSDK::IndustryTypes::OrSymbol),
371
+ product_tax_code_id: T.nilable(String),
372
+ redirect_purchase_url: T.nilable(String),
373
+ route: T.nilable(String),
374
+ visibility: T.nilable(WhopSDK::Visibility::OrSymbol)
375
+ }
376
+ )
377
+ end
378
+ def to_hash
379
+ end
380
+ end
381
+ end
382
+ end
383
+ end
384
+ end
@@ -122,6 +122,22 @@ module WhopSDK
122
122
  sig { returns(T.nilable(WhopSDK::PaymentMethodTypes::TaggedSymbol)) }
123
123
  attr_accessor :payment_method_type
124
124
 
125
+ # The payment token used for the payment, if available.
126
+ sig do
127
+ returns(T.nilable(WhopSDK::Models::PaymentListResponse::PaymentToken))
128
+ end
129
+ attr_reader :payment_token
130
+
131
+ sig do
132
+ params(
133
+ payment_token:
134
+ T.nilable(
135
+ WhopSDK::Models::PaymentListResponse::PaymentToken::OrHash
136
+ )
137
+ ).void
138
+ end
139
+ attr_writer :payment_token
140
+
125
141
  # The plan attached to this payment.
126
142
  sig { returns(T.nilable(WhopSDK::Models::PaymentListResponse::Plan)) }
127
143
  attr_reader :plan
@@ -241,6 +257,10 @@ module WhopSDK
241
257
  metadata: T.nilable(T::Hash[Symbol, T.anything]),
242
258
  paid_at: T.nilable(Time),
243
259
  payment_method_type: T.nilable(WhopSDK::PaymentMethodTypes::OrSymbol),
260
+ payment_token:
261
+ T.nilable(
262
+ WhopSDK::Models::PaymentListResponse::PaymentToken::OrHash
263
+ ),
244
264
  plan: T.nilable(WhopSDK::Models::PaymentListResponse::Plan::OrHash),
245
265
  product:
246
266
  T.nilable(WhopSDK::Models::PaymentListResponse::Product::OrHash),
@@ -297,6 +317,8 @@ module WhopSDK
297
317
  paid_at:,
298
318
  # The different types of payment methods that can be used.
299
319
  payment_method_type:,
320
+ # The payment token used for the payment, if available.
321
+ payment_token:,
300
322
  # The plan attached to this payment.
301
323
  plan:,
302
324
  # The product this payment was made for
@@ -356,6 +378,8 @@ module WhopSDK
356
378
  paid_at: T.nilable(Time),
357
379
  payment_method_type:
358
380
  T.nilable(WhopSDK::PaymentMethodTypes::TaggedSymbol),
381
+ payment_token:
382
+ T.nilable(WhopSDK::Models::PaymentListResponse::PaymentToken),
359
383
  plan: T.nilable(WhopSDK::Models::PaymentListResponse::Plan),
360
384
  product: T.nilable(WhopSDK::Models::PaymentListResponse::Product),
361
385
  promo_code:
@@ -578,6 +602,149 @@ module WhopSDK
578
602
  end
579
603
  end
580
604
 
605
+ class PaymentToken < WhopSDK::Internal::Type::BaseModel
606
+ OrHash =
607
+ T.type_alias do
608
+ T.any(
609
+ WhopSDK::Models::PaymentListResponse::PaymentToken,
610
+ WhopSDK::Internal::AnyHash
611
+ )
612
+ end
613
+
614
+ # The ID of the payment token
615
+ sig { returns(String) }
616
+ attr_accessor :id
617
+
618
+ # The card data associated with the payment token, if its a debit or credit card
619
+ # token.
620
+ sig do
621
+ returns(
622
+ T.nilable(WhopSDK::Models::PaymentListResponse::PaymentToken::Card)
623
+ )
624
+ end
625
+ attr_reader :card
626
+
627
+ sig do
628
+ params(
629
+ card:
630
+ T.nilable(
631
+ WhopSDK::Models::PaymentListResponse::PaymentToken::Card::OrHash
632
+ )
633
+ ).void
634
+ end
635
+ attr_writer :card
636
+
637
+ # The date and time the payment token was created
638
+ sig { returns(Time) }
639
+ attr_accessor :created_at
640
+
641
+ # The payment method type of the payment token
642
+ sig { returns(WhopSDK::PaymentMethodTypes::TaggedSymbol) }
643
+ attr_accessor :payment_method_type
644
+
645
+ # The payment token used for the payment, if available.
646
+ sig do
647
+ params(
648
+ id: String,
649
+ card:
650
+ T.nilable(
651
+ WhopSDK::Models::PaymentListResponse::PaymentToken::Card::OrHash
652
+ ),
653
+ created_at: Time,
654
+ payment_method_type: WhopSDK::PaymentMethodTypes::OrSymbol
655
+ ).returns(T.attached_class)
656
+ end
657
+ def self.new(
658
+ # The ID of the payment token
659
+ id:,
660
+ # The card data associated with the payment token, if its a debit or credit card
661
+ # token.
662
+ card:,
663
+ # The date and time the payment token was created
664
+ created_at:,
665
+ # The payment method type of the payment token
666
+ payment_method_type:
667
+ )
668
+ end
669
+
670
+ sig do
671
+ override.returns(
672
+ {
673
+ id: String,
674
+ card:
675
+ T.nilable(
676
+ WhopSDK::Models::PaymentListResponse::PaymentToken::Card
677
+ ),
678
+ created_at: Time,
679
+ payment_method_type: WhopSDK::PaymentMethodTypes::TaggedSymbol
680
+ }
681
+ )
682
+ end
683
+ def to_hash
684
+ end
685
+
686
+ class Card < WhopSDK::Internal::Type::BaseModel
687
+ OrHash =
688
+ T.type_alias do
689
+ T.any(
690
+ WhopSDK::Models::PaymentListResponse::PaymentToken::Card,
691
+ WhopSDK::Internal::AnyHash
692
+ )
693
+ end
694
+
695
+ # Possible card brands that a payment token can have
696
+ sig { returns(T.nilable(WhopSDK::CardBrands::TaggedSymbol)) }
697
+ attr_accessor :brand
698
+
699
+ # Card expiration month, like 03 for March.
700
+ sig { returns(T.nilable(Integer)) }
701
+ attr_accessor :exp_month
702
+
703
+ # Card expiration year, like 27 for 2027.
704
+ sig { returns(T.nilable(Integer)) }
705
+ attr_accessor :exp_year
706
+
707
+ # Last four digits of the card.
708
+ sig { returns(T.nilable(String)) }
709
+ attr_accessor :last4
710
+
711
+ # The card data associated with the payment token, if its a debit or credit card
712
+ # token.
713
+ sig do
714
+ params(
715
+ brand: T.nilable(WhopSDK::CardBrands::OrSymbol),
716
+ exp_month: T.nilable(Integer),
717
+ exp_year: T.nilable(Integer),
718
+ last4: T.nilable(String)
719
+ ).returns(T.attached_class)
720
+ end
721
+ def self.new(
722
+ # Possible card brands that a payment token can have
723
+ brand:,
724
+ # Card expiration month, like 03 for March.
725
+ exp_month:,
726
+ # Card expiration year, like 27 for 2027.
727
+ exp_year:,
728
+ # Last four digits of the card.
729
+ last4:
730
+ )
731
+ end
732
+
733
+ sig do
734
+ override.returns(
735
+ {
736
+ brand: T.nilable(WhopSDK::CardBrands::TaggedSymbol),
737
+ exp_month: T.nilable(Integer),
738
+ exp_year: T.nilable(Integer),
739
+ last4: T.nilable(String)
740
+ }
741
+ )
742
+ end
743
+ def to_hash
744
+ end
745
+ end
746
+ end
747
+
581
748
  class Plan < WhopSDK::Internal::Type::BaseModel
582
749
  OrHash =
583
750
  T.type_alias do
@@ -0,0 +1,99 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class PaymentTokenListParams < 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::PaymentTokenListParams, WhopSDK::Internal::AnyHash)
12
+ end
13
+
14
+ # The ID of the Member to list payment tokens for
15
+ sig { returns(String) }
16
+ attr_accessor :member_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
+ member_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 Member to list payment tokens for
61
+ member_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
+ member_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