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,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 method to use for the payment. It must be connected to the
23
+ # Member being charged.
24
+ sig { returns(String) }
25
+ attr_accessor :payment_method_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_method_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 method to use for the payment. It must be connected to the
54
+ # Member being charged.
55
+ payment_method_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_method_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
@@ -118,6 +118,22 @@ module WhopSDK
118
118
  sig { returns(T.nilable(Time)) }
119
119
  attr_accessor :paid_at
120
120
 
121
+ # The payment method used for the payment, if available.
122
+ sig do
123
+ returns(T.nilable(WhopSDK::Models::PaymentListResponse::PaymentMethod))
124
+ end
125
+ attr_reader :payment_method
126
+
127
+ sig do
128
+ params(
129
+ payment_method:
130
+ T.nilable(
131
+ WhopSDK::Models::PaymentListResponse::PaymentMethod::OrHash
132
+ )
133
+ ).void
134
+ end
135
+ attr_writer :payment_method
136
+
121
137
  # The different types of payment methods that can be used.
122
138
  sig { returns(T.nilable(WhopSDK::PaymentMethodTypes::TaggedSymbol)) }
123
139
  attr_accessor :payment_method_type
@@ -240,6 +256,10 @@ module WhopSDK
240
256
  T.nilable(WhopSDK::Models::PaymentListResponse::Membership::OrHash),
241
257
  metadata: T.nilable(T::Hash[Symbol, T.anything]),
242
258
  paid_at: T.nilable(Time),
259
+ payment_method:
260
+ T.nilable(
261
+ WhopSDK::Models::PaymentListResponse::PaymentMethod::OrHash
262
+ ),
243
263
  payment_method_type: T.nilable(WhopSDK::PaymentMethodTypes::OrSymbol),
244
264
  plan: T.nilable(WhopSDK::Models::PaymentListResponse::Plan::OrHash),
245
265
  product:
@@ -295,6 +315,8 @@ module WhopSDK
295
315
  metadata:,
296
316
  # The datetime the payment was paid
297
317
  paid_at:,
318
+ # The payment method used for the payment, if available.
319
+ payment_method:,
298
320
  # The different types of payment methods that can be used.
299
321
  payment_method_type:,
300
322
  # The plan attached to this payment.
@@ -354,6 +376,8 @@ module WhopSDK
354
376
  T.nilable(WhopSDK::Models::PaymentListResponse::Membership),
355
377
  metadata: T.nilable(T::Hash[Symbol, T.anything]),
356
378
  paid_at: T.nilable(Time),
379
+ payment_method:
380
+ T.nilable(WhopSDK::Models::PaymentListResponse::PaymentMethod),
357
381
  payment_method_type:
358
382
  T.nilable(WhopSDK::PaymentMethodTypes::TaggedSymbol),
359
383
  plan: T.nilable(WhopSDK::Models::PaymentListResponse::Plan),
@@ -578,6 +602,146 @@ module WhopSDK
578
602
  end
579
603
  end
580
604
 
