whop_sdk 0.0.15 → 0.0.16

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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +1 -1
  4. data/lib/whop_sdk/client.rb +4 -0
  5. data/lib/whop_sdk/models/course.rb +57 -1
  6. data/lib/whop_sdk/models/course_lesson_interaction.rb +23 -1
  7. data/lib/whop_sdk/models/course_lesson_interaction_list_item.rb +23 -1
  8. data/lib/whop_sdk/models/payment_list_fees_params.rb +46 -0
  9. data/lib/whop_sdk/models/payment_list_fees_response.rb +84 -0
  10. data/lib/whop_sdk/models/payment_method_list_response.rb +214 -76
  11. data/lib/whop_sdk/models/payment_method_retrieve_response.rb +214 -76
  12. data/lib/whop_sdk/models/payout_method_list_params.rb +54 -0
  13. data/lib/whop_sdk/models/payout_method_list_response.rb +95 -0
  14. data/lib/whop_sdk/models/withdrawal_create_params.rb +46 -0
  15. data/lib/whop_sdk/models/withdrawal_create_response.rb +275 -0
  16. data/lib/whop_sdk/models.rb +6 -0
  17. data/lib/whop_sdk/resources/payment_methods.rb +2 -2
  18. data/lib/whop_sdk/resources/payments.rb +35 -0
  19. data/lib/whop_sdk/resources/payout_methods.rb +49 -0
  20. data/lib/whop_sdk/resources/withdrawals.rb +34 -0
  21. data/lib/whop_sdk/version.rb +1 -1
  22. data/lib/whop_sdk.rb +7 -0
  23. data/rbi/whop_sdk/client.rbi +3 -0
  24. data/rbi/whop_sdk/models/course.rbi +115 -3
  25. data/rbi/whop_sdk/models/course_lesson_interaction.rbi +55 -2
  26. data/rbi/whop_sdk/models/course_lesson_interaction_list_item.rbi +60 -2
  27. data/rbi/whop_sdk/models/payment_list_fees_params.rbi +67 -0
  28. data/rbi/whop_sdk/models/payment_list_fees_response.rbi +239 -0
  29. data/rbi/whop_sdk/models/payment_method_list_response.rbi +305 -83
  30. data/rbi/whop_sdk/models/payment_method_retrieve_response.rbi +305 -88
  31. data/rbi/whop_sdk/models/payout_method_list_params.rbi +75 -0
  32. data/rbi/whop_sdk/models/payout_method_list_response.rbi +200 -0
  33. data/rbi/whop_sdk/models/withdrawal_create_params.rbi +67 -0
  34. data/rbi/whop_sdk/models/withdrawal_create_response.rbi +564 -0
  35. data/rbi/whop_sdk/models.rbi +6 -0
  36. data/rbi/whop_sdk/resources/payment_methods.rbi +2 -2
  37. data/rbi/whop_sdk/resources/payments.rbi +34 -0
  38. data/rbi/whop_sdk/resources/payout_methods.rbi +46 -0
  39. data/rbi/whop_sdk/resources/withdrawals.rbi +29 -0
  40. data/sig/whop_sdk/client.rbs +2 -0
  41. data/sig/whop_sdk/models/course.rbs +45 -3
  42. data/sig/whop_sdk/models/course_lesson_interaction.rbs +28 -3
  43. data/sig/whop_sdk/models/course_lesson_interaction_list_item.rbs +28 -3
  44. data/sig/whop_sdk/models/payment_list_fees_params.rbs +36 -0
  45. data/sig/whop_sdk/models/payment_list_fees_response.rbs +104 -0
  46. data/sig/whop_sdk/models/payment_method_list_response.rbs +149 -41
  47. data/sig/whop_sdk/models/payment_method_retrieve_response.rbs +149 -41
  48. data/sig/whop_sdk/models/payout_method_list_params.rbs +46 -0
  49. data/sig/whop_sdk/models/payout_method_list_response.rbs +83 -0
  50. data/sig/whop_sdk/models/withdrawal_create_params.rbs +41 -0
  51. data/sig/whop_sdk/models/withdrawal_create_response.rbs +243 -0
  52. data/sig/whop_sdk/models.rbs +6 -0
  53. data/sig/whop_sdk/resources/payment_methods.rbs +2 -2
  54. data/sig/whop_sdk/resources/payments.rbs +9 -0
  55. data/sig/whop_sdk/resources/payout_methods.rbs +16 -0
  56. data/sig/whop_sdk/resources/withdrawals.rbs +8 -0
  57. metadata +23 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4344ab01b285213d6082d33945609e80cae719fb8ab415e3bccc296e1ff29484
