whop_sdk 0.0.10 → 0.0.12

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 (88) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/README.md +1 -1
  4. data/lib/whop_sdk/client.rb +3 -3
  5. data/lib/whop_sdk/internal/type/union.rb +12 -0
  6. data/lib/whop_sdk/models/checkout_configuration_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 +25 -27
  9. data/lib/whop_sdk/models/payment_create_params.rb +5 -5
  10. data/lib/whop_sdk/models/payment_list_response.rb +25 -27
  11. data/lib/whop_sdk/models/{payment_token_list_params.rb → payment_method_list_params.rb} +4 -4
  12. data/lib/whop_sdk/models/{payment_token_list_response.rb → payment_method_list_response.rb} +17 -18
  13. data/lib/whop_sdk/models/{payment_token_retrieve_params.rb → payment_method_retrieve_params.rb} +4 -4
  14. data/lib/whop_sdk/models/{payment_token_retrieve_response.rb → payment_method_retrieve_response.rb} +17 -18
  15. data/lib/whop_sdk/models/plan.rb +9 -1
  16. data/lib/whop_sdk/models/plan_create_params.rb +9 -1
  17. data/lib/whop_sdk/models/plan_list_response.rb +9 -1
  18. data/lib/whop_sdk/models/product_create_params.rb +2 -2
  19. data/lib/whop_sdk/models/setup_intent.rb +22 -24
  20. data/lib/whop_sdk/models/setup_intent_list_response.rb +22 -24
  21. data/lib/whop_sdk/models/unwrap_webhook_event.rb +29 -22
  22. data/lib/whop_sdk/models/withdrawal_created_webhook_event.rb +309 -0
  23. data/lib/whop_sdk/models/withdrawal_retrieve_response.rb +111 -166
  24. data/lib/whop_sdk/models/withdrawal_updated_webhook_event.rb +309 -0
  25. data/lib/whop_sdk/models.rb +8 -4
  26. data/lib/whop_sdk/resources/invoices.rb +3 -1
  27. data/lib/whop_sdk/resources/{payment_tokens.rb → payment_methods.rb} +24 -16
  28. data/lib/whop_sdk/resources/payments.rb +7 -5
  29. data/lib/whop_sdk/resources/plans.rb +3 -1
  30. data/lib/whop_sdk/resources/products.rb +1 -1
  31. data/lib/whop_sdk/resources/setup_intents.rb +10 -2
  32. data/lib/whop_sdk/resources/webhooks.rb +1 -1
  33. data/lib/whop_sdk/version.rb +1 -1
  34. data/lib/whop_sdk.rb +7 -5
  35. data/rbi/whop_sdk/client.rbi +2 -2
  36. data/rbi/whop_sdk/models/checkout_configuration_create_params.rbi +8 -0
  37. data/rbi/whop_sdk/models/invoice_create_params.rbi +10 -0
  38. data/rbi/whop_sdk/models/payment.rbi +30 -33
  39. data/rbi/whop_sdk/models/payment_create_params.rbi +6 -6
  40. data/rbi/whop_sdk/models/payment_list_response.rbi +34 -37
  41. data/rbi/whop_sdk/models/{payment_token_list_params.rbi → payment_method_list_params.rbi} +4 -4
  42. data/rbi/whop_sdk/models/{payment_token_list_response.rbi → payment_method_list_response.rbi} +18 -20
  43. data/rbi/whop_sdk/models/{payment_token_retrieve_params.rbi → payment_method_retrieve_params.rbi} +7 -4
  44. data/rbi/whop_sdk/models/{payment_token_retrieve_response.rbi → payment_method_retrieve_response.rbi} +18 -20
  45. data/rbi/whop_sdk/models/plan.rbi +8 -0
  46. data/rbi/whop_sdk/models/plan_create_params.rbi +8 -0
  47. data/rbi/whop_sdk/models/plan_list_response.rbi +8 -0
  48. data/rbi/whop_sdk/models/product_create_params.rbi +2 -2
  49. data/rbi/whop_sdk/models/setup_intent.rbi +27 -29
  50. data/rbi/whop_sdk/models/setup_intent_list_response.rbi +31 -32
  51. data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +2 -0
  52. data/rbi/whop_sdk/models/withdrawal_created_webhook_event.rbi +633 -0
  53. data/rbi/whop_sdk/models/withdrawal_retrieve_response.rbi +326 -480
  54. data/rbi/whop_sdk/models/withdrawal_updated_webhook_event.rbi +633 -0
  55. data/rbi/whop_sdk/models.rbi +8 -4
  56. data/rbi/whop_sdk/resources/invoices.rbi +4 -0
  57. data/rbi/whop_sdk/resources/{payment_tokens.rbi → payment_methods.rbi} +16 -8
  58. data/rbi/whop_sdk/resources/payments.rbi +8 -6
  59. data/rbi/whop_sdk/resources/plans.rbi +3 -0
  60. data/rbi/whop_sdk/resources/products.rbi +1 -1
  61. data/rbi/whop_sdk/resources/setup_intents.rbi +10 -2
  62. data/rbi/whop_sdk/resources/webhooks.rbi +2 -0
  63. data/sig/whop_sdk/client.rbs +1 -1
  64. data/sig/whop_sdk/models/checkout_configuration_create_params.rbs +5 -0
  65. data/sig/whop_sdk/models/invoice_create_params.rbs +5 -0
  66. data/sig/whop_sdk/models/payment.rbs +11 -11
  67. data/sig/whop_sdk/models/payment_create_params.rbs +4 -4
  68. data/sig/whop_sdk/models/payment_list_response.rbs +11 -11
  69. data/sig/whop_sdk/models/{payment_token_list_params.rbs → payment_method_list_params.rbs} +2 -2
  70. data/sig/whop_sdk/models/{payment_token_list_response.rbs → payment_method_list_response.rbs} +6 -6
  71. data/sig/whop_sdk/models/{payment_token_retrieve_params.rbs → payment_method_retrieve_params.rbs} +2 -2
  72. data/sig/whop_sdk/models/{payment_token_retrieve_response.rbs → payment_method_retrieve_response.rbs} +6 -6
  73. data/sig/whop_sdk/models/plan.rbs +5 -0
  74. data/sig/whop_sdk/models/plan_create_params.rbs +5 -0
  75. data/sig/whop_sdk/models/plan_list_response.rbs +5 -0
  76. data/sig/whop_sdk/models/setup_intent.rbs +10 -10
  77. data/sig/whop_sdk/models/setup_intent_list_response.rbs +10 -10
  78. data/sig/whop_sdk/models/unwrap_webhook_event.rbs +2 -0
  79. data/sig/whop_sdk/models/withdrawal_created_webhook_event.rbs +275 -0
  80. data/sig/whop_sdk/models/withdrawal_retrieve_response.rbs +132 -191
  81. data/sig/whop_sdk/models/withdrawal_updated_webhook_event.rbs +275 -0
  82. data/sig/whop_sdk/models.rbs +8 -4
  83. data/sig/whop_sdk/resources/invoices.rbs +1 -0
  84. data/sig/whop_sdk/resources/{payment_tokens.rbs → payment_methods.rbs} +3 -3
  85. data/sig/whop_sdk/resources/payments.rbs +1 -1
  86. data/sig/whop_sdk/resources/plans.rbs +1 -0
  87. data/sig/whop_sdk/resources/webhooks.rbs +2 -0
  88. metadata +23 -17
