whop_sdk 0.0.15 → 0.0.17

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 +22 -0
  3. data/README.md +1 -1
  4. data/lib/whop_sdk/client.rb +4 -0
  5. data/lib/whop_sdk/models/course.rb +65 -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 +123 -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 +50 -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
@@ -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#retrieve
6
- class PaymentMethodRetrieveResponse < 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::PaymentMethodRetrieveResponse::Card, nil]
17
- required :card, -> { WhopSDK::Models::PaymentMethodRetrieveResponse::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::PaymentMethodRetrieveResponse} 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::PaymentMethodRetrieveResponse::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::PaymentMethodRetrieveResponse#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 PaymentMethodRetrieveResponse
9
+ extend WhopSDK::Internal::Type::Union
10
+
11
+ discriminator :typename
12
+
13
+ # A payment method with no additional properties
14
+ variant :BasePaymentMethod, -> { WhopSDK::Models::PaymentMethodRetrieveResponse::BasePaymentMethod }
15
+
16
+ # The card for the payment method
17
+ variant :CardPaymentMethod, -> { WhopSDK::Models::PaymentMethodRetrieveResponse::CardPaymentMethod }
18
+
19
+ # The bank account for the payment method
20
+ variant :UsBankAccountPaymentMethod,
21
+ -> { WhopSDK::Models::PaymentMethodRetrieveResponse::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::PaymentMethodRetrieveResponse::CardPaymentMethod::Card]
71
+ required :card, -> { WhopSDK::Models::PaymentMethodRetrieveResponse::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::PaymentMethodRetrieveResponse::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::PaymentMethodRetrieveResponse::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::PaymentMethodRetrieveResponse::UsBankAccountPaymentMethod::UsBankAccount]
172
+ required :us_bank_account,
173
+ -> { WhopSDK::Models::PaymentMethodRetrieveResponse::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::PaymentMethodRetrieveResponse::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::PaymentMethodRetrieveResponse::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::PaymentMethodRetrieveResponse::BasePaymentMethod, WhopSDK::Models::PaymentMethodRetrieveResponse::CardPaymentMethod, WhopSDK::Models::PaymentMethodRetrieveResponse::UsBankAccountPaymentMethod)]
83
221
  end
84
222
  end
85
223
  end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::PayoutMethods#list