4
- data.tar.gz: d96cc8ec1739472bf325cc8f08328b2dfa77cf960ee186e215b7bce38c51e03d
3
+ metadata.gz: 384f78bfdd29282dec0695c7d4a64ae180fefff482e40dd86e4988806e1ac903
4
+ data.tar.gz: c2951d3aabc53be6b74a39bfd06d7b404f7d7fdc9ef208ec175057de2f623ba7
5
5
  SHA512:
6
- metadata.gz: 9cbdc98042ba62ff6ee24e23e5692c854437b1aa43c611ddea3748afb3faeeb4d99d276a1e1557c6af33892342d883a7c0a5711990539ea5c710a1a2b13ad83e
7
- data.tar.gz: b450bb246eaef4ad7b7960075fa0e65b9a30fa9894c008ed5bdf7b7289aed7708c93253e4119204d7be2b05fdbd1299bef6904ec5cbfe99a579644e6b190f517
6
+ metadata.gz: 1e9a12bcb1769883fb79f3d7951b29a042c5231dd14d072ab765cc7dd90861ecdada74d7e4e2a7e48820c2d504346dcc80e1e3ba7da7b72ead0e9fa927f56dac
7
+ data.tar.gz: f590db1710e20be8431108918d0fce8b210dd8d22a9644a5a90aa3ddaf870c82efd4b05588aaff8d9b5920f6eb99efdccd1948c37138d5d79c4168fc958f0440
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.16 (2025-12-10)
4
+
5
+ Full Changelog: [v0.0.15...v0.0.16](https://github.com/whopio/whopsdk-ruby/compare/v0.0.15...v0.0.16)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([8d271a0](https://github.com/whopio/whopsdk-ruby/commit/8d271a07996ee1da957f7cacb1420384ceeaf461))
10
+ * **api:** api update ([632da47](https://github.com/whopio/whopsdk-ruby/commit/632da472b48818c5e06ce124fc2f7a09227d5bd3))
11
+ * **api:** api update ([d10e456](https://github.com/whopio/whopsdk-ruby/commit/d10e456c1e5fb78d5a884a5243801897b4b7b1ba))
12
+ * **api:** api update ([33c37b0](https://github.com/whopio/whopsdk-ruby/commit/33c37b03c16e3fc84ec50481ce839e6c9015bcd2))
13
+ * **api:** api update ([0a67aaa](https://github.com/whopio/whopsdk-ruby/commit/0a67aaab546a37771f5b81d4b3dc2cf1b2595fcb))
14
+ * **api:** api update ([5aec88b](https://github.com/whopio/whopsdk-ruby/commit/5aec88b7206515a15192bb3b40054039e7c201fa))
15
+ * **api:** manual updates ([be38d78](https://github.com/whopio/whopsdk-ruby/commit/be38d78525602730b56296de1f6be4781a56ec80))
16
+
3
17
  ## 0.0.15 (2025-12-09)
4
18
 
5
19
  Full Changelog: [v0.0.14...v0.0.15](https://github.com/whopio/whopsdk-ruby/compare/v0.0.14...v0.0.15)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "whop_sdk", "~> 0.0.15"
20
+ gem "whop_sdk", "~> 0.0.16"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -144,6 +144,9 @@ module WhopSDK
144
144
  # @return [WhopSDK::Resources::FeeMarkups]
145
145
  attr_reader :fee_markups
146
146
 
147
+ # @return [WhopSDK::Resources::PayoutMethods]
148
+ attr_reader :payout_methods
149
+
147
150
  # @api private
148
151
  #
149
152
  # @return [Hash{String=>String}]
@@ -241,6 +244,7 @@ module WhopSDK
241
244
  @setup_intents = WhopSDK::Resources::SetupIntents.new(client: self)
242
245
  @payment_methods = WhopSDK::Resources::PaymentMethods.new(client: self)
243
246
  @fee_markups = WhopSDK::Resources::FeeMarkups.new(client: self)
247
+ @payout_methods = WhopSDK::Resources::PayoutMethods.new(client: self)
244
248
  end
245
249
 
246
250
  # Verifies a Whop user token
@@ -181,13 +181,25 @@ module WhopSDK
181
181
  # @return [Integer]
182
182
  required :order, Integer
183
183
 
184
+ # @!attribute thumbnail
185
+ # The thumbnail for the lesson
186
+ #
187
+ # @return [WhopSDK::Models::Course::Chapter::Lesson::Thumbnail, nil]
188
+ required :thumbnail, -> { WhopSDK::Course::Chapter::Lesson::Thumbnail }, nil?: true
189
+
184
190
  # @!attribute title
185
191
  # The title of the lesson
186
192
  #
187
193
  # @return [String]
188
194
  required :title, String
189
195
 
190
- # @!method initialize(id:, lesson_type:, order:, title:)
196
+ # @!attribute video_asset
197
+ # The associated Mux asset for video lessons
198
+ #
199
+ # @return [WhopSDK::Models::Course::Chapter::Lesson::VideoAsset, nil]
200
+ required :video_asset, -> { WhopSDK::Course::Chapter::Lesson::VideoAsset }, nil?: true
201
+
202
+ # @!method initialize(id:, lesson_type:, order:, thumbnail:, title:, video_asset:)
191
203
  # A lesson from the courses app
192
204
  #
193
205
  # @param id [String] The ID of the lesson
@@ -196,7 +208,51 @@ module WhopSDK
196
208
  #
197
209
  # @param order [Integer] The order of the lesson within its chapter
198
210
  #
211
+ # @param thumbnail [WhopSDK::Models::Course::Chapter::Lesson::Thumbnail, nil] The thumbnail for the lesson
212
+ #
199
213
  # @param title [String] The title of the lesson
214
+ #
215
+ # @param video_asset [WhopSDK::Models::Course::Chapter::Lesson::VideoAsset, nil] The associated Mux asset for video lessons
216
+
217
+ # @see WhopSDK::Models::Course::Chapter::Lesson#thumbnail
218
+ class Thumbnail < WhopSDK::Internal::Type::BaseModel
219
+ # @!attribute url
220
+ # This is the URL you use to render optimized attachments on the client. This
221
+ # should be used for apps.
222
+ #
223
+ # @return [String, nil]
224
+ required :url, String, nil?: true
225
+
226
+ # @!method initialize(url:)
227
+ # Some parameter documentations has been truncated, see
228
+ # {WhopSDK::Models::Course::Chapter::Lesson::Thumbnail} for more details.
229
+ #
230
+ # The thumbnail for the lesson
231
+ #
232
+ # @param url [String, nil] This is the URL you use to render optimized attachments on the client. This shou
233
+ end
234
+
235
+ # @see WhopSDK::Models::Course::Chapter::Lesson#video_asset
236
+ class VideoAsset < WhopSDK::Internal::Type::BaseModel
237
+ # @!attribute duration_seconds
238
+ # The duration of the video in seconds
239
+ #
240
+ # @return [Integer, nil]
241
+ required :duration_seconds, Integer, nil?: true
242
+
243
+ # @!attribute signed_thumbnail_playback_token
244
+ # The signed thumbnail playback token of the Mux asset
245
+ #
246
+ # @return [String, nil]
247
+ required :signed_thumbnail_playback_token, String, nil?: true
248
+
249
+ # @!method initialize(duration_seconds:, signed_thumbnail_playback_token:)
250
+ # The associated Mux asset for video lessons
251
+ #
252
+ # @param duration_seconds [Integer, nil] The duration of the video in seconds
253
+ #
254
+ # @param signed_thumbnail_playback_token [String, nil] The signed thumbnail playback token of the Mux asset
255
+ end
200
256
  end
201
257
  end
202
258
 
@@ -106,18 +106,40 @@ module WhopSDK
106
106
  # @return [String]
107
107
  required :id, String
108
108
 
109
+ # @!attribute chapter
110
+ # The chapter this lesson belongs to
111
+ #
112
+ # @return [WhopSDK::Models::CourseLessonInteraction::Lesson::Chapter]
113
+ required :chapter, -> { WhopSDK::CourseLessonInteraction::Lesson::Chapter }
114
+
109
115
  # @!attribute title
110
116
  # The title of the lesson
111
117
  #
112
118
  # @return [String]
113
119
  required :title, String
114
120
 
115
- # @!method initialize(id:, title:)
121
+ # @!method initialize(id:, chapter:, title:)
116
122
  # The lesson this interaction is for
117
123
  #
118
124
  # @param id [String] The ID of the lesson
119
125
  #
126
+ # @param chapter [WhopSDK::Models::CourseLessonInteraction::Lesson::Chapter] The chapter this lesson belongs to
127
+ #
120
128
  # @param title [String] The title of the lesson
129
+
130
+ # @see WhopSDK::Models::CourseLessonInteraction::Lesson#chapter
131
+ class Chapter < WhopSDK::Internal::Type::BaseModel
132
+ # @!attribute id
133
+ # The ID of the chapter. Looks like chap_XXX
134
+ #
135
+ # @return [String]
136
+ required :id, String
137
+
138
+ # @!method initialize(id:)
139
+ # The chapter this lesson belongs to
140
+ #
141
+ # @param id [String] The ID of the chapter. Looks like chap_XXX
142
+ end
121
143
  end
122
144
 
123
145
  # @see WhopSDK::Models::CourseLessonInteraction#user
@@ -54,18 +54,40 @@ module WhopSDK
54
54
  # @return [String]
55
55
  required :id, String
56
56
 
57
+ # @!attribute chapter
58
+ # The chapter this lesson belongs to
59
+ #
60
+ # @return [WhopSDK::Models::CourseLessonInteractionListItem::Lesson::Chapter]
61
+ required :chapter, -> { WhopSDK::CourseLessonInteractionListItem::Lesson::Chapter }
62
+
57
63
  # @!attribute title
58
64
  # The title of the lesson
59
65
  #
60
66
  # @return [String]
61
67
  required :title, String
62
68
 
63
- # @!method initialize(id:, title:)
69
+ # @!method initialize(id:, chapter:, title:)
64
70
  # The lesson this interaction is for
65
71
  #
66
72
  # @param id [String] The ID of the lesson
67
73
  #
74
+ # @param chapter [WhopSDK::Models::CourseLessonInteractionListItem::Lesson::Chapter] The chapter this lesson belongs to
75
+ #
68
76
  # @param title [String] The title of the lesson
77
+
78
+ # @see WhopSDK::Models::CourseLessonInteractionListItem::Lesson#chapter
79
+ class Chapter < WhopSDK::Internal::Type::BaseModel
80
+ # @!attribute id
81
+ # The ID of the chapter. Looks like chap_XXX
82
+ #
83
+ # @return [String]
84
+ required :id, String
85
+
86
+ # @!method initialize(id:)
87
+ # The chapter this lesson belongs to
88
+ #
89
+ # @param id [String] The ID of the chapter. Looks like chap_XXX
90
+ end
69
91
  end
70
92
 
71
93
  # @see WhopSDK::Models::CourseLessonInteractionListItem#user
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::Payments#list_fees
6
+ class PaymentListFeesParams < WhopSDK::Internal::Type::BaseModel
7
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
8
+ include WhopSDK::Internal::Type::RequestParameters
9
+
10
+ # @!attribute after
11
+ # Returns the elements in the list that come after the specified cursor.
12
+ #
13
+ # @return [String, nil]
14
+ optional :after, String, nil?: true
15
+
16
+ # @!attribute before
17
+ # Returns the elements in the list that come before the specified cursor.
18
+ #
19
+ # @return [String, nil]
20
+ optional :before, String, nil?: true
21
+
22
+ # @!attribute first
23
+ # Returns the first _n_ elements from the list.
24
+ #
25
+ # @return [Integer, nil]
26
+ optional :first, Integer, nil?: true
27
+
28
+ # @!attribute last
29
+ # Returns the last _n_ elements from the list.
30
+ #
31
+ # @return [Integer, nil]
32
+ optional :last, Integer, nil?: true
33
+
34
+ # @!method initialize(after: nil, before: nil, first: nil, last: nil, request_options: {})
35
+ # @param after [String, nil] Returns the elements in the list that come after the specified cursor.
36
+ #
37
+ # @param before [String, nil] Returns the elements in the list that come before the specified cursor.
38
+ #
39
+ # @param first [Integer, nil] Returns the first _n_ elements from the list.
40
+ #
41
+ # @param last [Integer, nil] Returns the last _n_ elements from the list.
42
+ #
43
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::Payments#list_fees
6
+ class PaymentListFeesResponse < WhopSDK::Internal::Type::BaseModel
7
+ # @!attribute amount
8
+ # The value or amount to display for the fee.
9
+ #
10
+ # @return [Float]
11
+ required :amount, Float
12
+
13
+ # @!attribute currency
14
+ # The currency of the fee.
15
+ #
16
+ # @return [Symbol, WhopSDK::Models::Currency]
17
+ required :currency, enum: -> { WhopSDK::Currency }
18
+
19
+ # @!attribute name
20
+ # The label to display for the fee.
21
+ #
22
+ # @return [String]
23
+ required :name, String
24
+
25
+ # @!attribute type
26
+ # The specific origin of the fee, if applicable.
27
+ #
28
+ # @return [Symbol, WhopSDK::Models::PaymentListFeesResponse::Type]
29
+ required :type, enum: -> { WhopSDK::Models::PaymentListFeesResponse::Type }
30
+
31
+ # @!method initialize(amount:, currency:, name:, type:)
32
+ # Represents a fee related to a payment
33
+ #
34
+ # @param amount [Float] The value or amount to display for the fee.
35
+ #
36
+ # @param currency [Symbol, WhopSDK::Models::Currency] The currency of the fee.
37
+ #
38
+ # @param name [String] The label to display for the fee.
39
+ #
40
+ # @param type [Symbol, WhopSDK::Models::PaymentListFeesResponse::Type] The specific origin of the fee, if applicable.
41
+
42
+ # The specific origin of the fee, if applicable.
43
+ #
44
+ # @see WhopSDK::Models::PaymentListFeesResponse#type
45
+ module Type
46
+ extend WhopSDK::Internal::Type::Enum
47
+
48
+ STRIPE_DOMESTIC_PROCESSING_FEE = :stripe_domestic_processing_fee
49
+ STRIPE_INTERNATIONAL_PROCESSING_FEE = :stripe_international_processing_fee
50
+ STRIPE_FIXED_PROCESSING_FEE = :stripe_fixed_processing_fee
51
+ STRIPE_BILLING_FEE = :stripe_billing_fee
52
+ STRIPE_RADAR_FEE = :stripe_radar_fee
53
+ SALES_TAX_REMITTANCE = :sales_tax_remittance
54
+ SALES_TAX_REMITTANCE_REVERSAL = :sales_tax_remittance_reversal
55
+ STRIPE_SALES_TAX_FEE = :stripe_sales_tax_fee
56
+ WHOP_PROCESSING_FEE = :whop_processing_fee
57
+ MARKETPLACE_AFFILIATE_FEE = :marketplace_affiliate_fee
58
+ AFFILIATE_FEE = :affiliate_fee
59
+ CRYPTO_FEE = :crypto_fee
60
+ STRIPE_STANDARD_PROCESSING_FEE = :stripe_standard_processing_fee
61
+ PAYPAL_FEE = :paypal_fee
62
+ STRIPE_PAYOUT_FEE = :stripe_payout_fee
63
+ DISPUTE_FEE = :dispute_fee
64
+ DISPUTE_ALERT_FEE = :dispute_alert_fee
65
+ APPLE_PROCESSING_FEE = :apple_processing_fee
66
+ BUYER_FEE = :buyer_fee
67
+ SEZZLE_PROCESSING_FEE = :sezzle_processing_fee
68
+ SPLITIT_PROCESSING_FEE = :splitit_processing_fee
69
+ PLATFORM_BALANCE_PROCESSING_FEE = :platform_balance_processing_fee
70
+ PAYMENT_PROCESSING_PERCENTAGE_FEE = :payment_processing_percentage_fee
71
+ PAYMENT_PROCESSING_FIXED_FEE = :payment_processing_fixed_fee
72
+ CROSS_BORDER_PERCENTAGE_FEE = :cross_border_percentage_fee
73
+ FX_PERCENTAGE_FEE = :fx_percentage_fee
74
+ ORCHESTRATION_PERCENTAGE_FEE = :orchestration_percentage_fee
75
+ THREE_DS_FIXED_FEE = :three_ds_fixed_fee
76
+ BILLING_PERCENTAGE_FEE = :billing_percentage_fee
77
+ REVSHARE_PERCENTAGE_FEE = :revshare_percentage_fee
78
+
79
+ # @!method self.values
80
+ # @return [Array<Symbol>]
81
+ end
82
+ end
83
+ end
84
+ end
@@ -2,84 +2,222 @@
2
2
 
3
3
  module WhopSDK
4
4
  module Models
5
+ # A payment method with no additional properties
6
+ #
5
7
  # @see WhopSDK::Resources::PaymentMethods#list
6
- class PaymentMethodListResponse < WhopSDK::Internal::Type::BaseModel
7
- # @!attribute id
8
- # The ID of the payment method
9
- #
10
- # @return [String]
11
- required :id, String
12
-
13
- # @!attribute card
14
- # The card data associated with the payment method, if its a debit or credit card.
15
- #
16
- # @return [WhopSDK::Models::PaymentMethodListResponse::Card, nil]
17
- required :card, -> { WhopSDK::Models::PaymentMethodListResponse::Card }, nil?: true
18
-
19
- # @!attribute created_at
20
- # The date and time the payment method was created
21
- #
22
- # @return [Time]
23
- required :created_at, Time
24
-
25
- # @!attribute payment_method_type
26
- # The payment method type of the payment method
27
- #
28
- # @return [Symbol, WhopSDK::Models::PaymentMethodTypes]
29
- required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }
30
-
31
- # @!method initialize(id:, card:, created_at:, payment_method_type:)
32
- # Some parameter documentations has been truncated, see
33
- # {WhopSDK::Models::PaymentMethodListResponse} for more details.
34
- #
35
- # A stored payment method used to process payments. This could be a credit/debit
36
- # card, bank account, PayPal wallet, etc.
37
- #
38
- # @param id [String] The ID of the payment method
39
- #
40
- # @param card [WhopSDK::Models::PaymentMethodListResponse::Card, nil] The card data associated with the payment method, if its a debit or credit card.
41
- #
42
- # @param created_at [Time] The date and time the payment method was created
43
- #
44
- # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The payment method type of the payment method
45
-
46
- # @see WhopSDK::Models::PaymentMethodListResponse#card
47
- class Card < WhopSDK::Internal::Type::BaseModel
48
- # @!attribute brand
49
- # Possible card brands that a payment token can have
50
- #
51
- # @return [Symbol, WhopSDK::Models::CardBrands, nil]
52
- required :brand, enum: -> { WhopSDK::CardBrands }, nil?: true
53
-
54
- # @!attribute exp_month
55
- # Card expiration month, like 03 for March.
56
- #
57
- # @return [Integer, nil]
58
- required :exp_month, Integer, nil?: true
59
-
60
- # @!attribute exp_year
61
- # Card expiration year, like 27 for 2027.
62
- #
63
- # @return [Integer, nil]
64
- required :exp_year, Integer, nil?: true
65
-
66
- # @!attribute last4
67
- # Last four digits of the card.
68
- #
69
- # @return [String, nil]
70
- required :last4, String, nil?: true
71
-
72
- # @!method initialize(brand:, exp_month:, exp_year:, last4:)
73
- # The card data associated with the payment method, if its a debit or credit card.
74
- #
75
- # @param brand [Symbol, WhopSDK::Models::CardBrands, nil] Possible card brands that a payment token can have
76
- #
77
- # @param exp_month [Integer, nil] Card expiration month, like 03 for March.
78
- #
79
- # @param exp_year [Integer, nil] Card expiration year, like 27 for 2027.
80
- #
81
- # @param last4 [String, nil] Last four digits of the card.
8
+ module PaymentMethodListResponse
9
+ extend WhopSDK::Internal::Type::Union
10
+
11
+ discriminator :typename
12
+
13
+ # A payment method with no additional properties
14
+ variant :BasePaymentMethod, -> { WhopSDK::Models::PaymentMethodListResponse::BasePaymentMethod }
15
+
16
+ # The card for the payment method
17
+ variant :CardPaymentMethod, -> { WhopSDK::Models::PaymentMethodListResponse::CardPaymentMethod }
18
+
19
+ # The bank account for the payment method
20
+ variant :UsBankAccountPaymentMethod,
21
+ -> { WhopSDK::Models::PaymentMethodListResponse::UsBankAccountPaymentMethod }
22
+
23
+ class BasePaymentMethod < WhopSDK::Internal::Type::BaseModel
24
+ # @!attribute id
25
+ # The ID of the payment method
26
+ #
27
+ # @return [String]
28
+ required :id, String
29
+
30
+ # @!attribute created_at
31
+ # When the payment method was created
32
+ #
33
+ # @return [Time]
34
+ required :created_at, Time
35
+
36
+ # @!attribute payment_method_type
37
+ # The type of the payment method
38
+ #
39
+ # @return [Symbol, WhopSDK::Models::PaymentMethodTypes]
40
+ required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }
41
+
42
+ # @!attribute typename
43
+ # The typename of this object
44
+ #
45
+ # @return [Symbol, :BasePaymentMethod]
46
+ required :typename, const: :BasePaymentMethod
47
+
48
+ # @!method initialize(id:, created_at:, payment_method_type:, typename: :BasePaymentMethod)
49
+ # A payment method with no additional properties
50
+ #
51
+ # @param id [String] The ID of the payment method
52
+ #
53
+ # @param created_at [Time] When the payment method was created
54
+ #
55
+ # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The type of the payment method
56
+ #
57
+ # @param typename [Symbol, :BasePaymentMethod] The typename of this object
82
58
  end
59
+
60
+ class CardPaymentMethod < WhopSDK::Internal::Type::BaseModel
61
+ # @!attribute id
62
+ # The ID of the payment method
63
+ #
64
+ # @return [String]
65
+ required :id, String
66
+
67
+ # @!attribute card
68
+ # The card details associated with this payment method
69
+ #
70
+ # @return [WhopSDK::Models::PaymentMethodListResponse::CardPaymentMethod::Card]
71
+ required :card, -> { WhopSDK::Models::PaymentMethodListResponse::CardPaymentMethod::Card }
72
+
73
+ # @!attribute created_at
74
+ # When the payment method was created
75
+ #
76
+ # @return [Time]
77
+ required :created_at, Time
78
+
79
+ # @!attribute payment_method_type
80
+ # The type of the payment method
81
+ #
82
+ # @return [Symbol, WhopSDK::Models::PaymentMethodTypes]
83
+ required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }
84
+
85
+ # @!attribute typename
86
+ # The typename of this object
87
+ #
88
+ # @return [Symbol, :CardPaymentMethod]
89
+ required :typename, const: :CardPaymentMethod
90
+
91
+ # @!method initialize(id:, card:, created_at:, payment_method_type:, typename: :CardPaymentMethod)
92
+ # The card for the payment method
93
+ #
94
+ # @param id [String] The ID of the payment method
95
+ #
96
+ # @param card [WhopSDK::Models::PaymentMethodListResponse::CardPaymentMethod::Card] The card details associated with this payment method
97
+ #
98
+ # @param created_at [Time] When the payment method was created
99
+ #
100
+ # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The type of the payment method
101
+ #
102
+ # @param typename [Symbol, :CardPaymentMethod] The typename of this object
103
+
104
+ # @see WhopSDK::Models::PaymentMethodListResponse::CardPaymentMethod#card
105
+ class Card < WhopSDK::Internal::Type::BaseModel
106
+ # @!attribute brand
107
+ # Possible card brands that a payment token can have
108
+ #
109
+ # @return [Symbol, WhopSDK::Models::CardBrands, nil]
110
+ required :brand, enum: -> { WhopSDK::CardBrands }, nil?: true
111
+
112
+ # @!attribute exp_month
113
+ # Card expiration month, like 03 for March.
114
+ #
115
+ # @return [Integer, nil]
116
+ required :exp_month, Integer, nil?: true
117
+
118
+ # @!attribute exp_year
119
+ # Card expiration year, like 27 for 2027.
120
+ #
121
+ # @return [Integer, nil]
122
+ required :exp_year, Integer, nil?: true
123
+
124
+ # @!attribute last4
125
+ # Last four digits of the card.
126
+ #
127
+ # @return [String, nil]
128
+ required :last4, String, nil?: true
129
+
130
+ # @!method initialize(brand:, exp_month:, exp_year:, last4:)
131
+ # The card details associated with this payment method
132
+ #
133
+ # @param brand [Symbol, WhopSDK::Models::CardBrands, nil] Possible card brands that a payment token can have
134
+ #
135
+ # @param exp_month [Integer, nil] Card expiration month, like 03 for March.
136
+ #
137
+ # @param exp_year [Integer, nil] Card expiration year, like 27 for 2027.
138
+ #
139
+ # @param last4 [String, nil] Last four digits of the card.
140
+ end
141
+ end
142
+
143
+ class UsBankAccountPaymentMethod < WhopSDK::Internal::Type::BaseModel
144
+ # @!attribute id
145
+ # The ID of the payment method
146
+ #
147
+ # @return [String]
148
+ required :id, String
149
+
150
+ # @!attribute created_at
151
+ # When the payment method was created
152
+ #
153
+ # @return [Time]
154
+ required :created_at, Time
155
+
156
+ # @!attribute payment_method_type
157
+ # The type of the payment method
158
+ #
159
+ # @return [Symbol, WhopSDK::Models::PaymentMethodTypes]
160
+ required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }
161
+
162
+ # @!attribute typename
163
+ # The typename of this object
164
+ #
165
+ # @return [Symbol, :UsBankAccountPaymentMethod]
166
+ required :typename, const: :UsBankAccountPaymentMethod
167
+
168
+ # @!attribute us_bank_account
169
+ # The bank details associated with this payment method
170
+ #
171
+ # @return [WhopSDK::Models::PaymentMethodListResponse::UsBankAccountPaymentMethod::UsBankAccount]
172
+ required :us_bank_account,
173
+ -> { WhopSDK::Models::PaymentMethodListResponse::UsBankAccountPaymentMethod::UsBankAccount }
174
+
175
+ # @!method initialize(id:, created_at:, payment_method_type:, us_bank_account:, typename: :UsBankAccountPaymentMethod)
176
+ # The bank account for the payment method
177
+ #
178
+ # @param id [String] The ID of the payment method
179
+ #
180
+ # @param created_at [Time] When the payment method was created
181
+ #
182
+ # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The type of the payment method
183
+ #
184
+ # @param us_bank_account [WhopSDK::Models::PaymentMethodListResponse::UsBankAccountPaymentMethod::UsBankAccount] The bank details associated with this payment method
185
+ #
186
+ # @param typename [Symbol, :UsBankAccountPaymentMethod] The typename of this object
187
+
188
+ # @see WhopSDK::Models::PaymentMethodListResponse::UsBankAccountPaymentMethod#us_bank_account
189
+ class UsBankAccount < WhopSDK::Internal::Type::BaseModel
190
+ # @!attribute account_type
191
+ # The type of account
192
+ #
193
+ # @return [String]
194
+ required :account_type, String
195
+
196
+ # @!attribute bank_name
197
+ # The name of the bank
198
+ #
199
+ # @return [String]
200
+ required :bank_name, String
201
+
202
+ # @!attribute last4
203
+ # The last 4 digits of the account number
204
+ #
205
+ # @return [String]
206
+ required :last4, String
207
+
208
+ # @!method initialize(account_type:, bank_name:, last4:)
209
+ # The bank details associated with this payment method
210
+ #
211
+ # @param account_type [String] The type of account
212
+ #
213
+ # @param bank_name [String] The name of the bank
214
+ #
215
+ # @param last4 [String] The last 4 digits of the account number
216
+ end
217
+ end
218
+
219
+ # @!method self.variants
220
+ # @return [Array(WhopSDK::Models::PaymentMethodListResponse::BasePaymentMethod, WhopSDK::Models::PaymentMethodListResponse::CardPaymentMethod, WhopSDK::Models::PaymentMethodListResponse::UsBankAccountPaymentMethod)]
83
221
  end
84
222
  end
85
223
  end