@@ -0,0 +1,309 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class WithdrawalUpdatedWebhookEvent < WhopSDK::Internal::Type::BaseModel
6
+ # @!attribute id
7
+ # A unique ID for every single webhook request
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute api_version
13
+ # The API version for this webhook
14
+ #
15
+ # @return [Symbol, :v1]
16
+ required :api_version, const: :v1
17
+
18
+ # @!attribute data
19
+ # A withdrawal request.
20
+ #
21
+ # @return [WhopSDK::Models::WithdrawalUpdatedWebhookEvent::Data]
22
+ required :data, -> { WhopSDK::WithdrawalUpdatedWebhookEvent::Data }
23
+
24
+ # @!attribute timestamp
25
+ # The timestamp in ISO 8601 format that the webhook was sent at on the server
26
+ #
27
+ # @return [Time]
28
+ required :timestamp, Time
29
+
30
+ # @!attribute type
31
+ # The webhook event type
32
+ #
33
+ # @return [Symbol, :"withdrawal.updated"]
34
+ required :type, const: :"withdrawal.updated"
35
+
36
+ # @!method initialize(id:, data:, timestamp:, api_version: :v1, type: :"withdrawal.updated")
37
+ # @param id [String] A unique ID for every single webhook request
38
+ #
39
+ # @param data [WhopSDK::Models::WithdrawalUpdatedWebhookEvent::Data] A withdrawal request.
40
+ #
41
+ # @param timestamp [Time] The timestamp in ISO 8601 format that the webhook was sent at on the server
42
+ #
43
+ # @param api_version [Symbol, :v1] The API version for this webhook
44
+ #
45
+ # @param type [Symbol, :"withdrawal.updated"] The webhook event type
46
+
47
+ # @see WhopSDK::Models::WithdrawalUpdatedWebhookEvent#data
48
+ class Data < WhopSDK::Internal::Type::BaseModel
49
+ # @!attribute id
50
+ # Internal ID of the withdrawal request.
51
+ #
52
+ # @return [String]
53
+ required :id, String
54
+
55
+ # @!attribute amount
56
+ # How much money was attempted to be withdrawn, in a float type.
57
+ #
58
+ # @return [Float]
59
+ required :amount, Float
60
+
61
+ # @!attribute created_at
62
+ # When the withdrawal request was created.
63
+ #
64
+ # @return [Time]
65
+ required :created_at, Time
66
+
67
+ # @!attribute currency
68
+ # The currency of the withdrawal request.
69
+ #
70
+ # @return [Symbol, WhopSDK::Models::Currency]
71
+ required :currency, enum: -> { WhopSDK::Currency }
72
+
73
+ # @!attribute error_code
74
+ # The different error codes a payout can be in.
75
+ #
76
+ # @return [Symbol, WhopSDK::Models::WithdrawalUpdatedWebhookEvent::Data::ErrorCode, nil]
77
+ required :error_code, enum: -> { WhopSDK::WithdrawalUpdatedWebhookEvent::Data::ErrorCode }, nil?: true
78
+
79
+ # @!attribute error_message
80
+ # The error message for the withdrawal, if any.
81
+ #
82
+ # @return [String, nil]
83
+ required :error_message, String, nil?: true
84
+
85
+ # @!attribute estimated_availability
86
+ # The estimated availability date for the withdrawal, if any.
87
+ #
88
+ # @return [Time, nil]
89
+ required :estimated_availability, Time, nil?: true
90
+
91
+ # @!attribute fee_amount
92
+ # The fee amount that was charged for the withdrawal. This is in the same currency
93
+ # as the withdrawal amount.
94
+ #
95
+ # @return [Float]
96
+ required :fee_amount, Float
97
+
98
+ # @!attribute fee_type
99
+ # The different fee types for a withdrawal.
100
+ #
101
+ # @return [Symbol, WhopSDK::Models::WithdrawalFeeTypes, nil]
102
+ required :fee_type, enum: -> { WhopSDK::WithdrawalFeeTypes }, nil?: true
103
+
104
+ # @!attribute ledger_account
105
+ # The ledger account associated with the withdrawal.
106
+ #
107
+ # @return [WhopSDK::Models::WithdrawalUpdatedWebhookEvent::Data::LedgerAccount]
108
+ required :ledger_account, -> { WhopSDK::WithdrawalUpdatedWebhookEvent::Data::LedgerAccount }
109
+
110
+ # @!attribute payout_token
111
+ # The payout token used for the withdrawal, if applicable.
112
+ #
113
+ # @return [WhopSDK::Models::WithdrawalUpdatedWebhookEvent::Data::PayoutToken, nil]
114
+ required :payout_token, -> { WhopSDK::WithdrawalUpdatedWebhookEvent::Data::PayoutToken }, nil?: true
115
+
116
+ # @!attribute speed
117
+ # The speed of the withdrawal.
118
+ #
119
+ # @return [Symbol, WhopSDK::Models::WithdrawalSpeeds]
120
+ required :speed, enum: -> { WhopSDK::WithdrawalSpeeds }
121
+
122
+ # @!attribute status
123
+ # Status of the withdrawal.
124
+ #
125
+ # @return [Symbol, WhopSDK::Models::WithdrawalStatus]
126
+ required :status, enum: -> { WhopSDK::WithdrawalStatus }
127
+
128
+ # @!attribute trace_code
129
+ # The trace code for the payout, if applicable. Provided on ACH transactions when
130
+ # available.
131
+ #
132
+ # @return [String, nil]
133
+ required :trace_code, String, nil?: true
134
+
135
+ # @!attribute withdrawal_type
136
+ # The type of withdrawal.
137
+ #
138
+ # @return [Symbol, WhopSDK::Models::WithdrawalTypes]
139
+ required :withdrawal_type, enum: -> { WhopSDK::WithdrawalTypes }
140
+
141
+ # @!method initialize(id:, amount:, created_at:, currency:, error_code:, error_message:, estimated_availability:, fee_amount:, fee_type:, ledger_account:, payout_token:, speed:, status:, trace_code:, withdrawal_type:)
142
+ # Some parameter documentations has been truncated, see
143
+ # {WhopSDK::Models::WithdrawalUpdatedWebhookEvent::Data} for more details.
144
+ #
145
+ # A withdrawal request.
146
+ #
147
+ # @param id [String] Internal ID of the withdrawal request.
148
+ #
149
+ # @param amount [Float] How much money was attempted to be withdrawn, in a float type.
150
+ #
151
+ # @param created_at [Time] When the withdrawal request was created.
152
+ #
153
+ # @param currency [Symbol, WhopSDK::Models::Currency] The currency of the withdrawal request.
154
+ #
155
+ # @param error_code [Symbol, WhopSDK::Models::WithdrawalUpdatedWebhookEvent::Data::ErrorCode, nil] The different error codes a payout can be in.
156
+ #
157
+ # @param error_message [String, nil] The error message for the withdrawal, if any.
158
+ #
159
+ # @param estimated_availability [Time, nil] The estimated availability date for the withdrawal, if any.
160
+ #
161
+ # @param fee_amount [Float] The fee amount that was charged for the withdrawal. This is in the same currency
162
+ #
163
+ # @param fee_type [Symbol, WhopSDK::Models::WithdrawalFeeTypes, nil] The different fee types for a withdrawal.
164
+ #
165
+ # @param ledger_account [WhopSDK::Models::WithdrawalUpdatedWebhookEvent::Data::LedgerAccount] The ledger account associated with the withdrawal.
166
+ #
167
+ # @param payout_token [WhopSDK::Models::WithdrawalUpdatedWebhookEvent::Data::PayoutToken, nil] The payout token used for the withdrawal, if applicable.
168
+ #
169
+ # @param speed [Symbol, WhopSDK::Models::WithdrawalSpeeds] The speed of the withdrawal.
170
+ #
171
+ # @param status [Symbol, WhopSDK::Models::WithdrawalStatus] Status of the withdrawal.
172
+ #
173
+ # @param trace_code [String, nil] The trace code for the payout, if applicable. Provided on ACH transactions when
174
+ #
175
+ # @param withdrawal_type [Symbol, WhopSDK::Models::WithdrawalTypes] The type of withdrawal.
176
+
177
+ # The different error codes a payout can be in.
178
+ #
179
+ # @see WhopSDK::Models::WithdrawalUpdatedWebhookEvent::Data#error_code
180
+ module ErrorCode
181
+ extend WhopSDK::Internal::Type::Enum
182
+
183
+ ACCOUNT_CLOSED = :account_closed
184
+ ACCOUNT_DOES_NOT_EXIST = :account_does_not_exist
185
+ ACCOUNT_INFORMATION_INVALID = :account_information_invalid
186
+ ACCOUNT_NUMBER_INVALID_REGION = :account_number_invalid_region
187
+ ACCOUNT_FROZEN = :account_frozen
188
+ ACCOUNT_LOOKUP_FAILED = :account_lookup_failed
189
+ ACCOUNT_NOT_FOUND = :account_not_found
190
+ AMOUNT_OUT_OF_BOUNDS = :amount_out_of_bounds
191
+ ATTRIBUTES_NOT_VALIDATED = :attributes_not_validated
192
+ B2B_PAYMENTS_PROHIBITED = :b2b_payments_prohibited
193
+ BANK_STATEMENT_REQUIRED = :bank_statement_required
194
+ COMPLIANCE_REVIEW = :compliance_review
195
+ CURRENCY_NOT_SUPPORTED = :currency_not_supported
196
+ DEPOSIT_CANCELED = :deposit_canceled
197
+ DEPOSIT_FAILED = :deposit_failed
198
+ DEPOSIT_REJECTED = :deposit_rejected
199
+ DESTINATION_UNAVAILABLE = :destination_unavailable
200
+ EXCEEDED_ACCOUNT_LIMIT = :exceeded_account_limit
201
+ EXPIRED_QUOTE = :expired_quote
202
+ GENERIC_PAYOUT_ERROR = :generic_payout_error
203
+ TECHNICAL_PROBLEM = :technical_problem
204
+ IDENTIFICATION_NUMBER_INVALID = :identification_number_invalid
205
+ INVALID_ACCOUNT_NUMBER = :invalid_account_number
206
+ INVALID_BANK_CODE = :invalid_bank_code
207
+ INVALID_BENEFICIARY = :invalid_beneficiary
208
+ INVALID_BRANCH_NUMBER = :invalid_branch_number
209
+ INVALID_BRANCH_CODE = :invalid_branch_code
210
+ INVALID_PHONE_NUMBER = :invalid_phone_number
211
+ INVALID_ROUTING_NUMBER = :invalid_routing_number
212
+ INVALID_SWIFT_CODE = :invalid_swift_code
213
+ INVALID_COMPANY_DETAILS = :invalid_company_details
214
+ MANUAL_CANCELATION = :manual_cancelation
215
+ MISC_ERROR = :misc_error
216
+ MISSING_CITY_AND_COUNTRY = :missing_city_and_country
217
+ MISSING_PHONE_NUMBER = :missing_phone_number
218
+ MISSING_REMITTANCE_INFO = :missing_remittance_info
219
+ PAYEE_NAME_INVALID = :payee_name_invalid
220
+ RECEIVING_ACCOUNT_LOCKED = :receiving_account_locked
221
+ REJECTED_BY_COMPLIANCE = :rejected_by_compliance
222
+ RTP_NOT_SUPPORTED = :rtp_not_supported
223
+ NON_TRANSACTION_ACCOUNT = :non_transaction_account
224
+ SOURCE_TOKEN_INSUFFICIENT_FUNDS = :source_token_insufficient_funds
225
+ SSN_INVALID = :ssn_invalid
226
+ WALLET_SCREENSHOT_REQUIRED = :wallet_screenshot_required
227
+ UNSUPPORTED_REGION = :unsupported_region
228
+
229
+ # @!method self.values
230
+ # @return [Array<Symbol>]
231
+ end
232
+
233
+ # @see WhopSDK::Models::WithdrawalUpdatedWebhookEvent::Data#ledger_account
234
+ class LedgerAccount < WhopSDK::Internal::Type::BaseModel
235
+ # @!attribute id
236
+ # The ID of the LedgerAccount.
237
+ #
238
+ # @return [String]
239
+ required :id, String
240
+
241
+ # @!attribute company_id
242
+ # The ID of the company associated with this ledger account.
243
+ #
244
+ # @return [String, nil]
245
+ required :company_id, String, nil?: true
246
+
247
+ # @!method initialize(id:, company_id:)
248
+ # The ledger account associated with the withdrawal.
249
+ #
250
+ # @param id [String] The ID of the LedgerAccount.
251
+ #
252
+ # @param company_id [String, nil] The ID of the company associated with this ledger account.
253
+ end
254
+
255
+ # @see WhopSDK::Models::WithdrawalUpdatedWebhookEvent::Data#payout_token
256
+ class PayoutToken < WhopSDK::Internal::Type::BaseModel
257
+ # @!attribute id
258
+ # The ID of the payout token
259
+ #
260
+ # @return [String]
261
+ required :id, String
262
+
263
+ # @!attribute created_at
264
+ # The date and time the payout token was created
265
+ #
266
+ # @return [Time]
267
+ required :created_at, Time
268
+
269
+ # @!attribute destination_currency_code
270
+ # The currency code of the payout destination. This is the currency that payouts
271
+ # will be made in for this token.
272
+ #
273
+ # @return [String]
274
+ required :destination_currency_code, String
275
+
276
+ # @!attribute nickname
277
+ # An optional nickname for the payout token to help the user identify it. This is
278
+ # not used by the provider and is only for the user's reference.
279
+ #
280
+ # @return [String, nil]
281
+ required :nickname, String, nil?: true
282
+
283
+ # @!attribute payer_name
284
+ # The name of the payer associated with the payout token.
285
+ #
286
+ # @return [String, nil]
287
+ required :payer_name, String, nil?: true
288
+
289
+ # @!method initialize(id:, created_at:, destination_currency_code:, nickname:, payer_name:)
290
+ # Some parameter documentations has been truncated, see
291
+ # {WhopSDK::Models::WithdrawalUpdatedWebhookEvent::Data::PayoutToken} for more
292
+ # details.
293
+ #
294
+ # The payout token used for the withdrawal, if applicable.
295
+ #
296
+ # @param id [String] The ID of the payout token
297
+ #
298
+ # @param created_at [Time] The date and time the payout token was created
299
+ #
300
+ # @param destination_currency_code [String] The currency code of the payout destination. This is the currency that payouts w
301
+ #
302
+ # @param nickname [String, nil] An optional nickname for the payout token to help the user identify it. This is
303
+ #
304
+ # @param payer_name [String, nil] The name of the payer associated with the payout token.
305
+ end
306
+ end
307
+ end
308
+ end
309
+ end
@@ -350,6 +350,10 @@ module WhopSDK
350
350
 