6
+ class PayoutMethodListParams < WhopSDK::Internal::Type::BaseModel
7
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
8
+ include WhopSDK::Internal::Type::RequestParameters
9
+
10
+ # @!attribute company_id
11
+ # The company ID to list payout methods for.
12
+ #
13
+ # @return [String]
14
+ required :company_id, String
15
+
16
+ # @!attribute after
17
+ # Returns the elements in the list that come after the specified cursor.
18
+ #
19
+ # @return [String, nil]
20
+ optional :after, String, nil?: true
21
+
22
+ # @!attribute before
23
+ # Returns the elements in the list that come before the specified cursor.
24
+ #
25
+ # @return [String, nil]
26
+ optional :before, String, nil?: true
27
+
28
+ # @!attribute first
29
+ # Returns the first _n_ elements from the list.
30
+ #
31
+ # @return [Integer, nil]
32
+ optional :first, Integer, nil?: true
33
+
34
+ # @!attribute last
35
+ # Returns the last _n_ elements from the list.
36
+ #
37
+ # @return [Integer, nil]
38
+ optional :last, Integer, nil?: true
39
+
40
+ # @!method initialize(company_id:, after: nil, before: nil, first: nil, last: nil, request_options: {})
41
+ # @param company_id [String] The company ID to list payout methods for.
42
+ #
43
+ # @param after [String, nil] Returns the elements in the list that come after the specified cursor.
44
+ #
45
+ # @param before [String, nil] Returns the elements in the list that come before the specified cursor.
46
+ #
47
+ # @param first [Integer, nil] Returns the first _n_ elements from the list.
48
+ #
49
+ # @param last [Integer, nil] Returns the last _n_ elements from the list.
50
+ #
51
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,95 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::PayoutMethods#list
6
+ class PayoutMethodListResponse < WhopSDK::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # The ID of the payout token
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute currency
14
+ # The currency code of the payout destination. This is the currency that payouts
15
+ # will be made in for this token.
16
+ #
17
+ # @return [String]
18
+ required :currency, String
19
+
20
+ # @!attribute destination
21
+ # The payout destination associated with the payout token
22
+ #
23
+ # @return [WhopSDK::Models::PayoutMethodListResponse::Destination, nil]
24
+ required :destination, -> { WhopSDK::Models::PayoutMethodListResponse::Destination }, nil?: true
25
+
26
+ # @!attribute nickname
27
+ # An optional nickname for the payout token to help the user identify it. This is
28
+ # not used by the provider and is only for the user's reference.
29
+ #
30
+ # @return [String, nil]
31
+ required :nickname, String, nil?: true
32
+
33
+ # @!method initialize(id:, currency:, destination:, nickname:)
34
+ # Some parameter documentations has been truncated, see
35
+ # {WhopSDK::Models::PayoutMethodListResponse} for more details.
36
+ #
37
+ # An object representing an user's setup payout destination.
38
+ #
39
+ # @param id [String] The ID of the payout token
40
+ #
41
+ # @param currency [String] The currency code of the payout destination. This is the currency that payouts w
42
+ #
43
+ # @param destination [WhopSDK::Models::PayoutMethodListResponse::Destination, nil] The payout destination associated with the payout token
44
+ #
45
+ # @param nickname [String, nil] An optional nickname for the payout token to help the user identify it. This is
46
+
47
+ # @see WhopSDK::Models::PayoutMethodListResponse#destination
48
+ class Destination < WhopSDK::Internal::Type::BaseModel
49
+ # @!attribute category
50
+ # The category of the payout destination
51
+ #
52
+ # @return [Symbol, WhopSDK::Models::PayoutMethodListResponse::Destination::Category]
53
+ required :category, enum: -> { WhopSDK::Models::PayoutMethodListResponse::Destination::Category }
54
+
55
+ # @!attribute country_code
56
+ # The country code of the payout destination
57
+ #
58
+ # @return [String]
59
+ required :country_code, String
60
+
61
+ # @!attribute name
62
+ # The name of the payer associated with the payout destination
63
+ #
64
+ # @return [String]
65
+ required :name, String
66
+
67
+ # @!method initialize(category:, country_code:, name:)
68
+ # The payout destination associated with the payout token
69
+ #
70
+ # @param category [Symbol, WhopSDK::Models::PayoutMethodListResponse::Destination::Category] The category of the payout destination
71
+ #
72
+ # @param country_code [String] The country code of the payout destination
73
+ #
74
+ # @param name [String] The name of the payer associated with the payout destination
75
+
76
+ # The category of the payout destination
77
+ #
78
+ # @see WhopSDK::Models::PayoutMethodListResponse::Destination#category
79
+ module Category
80
+ extend WhopSDK::Internal::Type::Enum
81
+
82
+ CRYPTO = :crypto
83
+ RTP = :rtp
84
+ NEXT_DAY_BANK = :next_day_bank
85
+ BANK_WIRE = :bank_wire
86
+ DIGITAL_WALLET = :digital_wallet
87
+ UNKNOWN = :unknown
88
+
89
+ # @!method self.values
90
+ # @return [Array<Symbol>]
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::Withdrawals#create
6
+ class WithdrawalCreateParams < WhopSDK::Internal::Type::BaseModel
7
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
8
+ include WhopSDK::Internal::Type::RequestParameters
9
+
10
+ # @!attribute amount
11
+ # The amount to withdraw in the specified currency
12
+ #
13
+ # @return [Float]
14
+ required :amount, Float
15
+
16
+ # @!attribute company_id
17
+ # The ID of the company to withdraw from.
18
+ #
19
+ # @return [String]
20
+ required :company_id, String
21
+
22
+ # @!attribute currency
23
+ # The currency that is being withdrawn.
24
+ #
25
+ # @return [Symbol, WhopSDK::Models::Currency]
26
+ required :currency, enum: -> { WhopSDK::Currency }
27
+
28
+ # @!attribute payout_method_id
29
+ # The ID of the payout method to use for the withdrawal.
30
+ #
31
+ # @return [String, nil]
32
+ optional :payout_method_id, String, nil?: true
33
+
34
+ # @!method initialize(amount:, company_id:, currency:, payout_method_id: nil, request_options: {})
35
+ # @param amount [Float] The amount to withdraw in the specified currency
36
+ #
37
+ # @param company_id [String] The ID of the company to withdraw from.
38
+ #
39
+ # @param currency [Symbol, WhopSDK::Models::Currency] The currency that is being withdrawn.
40
+ #
41
+ # @param payout_method_id [String, nil] The ID of the payout method to use for the withdrawal.
42
+ #
43
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
44
+ end
45
+ end
46
+ end