605
+ class PaymentMethod < WhopSDK::Internal::Type::BaseModel
606
+ OrHash =
607
+ T.type_alias do
608
+ T.any(
609
+ WhopSDK::Models::PaymentListResponse::PaymentMethod,
610
+ WhopSDK::Internal::AnyHash
611
+ )
612
+ end
613
+
614
+ # The ID of the payment method
615
+ sig { returns(String) }
616
+ attr_accessor :id
617
+
618
+ # The card data associated with the payment method, if its a debit or credit card.
619
+ sig do
620
+ returns(
621
+ T.nilable(WhopSDK::Models::PaymentListResponse::PaymentMethod::Card)
622
+ )
623
+ end
624
+ attr_reader :card
625
+
626
+ sig do
627
+ params(
628
+ card:
629
+ T.nilable(
630
+ WhopSDK::Models::PaymentListResponse::PaymentMethod::Card::OrHash
631
+ )
632
+ ).void
633
+ end
634
+ attr_writer :card
635
+
636
+ # The date and time the payment method was created
637
+ sig { returns(Time) }
638
+ attr_accessor :created_at
639
+
640
+ # The payment method type of the payment method
641
+ sig { returns(WhopSDK::PaymentMethodTypes::TaggedSymbol) }
642
+ attr_accessor :payment_method_type
643
+
644
+ # The payment method used for the payment, if available.
645
+ sig do
646
+ params(
647
+ id: String,
648
+ card:
649
+ T.nilable(
650
+ WhopSDK::Models::PaymentListResponse::PaymentMethod::Card::OrHash
651
+ ),
652
+ created_at: Time,
653
+ payment_method_type: WhopSDK::PaymentMethodTypes::OrSymbol
654
+ ).returns(T.attached_class)
655
+ end
656
+ def self.new(
657
+ # The ID of the payment method
658
+ id:,
659
+ # The card data associated with the payment method, if its a debit or credit card.
660
+ card:,
661
+ # The date and time the payment method was created
662
+ created_at:,
663
+ # The payment method type of the payment method
664
+ payment_method_type:
665
+ )
666
+ end
667
+
668
+ sig do
669
+ override.returns(
670
+ {
671
+ id: String,
672
+ card:
673
+ T.nilable(
674
+ WhopSDK::Models::PaymentListResponse::PaymentMethod::Card
675
+ ),
676
+ created_at: Time,
677
+ payment_method_type: WhopSDK::PaymentMethodTypes::TaggedSymbol
678
+ }
679
+ )
680
+ end
681
+ def to_hash
682
+ end
683
+
684
+ class Card < WhopSDK::Internal::Type::BaseModel
685
+ OrHash =
686
+ T.type_alias do
687
+ T.any(
688
+ WhopSDK::Models::PaymentListResponse::PaymentMethod::Card,
689
+ WhopSDK::Internal::AnyHash
690
+ )
691
+ end
692
+
693
+ # Possible card brands that a payment token can have
694
+ sig { returns(T.nilable(WhopSDK::CardBrands::TaggedSymbol)) }
695
+ attr_accessor :brand
696
+
697
+ # Card expiration month, like 03 for March.
698
+ sig { returns(T.nilable(Integer)) }
699
+ attr_accessor :exp_month
700
+
701
+ # Card expiration year, like 27 for 2027.
702
+ sig { returns(T.nilable(Integer)) }
703
+ attr_accessor :exp_year
704
+
705
+ # Last four digits of the card.
706
+ sig { returns(T.nilable(String)) }
707
+ attr_accessor :last4
708
+
709
+ # The card data associated with the payment method, if its a debit or credit card.
710
+ sig do
711
+ params(
712
+ brand: T.nilable(WhopSDK::CardBrands::OrSymbol),
713
+ exp_month: T.nilable(Integer),
714
+ exp_year: T.nilable(Integer),
715
+ last4: T.nilable(String)
716
+ ).returns(T.attached_class)
717
+ end
718
+ def self.new(
719
+ # Possible card brands that a payment token can have
720
+ brand:,
721
+ # Card expiration month, like 03 for March.
722
+ exp_month:,
723
+ # Card expiration year, like 27 for 2027.
724
+ exp_year:,
725
+ # Last four digits of the card.
726
+ last4:
727
+ )
728
+ end
729
+
730
+ sig do
731
+ override.returns(
732
+ {
733
+ brand: T.nilable(WhopSDK::CardBrands::TaggedSymbol),
734
+ exp_month: T.nilable(Integer),
735
+ exp_year: T.nilable(Integer),
736
+ last4: T.nilable(String)
737
+ }
738
+ )
739
+ end
740
+ def to_hash
741
+ end
742
+ end
743
+ end
744
+
581
745
  class Plan < WhopSDK::Internal::Type::BaseModel
582
746
  OrHash =
583
747
  T.type_alias do
@@ -0,0 +1,99 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class PaymentMethodListParams < 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::PaymentMethodListParams, WhopSDK::Internal::AnyHash)
12
+ end
13
+
14
+ # The ID of the Member to list payment methods 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 methods 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