351
351
  PaymentListParams = WhopSDK::Models::PaymentListParams
352
352
 
353
+ PaymentMethodListParams = WhopSDK::Models::PaymentMethodListParams
354
+
355
+ PaymentMethodRetrieveParams = WhopSDK::Models::PaymentMethodRetrieveParams
356
+
353
357
  PaymentMethodTypes = WhopSDK::Models::PaymentMethodTypes
354
358
 
355
359
  PaymentPendingWebhookEvent = WhopSDK::Models::PaymentPendingWebhookEvent
@@ -364,10 +368,6 @@ module WhopSDK
364
368
 
365
369
  PaymentSucceededWebhookEvent = WhopSDK::Models::PaymentSucceededWebhookEvent
366
370
 
367
- PaymentTokenListParams = WhopSDK::Models::PaymentTokenListParams
368
-
369
- PaymentTokenRetrieveParams = WhopSDK::Models::PaymentTokenRetrieveParams
370
-
371
371
  PaymentVoidParams = WhopSDK::Models::PaymentVoidParams
372
372
 
373
373
  Plan = WhopSDK::Models::Plan
@@ -512,6 +512,8 @@ module WhopSDK
512
512
 
513
513
  WhoCanReact = WhopSDK::Models::WhoCanReact
514
514
 
