whop_sdk 0.0.5 → 0.0.6

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 (60) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/README.md +4 -7
  4. data/lib/whop_sdk/client.rb +17 -6
  5. data/lib/whop_sdk/models/company.rb +1 -0
  6. data/lib/whop_sdk/models/dispute.rb +672 -0
  7. data/lib/whop_sdk/models/dispute_created_webhook_event.rb +48 -0
  8. data/lib/whop_sdk/models/dispute_list_params.rb +62 -0
  9. data/lib/whop_sdk/models/dispute_list_response.rb +187 -0
  10. data/lib/whop_sdk/models/dispute_retrieve_params.rb +14 -0
  11. data/lib/whop_sdk/models/dispute_statuses.rb +23 -0
  12. data/lib/whop_sdk/models/dispute_submit_evidence_params.rb +14 -0
  13. data/lib/whop_sdk/models/dispute_update_evidence_params.rb +342 -0
  14. data/lib/whop_sdk/models/dispute_updated_webhook_event.rb +48 -0
  15. data/lib/whop_sdk/models/notification_create_params.rb +88 -0
  16. data/lib/whop_sdk/models/notification_create_response.rb +19 -0
  17. data/lib/whop_sdk/models/unwrap_webhook_event.rb +5 -1
  18. data/lib/whop_sdk/models.rb +18 -0
  19. data/lib/whop_sdk/resources/disputes.rb +182 -0
  20. data/lib/whop_sdk/resources/notifications.rb +53 -0
  21. data/lib/whop_sdk/resources/webhooks.rb +1 -1
  22. data/lib/whop_sdk/version.rb +1 -1
  23. data/lib/whop_sdk.rb +13 -0
  24. data/rbi/whop_sdk/client.rbi +11 -2
  25. data/rbi/whop_sdk/models/company.rbi +2 -0
  26. data/rbi/whop_sdk/models/dispute.rbi +938 -0
  27. data/rbi/whop_sdk/models/dispute_created_webhook_event.rbi +72 -0
  28. data/rbi/whop_sdk/models/dispute_list_params.rbi +83 -0
  29. data/rbi/whop_sdk/models/dispute_list_response.rbi +287 -0
  30. data/rbi/whop_sdk/models/dispute_retrieve_params.rbi +27 -0
  31. data/rbi/whop_sdk/models/dispute_statuses.rbi +32 -0
  32. data/rbi/whop_sdk/models/dispute_submit_evidence_params.rbi +30 -0
  33. data/rbi/whop_sdk/models/dispute_update_evidence_params.rbi +566 -0
  34. data/rbi/whop_sdk/models/dispute_updated_webhook_event.rbi +72 -0
  35. data/rbi/whop_sdk/models/notification_create_params.rbi +113 -0
  36. data/rbi/whop_sdk/models/notification_create_response.rbi +31 -0
  37. data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +3 -1
  38. data/rbi/whop_sdk/models.rbi +18 -0
  39. data/rbi/whop_sdk/resources/disputes.rbi +194 -0
  40. data/rbi/whop_sdk/resources/notifications.rbi +54 -0
  41. data/rbi/whop_sdk/resources/webhooks.rbi +3 -1
  42. data/sig/whop_sdk/client.rbs +5 -1
  43. data/sig/whop_sdk/models/company.rbs +2 -0
  44. data/sig/whop_sdk/models/dispute.rbs +437 -0
  45. data/sig/whop_sdk/models/dispute_created_webhook_event.rbs +40 -0
  46. data/sig/whop_sdk/models/dispute_list_params.rbs +51 -0
  47. data/sig/whop_sdk/models/dispute_list_response.rbs +124 -0
  48. data/sig/whop_sdk/models/dispute_retrieve_params.rbs +15 -0
  49. data/sig/whop_sdk/models/dispute_statuses.rbs +30 -0
  50. data/sig/whop_sdk/models/dispute_submit_evidence_params.rbs +15 -0
  51. data/sig/whop_sdk/models/dispute_update_evidence_params.rbs +215 -0
  52. data/sig/whop_sdk/models/dispute_updated_webhook_event.rbs +40 -0
  53. data/sig/whop_sdk/models/notification_create_params.rbs +61 -0
  54. data/sig/whop_sdk/models/notification_create_response.rbs +13 -0
  55. data/sig/whop_sdk/models/unwrap_webhook_event.rbs +2 -0
  56. data/sig/whop_sdk/models.rbs +18 -0
  57. data/sig/whop_sdk/resources/disputes.rbs +46 -0
  58. data/sig/whop_sdk/resources/notifications.rbs +19 -0
  59. data/sig/whop_sdk/resources/webhooks.rbs +3 -1
  60. metadata +41 -2