515
+ WithdrawalCreatedWebhookEvent = WhopSDK::Models::WithdrawalCreatedWebhookEvent
516
+
515
517
  WithdrawalFeeTypes = WhopSDK::Models::WithdrawalFeeTypes
516
518
 
517
519
  WithdrawalListParams = WhopSDK::Models::WithdrawalListParams
@@ -523,4 +525,6 @@ module WhopSDK
523
525
  WithdrawalStatus = WhopSDK::Models::WithdrawalStatus
524
526
 
525
527
  WithdrawalTypes = WhopSDK::Models::WithdrawalTypes
528
+
529
+ WithdrawalUpdatedWebhookEvent = WhopSDK::Models::WithdrawalUpdatedWebhookEvent
526
530
  end
@@ -13,7 +13,7 @@ module WhopSDK
13
13
  # - `invoice:create`
14
14
  # - `plan:basic:read`
15
15
  #
16
- # @overload create(collection_method:, company_id:, due_date:, member_id:, plan:, product:, email_address:, product_id:, charge_buyer_fee: nil, customer_name: nil, payment_token_id: nil, request_options: {})
16
+ # @overload create(collection_method:, company_id:, due_date:, member_id:, plan:, product:, email_address:, product_id:, charge_buyer_fee: nil, customer_name: nil, payment_method_id: nil, payment_token_id: nil, request_options: {})
17
17
  #
18
18
  # @param collection_method [Symbol, WhopSDK::Models::CollectionMethod] The method of collection for this invoice. If using charge_automatically, you mu
19
19
  #
@@ -35,6 +35,8 @@ module WhopSDK
35
35
  #
36
36
  # @param customer_name [String, nil] The name of the customer to create this invoice for. This is required if you wan
37
37
  #
38
+ # @param payment_method_id [String, nil] The payment method ID to use for this invoice. If using charge_automatically, yo
39
+ #
38
40
  # @param payment_token_id [String, nil] The payment token ID to use for this invoice. If using charge_automatically, you
39
41
  #
40
42
  # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -2,8 +2,12 @@
2
2
 
3
3
  module WhopSDK
4
4
  module Resources
5
- class PaymentTokens
6
- # Retrieves a PaymentToken by ID
5
+ class PaymentMethods
6
+ # A payment method is a stored representation of how a customer intends to pay,
7
+ # such as a card, bank account, or digital wallet. It holds the necessary billing
8
+ # details and can be attached to a member for future one-time or recurring
9
+ # charges. This lets you reuse the same payment credentials across multiple
10
+ # payments.
7
11
  #
8
12
  # Required permissions:
9
13
  #
@@ -11,27 +15,31 @@ module WhopSDK
11
15
  #
12
16
  # @overload retrieve(id, member_id:, request_options: {})
13
17
  #
14
- # @param id [String] The ID of the PaymentToken
18
+ # @param id [String] The ID of the PaymentMethod
15
19
  #
16
- # @param member_id [String] The ID of the Member associated with the PaymentToken
20
+ # @param member_id [String] The ID of the Member associated with the PaymentMethod
17
21
  #
18
22
  # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
19
23
  #
20
- # @return [WhopSDK::Models::PaymentTokenRetrieveResponse]
24
+ # @return [WhopSDK::Models::PaymentMethodRetrieveResponse]
21
25
  #