@@ -0,0 +1,938 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class Dispute < WhopSDK::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias { T.any(WhopSDK::Dispute, WhopSDK::Internal::AnyHash) }
8
+
9
+ # The internal ID of the dispute.
10
+ sig { returns(String) }
11
+ attr_accessor :id
12
+
13
+ # An IP access log for the user from Whop.
14
+ sig { returns(T.nilable(String)) }
15
+ attr_accessor :access_activity_log
16
+
17
+ # The amount of the dispute (formatted).
18
+ sig { returns(Float) }
19
+ attr_accessor :amount
20
+
21
+ # The billing address of the user from their payment details.
22
+ sig { returns(T.nilable(String)) }
23
+ attr_accessor :billing_address
24
+
25
+ # The cancellation policy for this dispute
26
+ sig { returns(T.nilable(WhopSDK::Dispute::CancellationPolicyAttachment)) }
27
+ attr_reader :cancellation_policy_attachment
28
+
29
+ sig do
30
+ params(
31
+ cancellation_policy_attachment:
32
+ T.nilable(WhopSDK::Dispute::CancellationPolicyAttachment::OrHash)
33
+ ).void
34
+ end
35
+ attr_writer :cancellation_policy_attachment
36
+
37
+ # A cancellation policy disclosure from the company.
38
+ sig { returns(T.nilable(String)) }
39
+ attr_accessor :cancellation_policy_disclosure
40
+
41
+ # The company the dispute is against.
42
+ sig { returns(T.nilable(WhopSDK::Dispute::Company)) }
43
+ attr_reader :company
44
+
45
+ sig { params(company: T.nilable(WhopSDK::Dispute::Company::OrHash)).void }
46
+ attr_writer :company
47
+
48
+ # When it was made.
49
+ sig { returns(T.nilable(Time)) }
50
+ attr_accessor :created_at
51
+
52
+ # The currency of the dispute.
53
+ sig { returns(WhopSDK::Currency::TaggedSymbol) }
54
+ attr_accessor :currency
55
+
56
+ # The customer communication for this dispute
57
+ sig do
58
+ returns(T.nilable(WhopSDK::Dispute::CustomerCommunicationAttachment))
59
+ end
60
+ attr_reader :customer_communication_attachment
61
+
62
+ sig do
63
+ params(
64
+ customer_communication_attachment:
65
+ T.nilable(WhopSDK::Dispute::CustomerCommunicationAttachment::OrHash)
66
+ ).void
67
+ end
68
+ attr_writer :customer_communication_attachment
69
+
70
+ # The email of the customer from their payment details. This is submitted in the
71
+ # evidence packet to the payment processor. You can change it before submitting
72
+ # the dispute.
73
+ sig { returns(T.nilable(String)) }
74
+ attr_accessor :customer_email_address
75
+
76
+ # The name of the customer from their payment details. This is submitted in the
77
+ # evidence packet to the payment processor. You can change it before submitting
78
+ # the dispute.
79
+ sig { returns(T.nilable(String)) }
80
+ attr_accessor :customer_name
81
+
82
+ # Whether or not the dispute data can be edited.
83
+ sig { returns(T.nilable(T::Boolean)) }
84
+ attr_accessor :editable
85
+
86
+ # The last date the dispute is allow to be submitted by.
87
+ sig { returns(T.nilable(Time)) }
88
+ attr_accessor :needs_response_by
89
+
90
+ # Additional notes the company chooses to submit regarding the dispute.
91
+ sig { returns(T.nilable(String)) }
92
+ attr_accessor :notes
93
+
94
+ # The payment that got disputed
95
+ sig { returns(T.nilable(WhopSDK::Dispute::Payment)) }
96
+ attr_reader :payment
97
+
98
+ sig { params(payment: T.nilable(WhopSDK::Dispute::Payment::OrHash)).void }
99
+ attr_writer :payment
100
+
101
+ # The plan that got disputed
102
+ sig { returns(T.nilable(WhopSDK::Dispute::Plan)) }
103
+ attr_reader :plan
104
+
105
+ sig { params(plan: T.nilable(WhopSDK::Dispute::Plan::OrHash)).void }
106
+ attr_writer :plan
107
+
108
+ # The product that got disputed
109
+ sig { returns(T.nilable(WhopSDK::Dispute::Product)) }
110
+ attr_reader :product
111
+
112
+ sig { params(product: T.nilable(WhopSDK::Dispute::Product::OrHash)).void }
113
+ attr_writer :product
114
+
115
+ # The description of the product from the company.
116
+ sig { returns(T.nilable(String)) }
117
+ attr_accessor :product_description
118
+
119
+ # The reason for the dispute
120
+ sig { returns(T.nilable(String)) }
121
+ attr_accessor :reason
122
+
123
+ # The refund policy for this dispute
124
+ sig { returns(T.nilable(WhopSDK::Dispute::RefundPolicyAttachment)) }
125
+ attr_reader :refund_policy_attachment
126
+
127
+ sig do
128
+ params(
129
+ refund_policy_attachment:
130
+ T.nilable(WhopSDK::Dispute::RefundPolicyAttachment::OrHash)
131
+ ).void
132
+ end
133
+ attr_writer :refund_policy_attachment
134
+
135
+ # A refund policy disclosure from the company.
136
+ sig { returns(T.nilable(String)) }
137
+ attr_accessor :refund_policy_disclosure
138
+
139
+ # A description on why the refund is being refused by the company.
140
+ sig { returns(T.nilable(String)) }
141
+ attr_accessor :refund_refusal_explanation
142
+
143
+ # When the product was delivered by the company.
144
+ sig { returns(T.nilable(String)) }
145
+ attr_accessor :service_date
146
+
147
+ # The status of the dispute (mimics stripe's dispute status).
148
+ sig { returns(WhopSDK::DisputeStatuses::TaggedSymbol) }
149
+ attr_accessor :status
150
+
151
+ # An attachment that did not fit into the other categories
152
+ sig { returns(T.nilable(WhopSDK::Dispute::UncategorizedAttachment)) }
153
+ attr_reader :uncategorized_attachment
154
+
155
+ sig do
156
+ params(
157
+ uncategorized_attachment:
158
+ T.nilable(WhopSDK::Dispute::UncategorizedAttachment::OrHash)
159
+ ).void
160
+ end
161
+ attr_writer :uncategorized_attachment
162
+
163
+ # Whether or not the dispute is a Visa Rapid Dispute Resolution.
164
+ sig { returns(T::Boolean) }
165
+ attr_accessor :visa_rdr
166
+
167
+ # An object representing a dispute against a company.
168
+ sig do
169
+ params(
170
+ id: String,
171
+ access_activity_log: T.nilable(String),
172
+ amount: Float,
173
+ billing_address: T.nilable(String),
174
+ cancellation_policy_attachment:
175
+ T.nilable(WhopSDK::Dispute::CancellationPolicyAttachment::OrHash),
176
+ cancellation_policy_disclosure: T.nilable(String),
177
+ company: T.nilable(WhopSDK::Dispute::Company::OrHash),
178
+ created_at: T.nilable(Time),
179
+ currency: WhopSDK::Currency::OrSymbol,
180
+ customer_communication_attachment:
181
+ T.nilable(
182
+ WhopSDK::Dispute::CustomerCommunicationAttachment::OrHash
183
+ ),
184
+ customer_email_address: T.nilable(String),
185
+ customer_name: T.nilable(String),
186
+ editable: T.nilable(T::Boolean),
187
+ needs_response_by: T.nilable(Time),
188
+ notes: T.nilable(String),
189
+ payment: T.nilable(WhopSDK::Dispute::Payment::OrHash),
190
+ plan: T.nilable(WhopSDK::Dispute::Plan::OrHash),
191
+ product: T.nilable(WhopSDK::Dispute::Product::OrHash),
192
+ product_description: T.nilable(String),
193
+ reason: T.nilable(String),
194
+ refund_policy_attachment:
195
+ T.nilable(WhopSDK::Dispute::RefundPolicyAttachment::OrHash),
196
+ refund_policy_disclosure: T.nilable(String),
197
+ refund_refusal_explanation: T.nilable(String),
198
+ service_date: T.nilable(String),
199
+ status: WhopSDK::DisputeStatuses::OrSymbol,
200
+ uncategorized_attachment:
201
+ T.nilable(WhopSDK::Dispute::UncategorizedAttachment::OrHash),
202
+ visa_rdr: T::Boolean
203
+ ).returns(T.attached_class)
204
+ end
205
+ def self.new(
206
+ # The internal ID of the dispute.
207
+ id:,
208
+ # An IP access log for the user from Whop.
209
+ access_activity_log:,
210
+ # The amount of the dispute (formatted).
211
+ amount:,
212
+ # The billing address of the user from their payment details.
213
+ billing_address:,
214
+ # The cancellation policy for this dispute
215
+ cancellation_policy_attachment:,
216
+ # A cancellation policy disclosure from the company.
217
+ cancellation_policy_disclosure:,
218
+ # The company the dispute is against.
219
+ company:,
220
+ # When it was made.
221
+ created_at:,
222
+ # The currency of the dispute.
223
+ currency:,
224
+ # The customer communication for this dispute
225
+ customer_communication_attachment:,
226
+ # The email of the customer from their payment details. This is submitted in the
227
+ # evidence packet to the payment processor. You can change it before submitting
228
+ # the dispute.
229
+ customer_email_address:,
230
+ # The name of the customer from their payment details. This is submitted in the
231
+ # evidence packet to the payment processor. You can change it before submitting
232
+ # the dispute.
233
+ customer_name:,
234
+ # Whether or not the dispute data can be edited.
235
+ editable:,
236
+ # The last date the dispute is allow to be submitted by.
237
+ needs_response_by:,
238
+ # Additional notes the company chooses to submit regarding the dispute.
239
+ notes:,
240
+ # The payment that got disputed
241
+ payment:,
242
+ # The plan that got disputed
243
+ plan:,
244
+ # The product that got disputed
245
+ product:,
246
+ # The description of the product from the company.
247
+ product_description:,
248
+ # The reason for the dispute
249
+ reason:,
250
+ # The refund policy for this dispute
251
+ refund_policy_attachment:,
252
+ # A refund policy disclosure from the company.
253
+ refund_policy_disclosure:,
254
+ # A description on why the refund is being refused by the company.
255
+ refund_refusal_explanation:,
256
+ # When the product was delivered by the company.
257
+ service_date:,
258
+ # The status of the dispute (mimics stripe's dispute status).
259
+ status:,
260
+ # An attachment that did not fit into the other categories
261
+ uncategorized_attachment:,
262
+ # Whether or not the dispute is a Visa Rapid Dispute Resolution.
263
+ visa_rdr:
264
+ )
265
+ end
266
+
267
+ sig do
268
+ override.returns(
269
+ {
270
+ id: String,
271
+ access_activity_log: T.nilable(String),
272
+ amount: Float,
273
+ billing_address: T.nilable(String),
274
+ cancellation_policy_attachment:
275
+ T.nilable(WhopSDK::Dispute::CancellationPolicyAttachment),
276
+ cancellation_policy_disclosure: T.nilable(String),
277
+ company: T.nilable(WhopSDK::Dispute::Company),
278
+ created_at: T.nilable(Time),
279
+ currency: WhopSDK::Currency::TaggedSymbol,
280
+ customer_communication_attachment:
281
+ T.nilable(WhopSDK::Dispute::CustomerCommunicationAttachment),
282
+ customer_email_address: T.nilable(String),
283
+ customer_name: T.nilable(String),
284
+ editable: T.nilable(T::Boolean),
285
+ needs_response_by: T.nilable(Time),
286
+ notes: T.nilable(String),
287
+ payment: T.nilable(WhopSDK::Dispute::Payment),
288
+ plan: T.nilable(WhopSDK::Dispute::Plan),
289
+ product: T.nilable(WhopSDK::Dispute::Product),
290
+ product_description: T.nilable(String),
291
+ reason: T.nilable(String),
292
+ refund_policy_attachment:
293
+ T.nilable(WhopSDK::Dispute::RefundPolicyAttachment),
294
+ refund_policy_disclosure: T.nilable(String),
295
+ refund_refusal_explanation: T.nilable(String),
296
+ service_date: T.nilable(String),
297
+ status: WhopSDK::DisputeStatuses::TaggedSymbol,
298
+ uncategorized_attachment:
299
+ T.nilable(WhopSDK::Dispute::UncategorizedAttachment),
300
+ visa_rdr: T::Boolean
301
+ }
302
+ )
303
+ end
304
+ def to_hash
305
+ end
306
+
307
+ class CancellationPolicyAttachment < WhopSDK::Internal::Type::BaseModel
308
+ OrHash =
309
+ T.type_alias do
310
+ T.any(
311
+ WhopSDK::Dispute::CancellationPolicyAttachment,
312
+ WhopSDK::Internal::AnyHash
313
+ )
314
+ end
315
+
316
+ # The ID of the attachment
317
+ sig { returns(String) }
318
+ attr_accessor :id
319
+
320
+ # The attachment's content type (e.g., image/jpg, video/mp4)
321
+ sig { returns(T.nilable(String)) }
322
+ attr_accessor :content_type
323
+
324
+ # The name of the file
325
+ sig { returns(T.nilable(String)) }
326
+ attr_accessor :filename
327
+
328
+ # This is the URL you use to render optimized attachments on the client. This
329
+ # should be used for apps.
330
+ sig { returns(T.nilable(String)) }
331
+ attr_accessor :url
332
+
333
+ # The cancellation policy for this dispute
334
+ sig do
335
+ params(
336
+ id: String,
337
+ content_type: T.nilable(String),
338
+ filename: T.nilable(String),
339
+ url: T.nilable(String)
340
+ ).returns(T.attached_class)
341
+ end
342
+ def self.new(
343
+ # The ID of the attachment
344
+ id:,
345
+ # The attachment's content type (e.g., image/jpg, video/mp4)
346
+ content_type:,
347
+ # The name of the file
348
+ filename:,
349
+ # This is the URL you use to render optimized attachments on the client. This
350
+ # should be used for apps.
351
+ url:
352
+ )
353
+ end
354
+
355
+ sig do
356
+ override.returns(
357
+ {
358
+ id: String,
359
+ content_type: T.nilable(String),
360
+ filename: T.nilable(String),
361
+ url: T.nilable(String)
362
+ }
363
+ )
364
+ end
365
+ def to_hash
366
+ end
367
+ end
368
+
369
+ class Company < WhopSDK::Internal::Type::BaseModel
370
+ OrHash =
371
+ T.type_alias do
372
+ T.any(WhopSDK::Dispute::Company, WhopSDK::Internal::AnyHash)
373
+ end
374
+
375
+ # The ID of the company
376
+ sig { returns(String) }
377
+ attr_accessor :id
378
+
379
+ # The written name of the company.
380
+ sig { returns(String) }
381
+ attr_accessor :title
382
+
383
+ # The company the dispute is against.
384
+ sig { params(id: String, title: String).returns(T.attached_class) }
385
+ def self.new(
386
+ # The ID of the company
387
+ id:,
388
+ # The written name of the company.
389
+ title:
390
+ )
391
+ end
392
+
393
+ sig { override.returns({ id: String, title: String }) }
394
+ def to_hash
395
+ end
396
+ end
397
+
398
+ class CustomerCommunicationAttachment < WhopSDK::Internal::Type::BaseModel
399
+ OrHash =
400
+ T.type_alias do
401
+ T.any(
402
+ WhopSDK::Dispute::CustomerCommunicationAttachment,
403
+ WhopSDK::Internal::AnyHash
404
+ )
405
+ end
406
+
407
+ # The ID of the attachment
408
+ sig { returns(String) }
409
+ attr_accessor :id
410
+
411
+ # The attachment's content type (e.g., image/jpg, video/mp4)
412
+ sig { returns(T.nilable(String)) }
413
+ attr_accessor :content_type
414
+
415
+ # The name of the file
416
+ sig { returns(T.nilable(String)) }
417
+ attr_accessor :filename
418
+
419
+ # This is the URL you use to render optimized attachments on the client. This
420
+ # should be used for apps.
421
+ sig { returns(T.nilable(String)) }
422
+ attr_accessor :url
423
+
424
+ # The customer communication for this dispute
425
+ sig do
426
+ params(
427
+ id: String,
428
+ content_type: T.nilable(String),
429
+ filename: T.nilable(String),
430
+ url: T.nilable(String)
431
+ ).returns(T.attached_class)
432
+ end
433
+ def self.new(
434
+ # The ID of the attachment
435
+ id:,
436
+ # The attachment's content type (e.g., image/jpg, video/mp4)
437
+ content_type:,
438
+ # The name of the file
439
+ filename:,
440
+ # This is the URL you use to render optimized attachments on the client. This
441
+ # should be used for apps.
442
+ url:
443
+ )
444
+ end
445
+
446
+ sig do
447
+ override.returns(
448
+ {
449
+ id: String,
450
+ content_type: T.nilable(String),
451
+ filename: T.nilable(String),
452
+ url: T.nilable(String)
453
+ }
454
+ )
455
+ end
456
+ def to_hash
457
+ end
458
+ end
459
+
460
+ class Payment < WhopSDK::Internal::Type::BaseModel
461
+ OrHash =
462
+ T.type_alias do
463
+ T.any(WhopSDK::Dispute::Payment, WhopSDK::Internal::AnyHash)
464
+ end
465
+
466
+ # The payment ID
467
+ sig { returns(String) }
468
+ attr_accessor :id
469
+
470
+ # The reason why a specific payment was billed
471
+ sig { returns(T.nilable(WhopSDK::BillingReasons::TaggedSymbol)) }
472
+ attr_accessor :billing_reason
473
+
474
+ # Possible card brands that a payment token can have
475
+ sig { returns(T.nilable(WhopSDK::CardBrands::TaggedSymbol)) }
476
+ attr_accessor :card_brand
477
+
478
+ # The last 4 digits of the card used to make the payment.
479
+ sig { returns(T.nilable(String)) }
480
+ attr_accessor :card_last4
481
+
482
+ # The datetime the payment was created
483
+ sig { returns(Time) }
484
+ attr_accessor :created_at
485
+
486
+ # The available currencies on the platform
487
+ sig { returns(T.nilable(WhopSDK::Currency::TaggedSymbol)) }
488
+ attr_accessor :currency
489
+
490
+ # When an alert came in that this transaction will be disputed
491
+ sig { returns(T.nilable(Time)) }
492
+ attr_accessor :dispute_alerted_at
493
+
494
+ # The member attached to this payment.
495
+ sig { returns(T.nilable(WhopSDK::Dispute::Payment::Member)) }
496
+ attr_reader :member
497
+
498
+ sig do
499
+ params(
500
+ member: T.nilable(WhopSDK::Dispute::Payment::Member::OrHash)
501
+ ).void
502
+ end
503
+ attr_writer :member
504
+
505
+ # The membership attached to this payment.
506
+ sig { returns(T.nilable(WhopSDK::Dispute::Payment::Membership)) }
507
+ attr_reader :membership
508
+
509
+ sig do
510
+ params(
511
+ membership: T.nilable(WhopSDK::Dispute::Payment::Membership::OrHash)
512
+ ).void
513
+ end
514
+ attr_writer :membership
515
+
516
+ # The datetime the payment was paid
517
+ sig { returns(T.nilable(Time)) }
518
+ attr_accessor :paid_at
519
+
520
+ # The different types of payment methods that can be used.
521
+ sig { returns(T.nilable(WhopSDK::PaymentMethodTypes::TaggedSymbol)) }
522
+ attr_accessor :payment_method_type
523
+
524
+ # The subtotal to show to the creator (excluding buyer fees).
525
+ sig { returns(T.nilable(Float)) }
526
+ attr_accessor :subtotal
527
+
528
+ # The total to show to the creator (excluding buyer fees).
529
+ sig { returns(T.nilable(Float)) }
530
+ attr_accessor :total
531
+
532
+ # The total in USD to show to the creator (excluding buyer fees).
533
+ sig { returns(T.nilable(Float)) }
534
+ attr_accessor :usd_total
535
+
536
+ # The user that made this payment.
537
+ sig { returns(T.nilable(WhopSDK::Dispute::Payment::User)) }
538
+ attr_reader :user
539
+
540
+ sig do
541
+ params(user: T.nilable(WhopSDK::Dispute::Payment::User::OrHash)).void
542
+ end
543
+ attr_writer :user
544
+
545
+ # The payment that got disputed
546
+ sig do
547
+ params(
548
+ id: String,
549
+ billing_reason: T.nilable(WhopSDK::BillingReasons::OrSymbol),
550
+ card_brand: T.nilable(WhopSDK::CardBrands::OrSymbol),
551
+ card_last4: T.nilable(String),
552
+ created_at: Time,
553
+ currency: T.nilable(WhopSDK::Currency::OrSymbol),
554
+ dispute_alerted_at: T.nilable(Time),
555
+ member: T.nilable(WhopSDK::Dispute::Payment::Member::OrHash),
556
+ membership:
557
+ T.nilable(WhopSDK::Dispute::Payment::Membership::OrHash),
558
+ paid_at: T.nilable(Time),
559
+ payment_method_type:
560
+ T.nilable(WhopSDK::PaymentMethodTypes::OrSymbol),
561
+ subtotal: T.nilable(Float),
562
+ total: T.nilable(Float),
563
+ usd_total: T.nilable(Float),
564
+ user: T.nilable(WhopSDK::Dispute::Payment::User::OrHash)
565
+ ).returns(T.attached_class)
566
+ end
567
+ def self.new(
568
+ # The payment ID
569
+ id:,
570
+ # The reason why a specific payment was billed
571
+ billing_reason:,
572
+ # Possible card brands that a payment token can have
573
+ card_brand:,
574
+ # The last 4 digits of the card used to make the payment.
575
+ card_last4:,
576
+ # The datetime the payment was created
577
+ created_at:,
578
+ # The available currencies on the platform
579
+ currency:,
580
+ # When an alert came in that this transaction will be disputed
581
+ dispute_alerted_at:,
582
+ # The member attached to this payment.
583
+ member:,
584
+ # The membership attached to this payment.
585
+ membership:,
586
+ # The datetime the payment was paid
587
+ paid_at:,
588
+ # The different types of payment methods that can be used.
589
+ payment_method_type:,
590
+ # The subtotal to show to the creator (excluding buyer fees).
591
+ subtotal:,
592
+ # The total to show to the creator (excluding buyer fees).
593
+ total:,
594
+ # The total in USD to show to the creator (excluding buyer fees).
595
+ usd_total:,
596
+ # The user that made this payment.
597
+ user:
598
+ )
599
+ end
600
+
601
+ sig do
602
+ override.returns(
603
+ {
604
+ id: String,
605
+ billing_reason: T.nilable(WhopSDK::BillingReasons::TaggedSymbol),
606
+ card_brand: T.nilable(WhopSDK::CardBrands::TaggedSymbol),
607
+ card_last4: T.nilable(String),
608
+ created_at: Time,
609
+ currency: T.nilable(WhopSDK::Currency::TaggedSymbol),
610
+ dispute_alerted_at: T.nilable(Time),
611
+ member: T.nilable(WhopSDK::Dispute::Payment::Member),
612
+ membership: T.nilable(WhopSDK::Dispute::Payment::Membership),
613
+ paid_at: T.nilable(Time),
614
+ payment_method_type:
615
+ T.nilable(WhopSDK::PaymentMethodTypes::TaggedSymbol),
616
+ subtotal: T.nilable(Float),
617
+ total: T.nilable(Float),
618
+ usd_total: T.nilable(Float),
619
+ user: T.nilable(WhopSDK::Dispute::Payment::User)
620
+ }
621
+ )
622
+ end
623
+ def to_hash
624
+ end
625
+
626
+ class Member < WhopSDK::Internal::Type::BaseModel
627
+ OrHash =
628
+ T.type_alias do
629
+ T.any(
630
+ WhopSDK::Dispute::Payment::Member,
631
+ WhopSDK::Internal::AnyHash
632
+ )
633
+ end
634
+
635
+ # The ID of the member
636
+ sig { returns(String) }
637
+ attr_accessor :id
638
+
639
+ # The phone number for the member, if available.
640
+ sig { returns(T.nilable(String)) }
641
+ attr_accessor :phone
642
+
643
+ # The member attached to this payment.
644
+ sig do
645
+ params(id: String, phone: T.nilable(String)).returns(
646
+ T.attached_class
647
+ )
648
+ end
649
+ def self.new(
650
+ # The ID of the member
651
+ id:,
652
+ # The phone number for the member, if available.
653
+ phone:
654
+ )
655
+ end
656
+
657
+ sig { override.returns({ id: String, phone: T.nilable(String) }) }
658
+ def to_hash
659
+ end
660
+ end
661
+
662
+ class Membership < WhopSDK::Internal::Type::BaseModel
663
+ OrHash =
664
+ T.type_alias do
665
+ T.any(
666
+ WhopSDK::Dispute::Payment::Membership,
667
+ WhopSDK::Internal::AnyHash
668
+ )
669
+ end
670
+
671
+ # The internal ID of the membership.
672
+ sig { returns(String) }
673
+ attr_accessor :id
674
+
675
+ # The state of the membership.
676
+ sig { returns(WhopSDK::MembershipStatus::TaggedSymbol) }
677
+ attr_accessor :status
678
+
679
+ # The membership attached to this payment.
680
+ sig do
681
+ params(
682
+ id: String,
683
+ status: WhopSDK::MembershipStatus::OrSymbol
684
+ ).returns(T.attached_class)
685
+ end
686
+ def self.new(
687
+ # The internal ID of the membership.
688
+ id:,
689
+ # The state of the membership.
690
+ status:
691
+ )
692
+ end
693
+
694
+ sig do
695
+ override.returns(
696
+ { id: String, status: WhopSDK::MembershipStatus::TaggedSymbol }
697
+ )
698
+ end
699
+ def to_hash
700
+ end
701
+ end
702
+
703
+ class User < WhopSDK::Internal::Type::BaseModel
704
+ OrHash =
705
+ T.type_alias do
706
+ T.any(WhopSDK::Dispute::Payment::User, WhopSDK::Internal::AnyHash)
707
+ end
708
+
709
+ # The internal ID of the user.
710
+ sig { returns(String) }
711
+ attr_accessor :id
712
+
713
+ # The email of the user
714
+ sig { returns(T.nilable(String)) }
715
+ attr_accessor :email
716
+
717
+ # The name of the user from their Whop account.
718
+ sig { returns(T.nilable(String)) }
719
+ attr_accessor :name
720
+
721
+ # The username of the user from their Whop account.
722
+ sig { returns(String) }
723
+ attr_accessor :username
724
+
725
+ # The user that made this payment.
726
+ sig do
727
+ params(
728
+ id: String,
729
+ email: T.nilable(String),
730
+ name: T.nilable(String),
731
+ username: String
732
+ ).returns(T.attached_class)
733
+ end
734
+ def self.new(
735
+ # The internal ID of the user.
736
+ id:,
737
+ # The email of the user
738
+ email:,
739
+ # The name of the user from their Whop account.
740
+ name:,
741
+ # The username of the user from their Whop account.
742
+ username:
743
+ )
744
+ end
745
+
746
+ sig do
747
+ override.returns(
748
+ {
749
+ id: String,
750
+ email: T.nilable(String),
751
+ name: T.nilable(String),
752
+ username: String
753
+ }
754
+ )
755
+ end
756
+ def to_hash
757
+ end
758
+ end
759
+ end
760
+
761
+ class Plan < WhopSDK::Internal::Type::BaseModel
762
+ OrHash =
763
+ T.type_alias do
764
+ T.any(WhopSDK::Dispute::Plan, WhopSDK::Internal::AnyHash)
765
+ end
766
+
767
+ # The internal ID of the plan.
768
+ sig { returns(String) }
769
+ attr_accessor :id
770
+
771
+ # The plan that got disputed
772
+ sig { params(id: String).returns(T.attached_class) }
773
+ def self.new(
774
+ # The internal ID of the plan.
775
+ id:
776
+ )
777
+ end
778
+
779
+ sig { override.returns({ id: String }) }
780
+ def to_hash
781
+ end
782
+ end
783
+
784
+ class Product < WhopSDK::Internal::Type::BaseModel
785
+ OrHash =
786
+ T.type_alias do
787
+ T.any(WhopSDK::Dispute::Product, WhopSDK::Internal::AnyHash)
788
+ end
789
+
790
+ # The internal ID of the public product.
791
+ sig { returns(String) }
792
+ attr_accessor :id
793
+
794
+ # The title of the product. Use for Whop 4.0.
795
+ sig { returns(String) }
796
+ attr_accessor :title
797
+
798
+ # The product that got disputed
799
+ sig { params(id: String, title: String).returns(T.attached_class) }
800
+ def self.new(
801
+ # The internal ID of the public product.
802
+ id:,
803
+ # The title of the product. Use for Whop 4.0.
804
+ title:
805
+ )
806
+ end
807
+
808
+ sig { override.returns({ id: String, title: String }) }
809
+ def to_hash
810
+ end
811
+ end
812
+
813
+ class RefundPolicyAttachment < WhopSDK::Internal::Type::BaseModel
814
+ OrHash =
815
+ T.type_alias do
816
+ T.any(
817
+ WhopSDK::Dispute::RefundPolicyAttachment,
818
+ WhopSDK::Internal::AnyHash
819
+ )
820
+ end
821
+
822
+ # The ID of the attachment
823
+ sig { returns(String) }
824
+ attr_accessor :id
825
+
826
+ # The attachment's content type (e.g., image/jpg, video/mp4)
827
+ sig { returns(T.nilable(String)) }
828
+ attr_accessor :content_type
829
+
830
+ # The name of the file
831
+ sig { returns(T.nilable(String)) }
832
+ attr_accessor :filename
833
+
834
+ # This is the URL you use to render optimized attachments on the client. This
835
+ # should be used for apps.
836
+ sig { returns(T.nilable(String)) }
837
+ attr_accessor :url
838
+
839
+ # The refund policy for this dispute
840
+ sig do
841
+ params(
842
+ id: String,
843
+ content_type: T.nilable(String),
844
+ filename: T.nilable(String),
845
+ url: T.nilable(String)
846
+ ).returns(T.attached_class)
847
+ end
848
+ def self.new(
849
+ # The ID of the attachment
850
+ id:,
851
+ # The attachment's content type (e.g., image/jpg, video/mp4)
852
+ content_type:,
853
+ # The name of the file
854
+ filename:,
855
+ # This is the URL you use to render optimized attachments on the client. This
856
+ # should be used for apps.
857
+ url:
858
+ )
859
+ end
860
+
861
+ sig do
862
+ override.returns(
863
+ {
864
+ id: String,
865
+ content_type: T.nilable(String),
866
+ filename: T.nilable(String),
867
+ url: T.nilable(String)
868
+ }
869
+ )
870
+ end
871
+ def to_hash
872
+ end
873
+ end
874
+
875
+ class UncategorizedAttachment < WhopSDK::Internal::Type::BaseModel
876
+ OrHash =
877
+ T.type_alias do
878
+ T.any(
879
+ WhopSDK::Dispute::UncategorizedAttachment,
880
+ WhopSDK::Internal::AnyHash
881
+ )
882
+ end
883
+
884
+ # The ID of the attachment
885
+ sig { returns(String) }
886
+ attr_accessor :id
887
+
888
+ # The attachment's content type (e.g., image/jpg, video/mp4)
889
+ sig { returns(T.nilable(String)) }
890
+ attr_accessor :content_type
891
+
892
+ # The name of the file
893
+ sig { returns(T.nilable(String)) }
894
+ attr_accessor :filename
895
+
896
+ # This is the URL you use to render optimized attachments on the client. This
897
+ # should be used for apps.
898
+ sig { returns(T.nilable(String)) }
899
+ attr_accessor :url
900
+
901
+ # An attachment that did not fit into the other categories
902
+ sig do
903
+ params(
904
+ id: String,
905
+ content_type: T.nilable(String),
906
+ filename: T.nilable(String),
907
+ url: T.nilable(String)
908
+ ).returns(T.attached_class)
909
+ end
910
+ def self.new(
911
+ # The ID of the attachment
912
+ id:,
913
+ # The attachment's content type (e.g., image/jpg, video/mp4)
914
+ content_type:,
915
+ # The name of the file
916
+ filename:,
917
+ # This is the URL you use to render optimized attachments on the client. This
918
+ # should be used for apps.
919
+ url:
920
+ )
921
+ end
922
+
923
+ sig do
924
+ override.returns(
925
+ {
926
+ id: String,
927
+ content_type: T.nilable(String),
928
+ filename: T.nilable(String),
929
+ url: T.nilable(String)
930
+ }
931
+ )
932
+ end
933
+ def to_hash
934
+ end
935
+ end
936
+ end
937
+ end
938
+ end