22
- # @see WhopSDK::Models::PaymentTokenRetrieveParams
26
+ # @see WhopSDK::Models::PaymentMethodRetrieveParams
23
27
  def retrieve(id, params)
24
- parsed, options = WhopSDK::PaymentTokenRetrieveParams.dump_request(params)
28
+ parsed, options = WhopSDK::PaymentMethodRetrieveParams.dump_request(params)
25
29
  @client.request(
26
30
  method: :get,
27
- path: ["payment_tokens/%1$s", id],
31
+ path: ["payment_methods/%1$s", id],
28
32
  query: parsed,
29
- model: WhopSDK::Models::PaymentTokenRetrieveResponse,
33
+ model: WhopSDK::Models::PaymentMethodRetrieveResponse,
30
34
  options: options
31
35
  )
32
36
  end
33
37
 
34
- # Lists PaymentTokens
38
+ # A payment method is a stored representation of how a customer intends to pay,
39
+ # such as a card, bank account, or digital wallet. It holds the necessary billing
40
+ # details and can be attached to a member for future one-time or recurring
41
+ # charges. This lets you reuse the same payment credentials across multiple
42
+ # payments.
35
43
  #
36
44
  # Required permissions:
37
45
  #
@@ -39,7 +47,7 @@ module WhopSDK
39
47
  #
40
48
  # @overload list(member_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {})
41
49
  #
42
- # @param member_id [String] The ID of the Member to list payment tokens for
50
+ # @param member_id [String] The ID of the Member to list payment methods for
43
51
  #
44
52
  # @param after [String, nil] Returns the elements in the list that come after the specified cursor.
45
53
  #
@@ -57,17 +65,17 @@ module WhopSDK
57
65
  #
58
66
  # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
59
67
  #
60
- # @return [WhopSDK::Internal::CursorPage<WhopSDK::Models::PaymentTokenListResponse>]
68
+ # @return [WhopSDK::Internal::CursorPage<WhopSDK::Models::PaymentMethodListResponse>]
61
69
  #
62
- # @see WhopSDK::Models::PaymentTokenListParams
70
+ # @see WhopSDK::Models::PaymentMethodListParams
63
71
  def list(params)
64
- parsed, options = WhopSDK::PaymentTokenListParams.dump_request(params)
72
+ parsed, options = WhopSDK::PaymentMethodListParams.dump_request(params)
65
73
  @client.request(
66
74
  method: :get,
67
- path: "payment_tokens",
75
+ path: "payment_methods",
68
76
  query: parsed,
69
77
  page: WhopSDK::Internal::CursorPage,
70
- model: WhopSDK::Models::PaymentTokenListResponse,
78
+ model: WhopSDK::Models::PaymentMethodListResponse,
71
79
  options: options
72
80
  )
73
81
  end
@@ -6,9 +6,11 @@ module WhopSDK
6
6
  # Some parameter documentations has been truncated, see
7
7
  # {WhopSDK::Models::PaymentCreateParams} for more details.
8
8
  #
9
- # Creates a payment. This endpoint will respond with a payment object immediately,
10
- # but the payment is processed asynchronously in the background. Use webhooks to
11
- # be notified when the payment succeeds or fails.
9
+ # Charge an existing member off-session using one of their stored payment methods.
10
+ # You can provide an existing plan, or create a new one in-line. This endpoint
11
+ # will respond with a payment object immediately, but the payment is processed
12
+ # asynchronously in the background. Use webhooks to be notified when the payment
13
+ # succeeds or fails.
12
14
  #
13
15
  # Required permissions:
14
16
  #
@@ -23,13 +25,13 @@ module WhopSDK
23
25
  # - `member:phone:read`
24
26
  # - `promo_code:basic:read`
25
27
  #
26
- # @overload create(company_id:, member_id:, payment_token_id:, plan:, plan_id:, request_options: {})
28
+ # @overload create(company_id:, member_id:, payment_method_id:, plan:, plan_id:, request_options: {})
27
29
  #
28
30
  # @param company_id [String] The ID of the company to create the payment for.
29
31
  #
30
32
  # @param member_id [String] The ID of the member to create the payment for.
31
33
  #
32
- # @param payment_token_id [String] The ID of the payment token to use for the payment. It must be connected to the
34
+ # @param payment_method_id [String] The ID of the payment method to use for the payment. It must be connected to the
33
35
  #
34
36
  # @param plan [WhopSDK::Models::PaymentCreateParams::Plan] Pass this object to create a new plan for this payment
35
37
  #
@@ -14,7 +14,7 @@ module WhopSDK
14
14
  # - `access_pass:basic:read`
15
15
  # - `plan:basic:read`
16
16
  #
17
- # @overload create(company_id:, product_id:, billing_period: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, override_tax_type: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, stock: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil, request_options: {})
17
+ # @overload create(company_id:, product_id:, billing_period: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, override_tax_type: nil, payment_method_configuration: nil, plan_type: nil, release_method: nil, renewal_price: nil, split_pay_required_payments: nil, stock: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil, request_options: {})
18
18
  #
19
19
  # @param company_id [String] The company the plan should be created for.
20
20
  #
@@ -46,6 +46,8 @@ module WhopSDK
46
46
  #
47
47
  # @param renewal_price [Float, nil] The amount the customer is charged every billing period. Use only if a recurring
48
48
  #
49
+ # @param split_pay_required_payments [Integer, nil] The number of payments required before pausing the subscription.
50
+ #
49
51
  # @param stock [Integer, nil] The number of units available for purchase.
50
52
  #
51
53
  # @param title [String, nil] The title of the plan. This will be visible on the product page to customers.
@@ -17,7 +17,7 @@ module WhopSDK
17
17
  #
18
18
  # @param company_id [String] The ID of the company to create the product for.
19
19
  #
20
- # @param title [String] The title of the product.
20
+ # @param title [String] The title of the product. It must be max 40 characters.
21
21
  #
22
22
  # @param business_type [Symbol, WhopSDK::Models::BusinessTypes, nil] The different business types a company can be.
23
23
  #
@@ -3,7 +3,11 @@
3
3
  module WhopSDK
4
4
  module Resources
5
5
  class SetupIntents
6
- # Retrieves a Setup Intent by ID
6
+ # A setup intent is an object used to securely collect and store a member’s
7
+ # payment method for future use without charging them immediately. It handles
8
+ # authentication steps up front so future off-session payments can be completed
9
+ # smoothly. This ensures the payment method is verified and ready for later
10
+ # billing.
7
11
  #
8
12
  # Required permissions:
9
13
  #
@@ -29,7 +33,11 @@ module WhopSDK
29
33
  )
30
34
  end
31
35
 
32
- # Lists Setup Intents
36
+ # A setup intent is an object used to securely collect and store a member’s
37
+ # payment method for future use without charging them immediately. It handles
38
+ # authentication steps up front so future off-session payments can be completed
39
+ # smoothly. This ensures the payment method is verified and ready for later
40
+ # billing.
33
41
  #
34
42
  # Required permissions:
35
43
  #
@@ -5,7 +5,7 @@ module WhopSDK
5
5
  class Webhooks
6
6
  # @param payload [String] The raw webhook payload as a string
7
7
  #
8
- # @return [WhopSDK::Models::InvoiceCreatedWebhookEvent, WhopSDK::Models::InvoicePaidWebhookEvent, WhopSDK::Models::InvoicePastDueWebhookEvent, WhopSDK::Models::InvoiceVoidedWebhookEvent, WhopSDK::Models::MembershipActivatedWebhookEvent, WhopSDK::Models::MembershipDeactivatedWebhookEvent, WhopSDK::Models::EntryCreatedWebhookEvent, WhopSDK::Models::EntryApprovedWebhookEvent, WhopSDK::Models::EntryDeniedWebhookEvent, WhopSDK::Models::EntryDeletedWebhookEvent, WhopSDK::Models::SetupIntentRequiresActionWebhookEvent, WhopSDK::Models::SetupIntentSucceededWebhookEvent, WhopSDK::Models::SetupIntentCanceledWebhookEvent, WhopSDK::Models::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::Models::PaymentSucceededWebhookEvent, WhopSDK::Models::PaymentFailedWebhookEvent, WhopSDK::Models::PaymentPendingWebhookEvent, WhopSDK::Models::DisputeCreatedWebhookEvent, WhopSDK::Models::DisputeUpdatedWebhookEvent, WhopSDK::Models::RefundCreatedWebhookEvent, WhopSDK::Models::RefundUpdatedWebhookEvent]
8
+ # @return [WhopSDK::Models::InvoiceCreatedWebhookEvent, WhopSDK::Models::InvoicePaidWebhookEvent, WhopSDK::Models::InvoicePastDueWebhookEvent, WhopSDK::Models::InvoiceVoidedWebhookEvent, WhopSDK::Models::MembershipActivatedWebhookEvent, WhopSDK::Models::MembershipDeactivatedWebhookEvent, WhopSDK::Models::EntryCreatedWebhookEvent, WhopSDK::Models::EntryApprovedWebhookEvent, WhopSDK::Models::EntryDeniedWebhookEvent, WhopSDK::Models::EntryDeletedWebhookEvent, WhopSDK::Models::SetupIntentRequiresActionWebhookEvent, WhopSDK::Models::SetupIntentSucceededWebhookEvent, WhopSDK::Models::SetupIntentCanceledWebhookEvent, WhopSDK::Models::WithdrawalCreatedWebhookEvent, WhopSDK::Models::WithdrawalUpdatedWebhookEvent, WhopSDK::Models::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::Models::PaymentSucceededWebhookEvent, WhopSDK::Models::PaymentFailedWebhookEvent, WhopSDK::Models::PaymentPendingWebhookEvent, WhopSDK::Models::DisputeCreatedWebhookEvent, WhopSDK::Models::DisputeUpdatedWebhookEvent, WhopSDK::Models::RefundCreatedWebhookEvent, WhopSDK::Models::RefundUpdatedWebhookEvent]
9
9
  def unwrap(payload)
10
10
  parsed = JSON.parse(payload, symbolize_names: true)
11
11
  WhopSDK::Internal::Type::Converter.coerce(WhopSDK::Models::UnwrapWebhookEvent, parsed)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WhopSDK
4
- VERSION = "0.0.10"
4
+ VERSION = "0.0.12"
5
5
  end
data/lib/whop_sdk.rb CHANGED
@@ -243,6 +243,10 @@ require_relative "whop_sdk/models/payment_create_params"
243
243
  require_relative "whop_sdk/models/payment_failed_webhook_event"
244
244
  require_relative "whop_sdk/models/payment_list_params"
245
245
  require_relative "whop_sdk/models/payment_list_response"
246
+ require_relative "whop_sdk/models/payment_method_list_params"
247
+ require_relative "whop_sdk/models/payment_method_list_response"
248
+ require_relative "whop_sdk/models/payment_method_retrieve_params"
249
+ require_relative "whop_sdk/models/payment_method_retrieve_response"
246
250
  require_relative "whop_sdk/models/payment_method_types"
247
251
  require_relative "whop_sdk/models/payment_pending_webhook_event"
248
252
  require_relative "whop_sdk/models/payment_provider"
@@ -250,10 +254,6 @@ require_relative "whop_sdk/models/payment_refund_params"
250
254
  require_relative "whop_sdk/models/payment_retrieve_params"
251
255
  require_relative "whop_sdk/models/payment_retry_params"
252
256
  require_relative "whop_sdk/models/payment_succeeded_webhook_event"
253
- require_relative "whop_sdk/models/payment_token_list_params"
254
- require_relative "whop_sdk/models/payment_token_list_response"
255
- require_relative "whop_sdk/models/payment_token_retrieve_params"
256
- require_relative "whop_sdk/models/payment_token_retrieve_response"
257
257
  require_relative "whop_sdk/models/payment_void_params"
258
258
  require_relative "whop_sdk/models/plan"
259
259
  require_relative "whop_sdk/models/plan_create_params"
@@ -342,6 +342,7 @@ require_relative "whop_sdk/models/who_can_comment_types"
342
342
  require_relative "whop_sdk/models/who_can_post"
343
343
  require_relative "whop_sdk/models/who_can_post_types"
344
344
  require_relative "whop_sdk/models/who_can_react"
345
+ require_relative "whop_sdk/models/withdrawal_created_webhook_event"
345
346
  require_relative "whop_sdk/models/withdrawal_fee_types"
346
347
  require_relative "whop_sdk/models/withdrawal_list_params"
347
348
  require_relative "whop_sdk/models/withdrawal_list_response"
@@ -350,6 +351,7 @@ require_relative "whop_sdk/models/withdrawal_retrieve_response"
350
351
  require_relative "whop_sdk/models/withdrawal_speeds"
351
352
  require_relative "whop_sdk/models/withdrawal_status"
352
353
  require_relative "whop_sdk/models/withdrawal_types"
354
+ require_relative "whop_sdk/models/withdrawal_updated_webhook_event"
353
355
  require_relative "whop_sdk/models"
354
356
  require_relative "whop_sdk/resources/access_tokens"
355
357
  require_relative "whop_sdk/resources/account_links"
@@ -375,8 +377,8 @@ require_relative "whop_sdk/resources/members"
375
377
  require_relative "whop_sdk/resources/memberships"
376
378
  require_relative "whop_sdk/resources/messages"
377
379
  require_relative "whop_sdk/resources/notifications"
380
+ require_relative "whop_sdk/resources/payment_methods"
378
381
  require_relative "whop_sdk/resources/payments"
379
- require_relative "whop_sdk/resources/payment_tokens"
380
382
  require_relative "whop_sdk/resources/plans"
381
383
  require_relative "whop_sdk/resources/products"
382
384
  require_relative "whop_sdk/resources/promo_codes"
@@ -133,8 +133,8 @@ module WhopSDK
133
133
  sig { returns(WhopSDK::Resources::SetupIntents) }
134
134
  attr_reader :setup_intents
135
135
 
136
- sig { returns(WhopSDK::Resources::PaymentTokens) }
137
- attr_reader :payment_tokens
136
+ sig { returns(WhopSDK::Resources::PaymentMethods) }
137
+ attr_reader :payment_methods
138
138
 
139
139
  # @api private
140
140
  sig { override.returns(T::Hash[String, String]) }
@@ -259,6 +259,10 @@ module WhopSDK
259
259
  sig { returns(T.nilable(Float)) }
260
260
  attr_accessor :renewal_price
261
261
 
262
+ # The number of payments required before pausing the subscription.
263
+ sig { returns(T.nilable(Integer)) }
264
+ attr_accessor :split_pay_required_payments
265
+
262
266
  # The title of the plan. This will be visible on the product page to customers.
263
267
  sig { returns(T.nilable(String)) }
264
268
  attr_accessor :title
@@ -308,6 +312,7 @@ module WhopSDK
308
312
  product_id: T.nilable(String),
309
313
  release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol),
310
314
  renewal_price: T.nilable(Float),
315
+ split_pay_required_payments: T.nilable(Integer),
311
316
  title: T.nilable(String),
312
317
  trial_period_days: T.nilable(Integer),
313
318
  visibility: T.nilable(WhopSDK::Visibility::OrSymbol)
@@ -352,6 +357,8 @@ module WhopSDK
352
357
  release_method: nil,
353
358
  # The amount the customer is charged every billing period.
354
359
  renewal_price: nil,
360
+ # The number of payments required before pausing the subscription.
361
+ split_pay_required_payments: nil,
355
362
  # The title of the plan. This will be visible on the product page to customers.
356
363
  title: nil,
357
364
  # The number of free trial days added before a renewal plan.
@@ -398,6 +405,7 @@ module WhopSDK
398
405
  product_id: T.nilable(String),
399
406
  release_method: T.nilable(WhopSDK::ReleaseMethod::OrSymbol),
400
407
  renewal_price: T.nilable(Float),
408
+ split_pay_required_payments: T.nilable(Integer),
401
409
  title: T.nilable(String),
402
410
  trial_period_days: T.nilable(Integer),
403
411
  visibility: T.nilable(WhopSDK::Visibility::OrSymbol)