whop_sdk 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +1 -1
- data/lib/whop_sdk/client.rb +3 -3
- data/lib/whop_sdk/internal/type/union.rb +12 -0
- data/lib/whop_sdk/models/invoice_create_params.rb +10 -1
- data/lib/whop_sdk/models/payment.rb +25 -27
- data/lib/whop_sdk/models/payment_create_params.rb +5 -5
- data/lib/whop_sdk/models/payment_list_response.rb +25 -27
- data/lib/whop_sdk/models/{payment_token_list_params.rb → payment_method_list_params.rb} +4 -4
- data/lib/whop_sdk/models/{payment_token_list_response.rb → payment_method_list_response.rb} +17 -18
- data/lib/whop_sdk/models/{payment_token_retrieve_params.rb → payment_method_retrieve_params.rb} +4 -4
- data/lib/whop_sdk/models/{payment_token_retrieve_response.rb → payment_method_retrieve_response.rb} +17 -18
- data/lib/whop_sdk/models/setup_intent.rb +22 -24
- data/lib/whop_sdk/models/setup_intent_list_response.rb +22 -24
- data/lib/whop_sdk/models/unwrap_webhook_event.rb +24 -21
- data/lib/whop_sdk/models.rb +4 -4
- data/lib/whop_sdk/resources/invoices.rb +3 -1
- data/lib/whop_sdk/resources/{payment_tokens.rb → payment_methods.rb} +24 -16
- data/lib/whop_sdk/resources/payments.rb +7 -5
- data/lib/whop_sdk/resources/setup_intents.rb +10 -2
- data/lib/whop_sdk/version.rb +1 -1
- data/lib/whop_sdk.rb +5 -5
- data/rbi/whop_sdk/client.rbi +2 -2
- data/rbi/whop_sdk/models/invoice_create_params.rbi +10 -0
- data/rbi/whop_sdk/models/payment.rbi +30 -33
- data/rbi/whop_sdk/models/payment_create_params.rbi +6 -6
- data/rbi/whop_sdk/models/payment_list_response.rbi +34 -37
- data/rbi/whop_sdk/models/{payment_token_list_params.rbi → payment_method_list_params.rbi} +4 -4
- data/rbi/whop_sdk/models/{payment_token_list_response.rbi → payment_method_list_response.rbi} +18 -20
- data/rbi/whop_sdk/models/{payment_token_retrieve_params.rbi → payment_method_retrieve_params.rbi} +7 -4
- data/rbi/whop_sdk/models/{payment_token_retrieve_response.rbi → payment_method_retrieve_response.rbi} +18 -20
- data/rbi/whop_sdk/models/setup_intent.rbi +27 -29
- data/rbi/whop_sdk/models/setup_intent_list_response.rbi +31 -32
- data/rbi/whop_sdk/models.rbi +4 -4
- data/rbi/whop_sdk/resources/invoices.rbi +4 -0
- data/rbi/whop_sdk/resources/{payment_tokens.rbi → payment_methods.rbi} +16 -8
- data/rbi/whop_sdk/resources/payments.rbi +8 -6
- data/rbi/whop_sdk/resources/setup_intents.rbi +10 -2
- data/sig/whop_sdk/client.rbs +1 -1
- data/sig/whop_sdk/models/invoice_create_params.rbs +5 -0
- data/sig/whop_sdk/models/payment.rbs +11 -11
- data/sig/whop_sdk/models/payment_create_params.rbs +4 -4
- data/sig/whop_sdk/models/payment_list_response.rbs +11 -11
- data/sig/whop_sdk/models/{payment_token_list_params.rbs → payment_method_list_params.rbs} +2 -2
- data/sig/whop_sdk/models/{payment_token_list_response.rbs → payment_method_list_response.rbs} +6 -6
- data/sig/whop_sdk/models/{payment_token_retrieve_params.rbs → payment_method_retrieve_params.rbs} +2 -2
- data/sig/whop_sdk/models/{payment_token_retrieve_response.rbs → payment_method_retrieve_response.rbs} +6 -6
- data/sig/whop_sdk/models/setup_intent.rbs +10 -10
- data/sig/whop_sdk/models/setup_intent_list_response.rbs +10 -10
- data/sig/whop_sdk/models.rbs +4 -4
- data/sig/whop_sdk/resources/invoices.rbs +1 -0
- data/sig/whop_sdk/resources/{payment_tokens.rbs → payment_methods.rbs} +3 -3
- data/sig/whop_sdk/resources/payments.rbs +1 -1
- metadata +16 -16
|
@@ -52,16 +52,16 @@ module WhopSDK
|
|
|
52
52
|
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
53
53
|
attr_accessor :metadata
|
|
54
54
|
|
|
55
|
-
# The payment
|
|
56
|
-
sig { returns(T.nilable(WhopSDK::SetupIntent::
|
|
57
|
-
attr_reader :
|
|
55
|
+
# The payment method created during the setup, if available.
|
|
56
|
+
sig { returns(T.nilable(WhopSDK::SetupIntent::PaymentMethod)) }
|
|
57
|
+
attr_reader :payment_method
|
|
58
58
|
|
|
59
59
|
sig do
|
|
60
60
|
params(
|
|
61
|
-
|
|
61
|
+
payment_method: T.nilable(WhopSDK::SetupIntent::PaymentMethod::OrHash)
|
|
62
62
|
).void
|
|
63
63
|
end
|
|
64
|
-
attr_writer :
|
|
64
|
+
attr_writer :payment_method
|
|
65
65
|
|
|
66
66
|
# The status of the setup intent
|
|
67
67
|
sig { returns(WhopSDK::SetupIntentStatus::TaggedSymbol) }
|
|
@@ -79,7 +79,8 @@ module WhopSDK
|
|
|
79
79
|
error_message: T.nilable(String),
|
|
80
80
|
member: T.nilable(WhopSDK::SetupIntent::Member::OrHash),
|
|
81
81
|
metadata: T.nilable(T::Hash[Symbol, T.anything]),
|
|
82
|
-
|
|
82
|
+
payment_method:
|
|
83
|
+
T.nilable(WhopSDK::SetupIntent::PaymentMethod::OrHash),
|
|
83
84
|
status: WhopSDK::SetupIntentStatus::OrSymbol
|
|
84
85
|
).returns(T.attached_class)
|
|
85
86
|
end
|
|
@@ -98,8 +99,8 @@ module WhopSDK
|
|
|
98
99
|
member:,
|
|
99
100
|
# The metadata associated with the setup intent
|
|
100
101
|
metadata:,
|
|
101
|
-
# The payment
|
|
102
|
-
|
|
102
|
+
# The payment method created during the setup, if available.
|
|
103
|
+
payment_method:,
|
|
103
104
|
# The status of the setup intent
|
|
104
105
|
status:
|
|
105
106
|
)
|
|
@@ -116,7 +117,7 @@ module WhopSDK
|
|
|
116
117
|
error_message: T.nilable(String),
|
|
117
118
|
member: T.nilable(WhopSDK::SetupIntent::Member),
|
|
118
119
|
metadata: T.nilable(T::Hash[Symbol, T.anything]),
|
|
119
|
-
|
|
120
|
+
payment_method: T.nilable(WhopSDK::SetupIntent::PaymentMethod),
|
|
120
121
|
status: WhopSDK::SetupIntentStatus::TaggedSymbol
|
|
121
122
|
}
|
|
122
123
|
)
|
|
@@ -278,57 +279,55 @@ module WhopSDK
|
|
|
278
279
|
end
|
|
279
280
|
end
|
|
280
281
|
|
|
281
|
-
class
|
|
282
|
+
class PaymentMethod < WhopSDK::Internal::Type::BaseModel
|
|
282
283
|
OrHash =
|
|
283
284
|
T.type_alias do
|
|
284
285
|
T.any(
|
|
285
|
-
WhopSDK::SetupIntent::
|
|
286
|
+
WhopSDK::SetupIntent::PaymentMethod,
|
|
286
287
|
WhopSDK::Internal::AnyHash
|
|
287
288
|
)
|
|
288
289
|
end
|
|
289
290
|
|
|
290
|
-
# The ID of the payment
|
|
291
|
+
# The ID of the payment method
|
|
291
292
|
sig { returns(String) }
|
|
292
293
|
attr_accessor :id
|
|
293
294
|
|
|
294
|
-
# The card data associated with the payment
|
|
295
|
-
|
|
296
|
-
sig { returns(T.nilable(WhopSDK::SetupIntent::PaymentToken::Card)) }
|
|
295
|
+
# The card data associated with the payment method, if its a debit or credit card.
|
|
296
|
+
sig { returns(T.nilable(WhopSDK::SetupIntent::PaymentMethod::Card)) }
|
|
297
297
|
attr_reader :card
|
|
298
298
|
|
|
299
299
|
sig do
|
|
300
300
|
params(
|
|
301
|
-
card: T.nilable(WhopSDK::SetupIntent::
|
|
301
|
+
card: T.nilable(WhopSDK::SetupIntent::PaymentMethod::Card::OrHash)
|
|
302
302
|
).void
|
|
303
303
|
end
|
|
304
304
|
attr_writer :card
|
|
305
305
|
|
|
306
|
-
# The date and time the payment
|
|
306
|
+
# The date and time the payment method was created
|
|
307
307
|
sig { returns(Time) }
|
|
308
308
|
attr_accessor :created_at
|
|
309
309
|
|
|
310
|
-
# The payment method type of the payment
|
|
310
|
+
# The payment method type of the payment method
|
|
311
311
|
sig { returns(WhopSDK::PaymentMethodTypes::TaggedSymbol) }
|
|
312
312
|
attr_accessor :payment_method_type
|
|
313
313
|
|
|
314
|
-
# The payment
|
|
314
|
+
# The payment method created during the setup, if available.
|
|
315
315
|
sig do
|
|
316
316
|
params(
|
|
317
317
|
id: String,
|
|
318
|
-
card: T.nilable(WhopSDK::SetupIntent::
|
|
318
|
+
card: T.nilable(WhopSDK::SetupIntent::PaymentMethod::Card::OrHash),
|
|
319
319
|
created_at: Time,
|
|
320
320
|
payment_method_type: WhopSDK::PaymentMethodTypes::OrSymbol
|
|
321
321
|
).returns(T.attached_class)
|
|
322
322
|
end
|
|
323
323
|
def self.new(
|
|
324
|
-
# The ID of the payment
|
|
324
|
+
# The ID of the payment method
|
|
325
325
|
id:,
|
|
326
|
-
# The card data associated with the payment
|
|
327
|
-
# token.
|
|
326
|
+
# The card data associated with the payment method, if its a debit or credit card.
|
|
328
327
|
card:,
|
|
329
|
-
# The date and time the payment
|
|
328
|
+
# The date and time the payment method was created
|
|
330
329
|
created_at:,
|
|
331
|
-
# The payment method type of the payment
|
|
330
|
+
# The payment method type of the payment method
|
|
332
331
|
payment_method_type:
|
|
333
332
|
)
|
|
334
333
|
end
|
|
@@ -337,7 +336,7 @@ module WhopSDK
|
|
|
337
336
|
override.returns(
|
|
338
337
|
{
|
|
339
338
|
id: String,
|
|
340
|
-
card: T.nilable(WhopSDK::SetupIntent::
|
|
339
|
+
card: T.nilable(WhopSDK::SetupIntent::PaymentMethod::Card),
|
|
341
340
|
created_at: Time,
|
|
342
341
|
payment_method_type: WhopSDK::PaymentMethodTypes::TaggedSymbol
|
|
343
342
|
}
|
|
@@ -350,7 +349,7 @@ module WhopSDK
|
|
|
350
349
|
OrHash =
|
|
351
350
|
T.type_alias do
|
|
352
351
|
T.any(
|
|
353
|
-
WhopSDK::SetupIntent::
|
|
352
|
+
WhopSDK::SetupIntent::PaymentMethod::Card,
|
|
354
353
|
WhopSDK::Internal::AnyHash
|
|
355
354
|
)
|
|
356
355
|
end
|
|
@@ -371,8 +370,7 @@ module WhopSDK
|
|
|
371
370
|
sig { returns(T.nilable(String)) }
|
|
372
371
|
attr_accessor :last4
|
|
373
372
|
|
|
374
|
-
# The card data associated with the payment
|
|
375
|
-
# token.
|
|
373
|
+
# The card data associated with the payment method, if its a debit or credit card.
|
|
376
374
|
sig do
|
|
377
375
|
params(
|
|
378
376
|
brand: T.nilable(WhopSDK::CardBrands::OrSymbol),
|
|
@@ -75,23 +75,23 @@ module WhopSDK
|
|
|
75
75
|
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
76
76
|
attr_accessor :metadata
|
|
77
77
|
|
|
78
|
-
# The payment
|
|
78
|
+
# The payment method created during the setup, if available.
|
|
79
79
|
sig do
|
|
80
80
|
returns(
|
|
81
|
-
T.nilable(WhopSDK::Models::SetupIntentListResponse::
|
|
81
|
+
T.nilable(WhopSDK::Models::SetupIntentListResponse::PaymentMethod)
|
|
82
82
|
)
|
|
83
83
|
end
|
|
84
|
-
attr_reader :
|
|
84
|
+
attr_reader :payment_method
|
|
85
85
|
|
|
86
86
|
sig do
|
|
87
87
|
params(
|
|
88
|
-
|
|
88
|
+
payment_method:
|
|
89
89
|
T.nilable(
|
|
90
|
-
WhopSDK::Models::SetupIntentListResponse::
|
|
90
|
+
WhopSDK::Models::SetupIntentListResponse::PaymentMethod::OrHash
|
|
91
91
|
)
|
|
92
92
|
).void
|
|
93
93
|
end
|
|
94
|
-
attr_writer :
|
|
94
|
+
attr_writer :payment_method
|
|
95
95
|
|
|
96
96
|
# The status of the setup intent
|
|
97
97
|
sig { returns(WhopSDK::SetupIntentStatus::TaggedSymbol) }
|
|
@@ -115,9 +115,9 @@ module WhopSDK
|
|
|
115
115
|
member:
|
|
116
116
|
T.nilable(WhopSDK::Models::SetupIntentListResponse::Member::OrHash),
|
|
117
117
|
metadata: T.nilable(T::Hash[Symbol, T.anything]),
|
|
118
|
-
|
|
118
|
+
payment_method:
|
|
119
119
|
T.nilable(
|
|
120
|
-
WhopSDK::Models::SetupIntentListResponse::
|
|
120
|
+
WhopSDK::Models::SetupIntentListResponse::PaymentMethod::OrHash
|
|
121
121
|
),
|
|
122
122
|
status: WhopSDK::SetupIntentStatus::OrSymbol
|
|
123
123
|
).returns(T.attached_class)
|
|
@@ -137,8 +137,8 @@ module WhopSDK
|
|
|
137
137
|
member:,
|
|
138
138
|
# The metadata associated with the setup intent
|
|
139
139
|
metadata:,
|
|
140
|
-
# The payment
|
|
141
|
-
|
|
140
|
+
# The payment method created during the setup, if available.
|
|
141
|
+
payment_method:,
|
|
142
142
|
# The status of the setup intent
|
|
143
143
|
status:
|
|
144
144
|
)
|
|
@@ -158,8 +158,10 @@ module WhopSDK
|
|
|
158
158
|
error_message: T.nilable(String),
|
|
159
159
|
member: T.nilable(WhopSDK::Models::SetupIntentListResponse::Member),
|
|
160
160
|
metadata: T.nilable(T::Hash[Symbol, T.anything]),
|
|
161
|
-
|
|
162
|
-
T.nilable(
|
|
161
|
+
payment_method:
|
|
162
|
+
T.nilable(
|
|
163
|
+
WhopSDK::Models::SetupIntentListResponse::PaymentMethod
|
|
164
|
+
),
|
|
163
165
|
status: WhopSDK::SetupIntentStatus::TaggedSymbol
|
|
164
166
|
}
|
|
165
167
|
)
|
|
@@ -343,25 +345,24 @@ module WhopSDK
|
|
|
343
345
|
end
|
|
344
346
|
end
|
|
345
347
|
|
|
346
|
-
class
|
|
348
|
+
class PaymentMethod < WhopSDK::Internal::Type::BaseModel
|
|
347
349
|
OrHash =
|
|
348
350
|
T.type_alias do
|
|
349
351
|
T.any(
|
|
350
|
-
WhopSDK::Models::SetupIntentListResponse::
|
|
352
|
+
WhopSDK::Models::SetupIntentListResponse::PaymentMethod,
|
|
351
353
|
WhopSDK::Internal::AnyHash
|
|
352
354
|
)
|
|
353
355
|
end
|
|
354
356
|
|
|
355
|
-
# The ID of the payment
|
|
357
|
+
# The ID of the payment method
|
|
356
358
|
sig { returns(String) }
|
|
357
359
|
attr_accessor :id
|
|
358
360
|
|
|
359
|
-
# The card data associated with the payment
|
|
360
|
-
# token.
|
|
361
|
+
# The card data associated with the payment method, if its a debit or credit card.
|
|
361
362
|
sig do
|
|
362
363
|
returns(
|
|
363
364
|
T.nilable(
|
|
364
|
-
WhopSDK::Models::SetupIntentListResponse::
|
|
365
|
+
WhopSDK::Models::SetupIntentListResponse::PaymentMethod::Card
|
|
365
366
|
)
|
|
366
367
|
)
|
|
367
368
|
end
|
|
@@ -371,41 +372,40 @@ module WhopSDK
|
|
|
371
372
|
params(
|
|
372
373
|
card:
|
|
373
374
|
T.nilable(
|
|
374
|
-
WhopSDK::Models::SetupIntentListResponse::
|
|
375
|
+
WhopSDK::Models::SetupIntentListResponse::PaymentMethod::Card::OrHash
|
|
375
376
|
)
|
|
376
377
|
).void
|
|
377
378
|
end
|
|
378
379
|
attr_writer :card
|
|
379
380
|
|
|
380
|
-
# The date and time the payment
|
|
381
|
+
# The date and time the payment method was created
|
|
381
382
|
sig { returns(Time) }
|
|
382
383
|
attr_accessor :created_at
|
|
383
384
|
|
|
384
|
-
# The payment method type of the payment
|
|
385
|
+
# The payment method type of the payment method
|
|
385
386
|
sig { returns(WhopSDK::PaymentMethodTypes::TaggedSymbol) }
|
|
386
387
|
attr_accessor :payment_method_type
|
|
387
388
|
|
|
388
|
-
# The payment
|
|
389
|
+
# The payment method created during the setup, if available.
|
|
389
390
|
sig do
|
|
390
391
|
params(
|
|
391
392
|
id: String,
|
|
392
393
|
card:
|
|
393
394
|
T.nilable(
|
|
394
|
-
WhopSDK::Models::SetupIntentListResponse::
|
|
395
|
+
WhopSDK::Models::SetupIntentListResponse::PaymentMethod::Card::OrHash
|
|
395
396
|
),
|
|
396
397
|
created_at: Time,
|
|
397
398
|
payment_method_type: WhopSDK::PaymentMethodTypes::OrSymbol
|
|
398
399
|
).returns(T.attached_class)
|
|
399
400
|
end
|
|
400
401
|
def self.new(
|
|
401
|
-
# The ID of the payment
|
|
402
|
+
# The ID of the payment method
|
|
402
403
|
id:,
|
|
403
|
-
# The card data associated with the payment
|
|
404
|
-
# token.
|
|
404
|
+
# The card data associated with the payment method, if its a debit or credit card.
|
|
405
405
|
card:,
|
|
406
|
-
# The date and time the payment
|
|
406
|
+
# The date and time the payment method was created
|
|
407
407
|
created_at:,
|
|
408
|
-
# The payment method type of the payment
|
|
408
|
+
# The payment method type of the payment method
|
|
409
409
|
payment_method_type:
|
|
410
410
|
)
|
|
411
411
|
end
|
|
@@ -416,7 +416,7 @@ module WhopSDK
|
|
|
416
416
|
id: String,
|
|
417
417
|
card:
|
|
418
418
|
T.nilable(
|
|
419
|
-
WhopSDK::Models::SetupIntentListResponse::
|
|
419
|
+
WhopSDK::Models::SetupIntentListResponse::PaymentMethod::Card
|
|
420
420
|
),
|
|
421
421
|
created_at: Time,
|
|
422
422
|
payment_method_type: WhopSDK::PaymentMethodTypes::TaggedSymbol
|
|
@@ -430,7 +430,7 @@ module WhopSDK
|
|
|
430
430
|
OrHash =
|
|
431
431
|
T.type_alias do
|
|
432
432
|
T.any(
|
|
433
|
-
WhopSDK::Models::SetupIntentListResponse::
|
|
433
|
+
WhopSDK::Models::SetupIntentListResponse::PaymentMethod::Card,
|
|
434
434
|
WhopSDK::Internal::AnyHash
|
|
435
435
|
)
|
|
436
436
|
end
|
|
@@ -451,8 +451,7 @@ module WhopSDK
|
|
|
451
451
|
sig { returns(T.nilable(String)) }
|
|
452
452
|
attr_accessor :last4
|
|
453
453
|
|
|
454
|
-
# The card data associated with the payment
|
|
455
|
-
# token.
|
|
454
|
+
# The card data associated with the payment method, if its a debit or credit card.
|
|
456
455
|
sig do
|
|
457
456
|
params(
|
|
458
457
|
brand: T.nilable(WhopSDK::CardBrands::OrSymbol),
|
data/rbi/whop_sdk/models.rbi
CHANGED
|
@@ -322,6 +322,10 @@ module WhopSDK
|
|
|
322
322
|
|
|
323
323
|
PaymentListParams = WhopSDK::Models::PaymentListParams
|
|
324
324
|
|
|
325
|
+
PaymentMethodListParams = WhopSDK::Models::PaymentMethodListParams
|
|
326
|
+
|
|
327
|
+
PaymentMethodRetrieveParams = WhopSDK::Models::PaymentMethodRetrieveParams
|
|
328
|
+
|
|
325
329
|
PaymentMethodTypes = WhopSDK::Models::PaymentMethodTypes
|
|
326
330
|
|
|
327
331
|
PaymentPendingWebhookEvent = WhopSDK::Models::PaymentPendingWebhookEvent
|
|
@@ -336,10 +340,6 @@ module WhopSDK
|
|
|
336
340
|
|
|
337
341
|
PaymentSucceededWebhookEvent = WhopSDK::Models::PaymentSucceededWebhookEvent
|
|
338
342
|
|
|
339
|
-
PaymentTokenListParams = WhopSDK::Models::PaymentTokenListParams
|
|
340
|
-
|
|
341
|
-
PaymentTokenRetrieveParams = WhopSDK::Models::PaymentTokenRetrieveParams
|
|
342
|
-
|
|
343
343
|
PaymentVoidParams = WhopSDK::Models::PaymentVoidParams
|
|
344
344
|
|
|
345
345
|
Plan = WhopSDK::Models::Plan
|
|
@@ -21,6 +21,7 @@ module WhopSDK
|
|
|
21
21
|
product_id: String,
|
|
22
22
|
charge_buyer_fee: T.nilable(T::Boolean),
|
|
23
23
|
customer_name: T.nilable(String),
|
|
24
|
+
payment_method_id: T.nilable(String),
|
|
24
25
|
payment_token_id: T.nilable(String),
|
|
25
26
|
request_options: WhopSDK::RequestOptions::OrHash
|
|
26
27
|
).returns(WhopSDK::Invoice)
|
|
@@ -54,6 +55,9 @@ module WhopSDK
|
|
|
54
55
|
# want to create an invoice for a customer who does not have a member of your
|
|
55
56
|
# company yet.
|
|
56
57
|
customer_name: nil,
|
|
58
|
+
# The payment method ID to use for this invoice. If using charge_automatically,
|
|
59
|
+
# you must provide a payment_method_id.
|
|
60
|
+
payment_method_id: nil,
|
|
57
61
|
# The payment token ID to use for this invoice. If using charge_automatically, you
|
|
58
62
|
# must provide a payment_token.
|
|
59
63
|
payment_token_id: nil,
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
module WhopSDK
|
|
4
4
|
module Resources
|
|
5
|
-
class
|
|
6
|
-
#
|
|
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
|
#
|
|
@@ -13,18 +17,22 @@ module WhopSDK
|
|
|
13
17
|
id: String,
|
|
14
18
|
member_id: String,
|
|
15
19
|
request_options: WhopSDK::RequestOptions::OrHash
|
|
16
|
-
).returns(WhopSDK::Models::
|
|
20
|
+
).returns(WhopSDK::Models::PaymentMethodRetrieveResponse)
|
|
17
21
|
end
|
|
18
22
|
def retrieve(
|
|
19
|
-
# The ID of the
|
|
23
|
+
# The ID of the PaymentMethod
|
|
20
24
|
id,
|
|
21
|
-
# The ID of the Member associated with the
|
|
25
|
+
# The ID of the Member associated with the PaymentMethod
|
|
22
26
|
member_id:,
|
|
23
27
|
request_options: {}
|
|
24
28
|
)
|
|
25
29
|
end
|
|
26
30
|
|
|
27
|
-
#
|
|
31
|
+
# A payment method is a stored representation of how a customer intends to pay,
|
|
32
|
+
# such as a card, bank account, or digital wallet. It holds the necessary billing
|
|
33
|
+
# details and can be attached to a member for future one-time or recurring
|
|
34
|
+
# charges. This lets you reuse the same payment credentials across multiple
|
|
35
|
+
# payments.
|
|
28
36
|
#
|
|
29
37
|
# Required permissions:
|
|
30
38
|
#
|
|
@@ -42,12 +50,12 @@ module WhopSDK
|
|
|
42
50
|
request_options: WhopSDK::RequestOptions::OrHash
|
|
43
51
|
).returns(
|
|
44
52
|
WhopSDK::Internal::CursorPage[
|
|
45
|
-
WhopSDK::Models::
|
|
53
|
+
WhopSDK::Models::PaymentMethodListResponse
|
|
46
54
|
]
|
|
47
55
|
)
|
|
48
56
|
end
|
|
49
57
|
def list(
|
|
50
|
-
# The ID of the Member to list payment
|
|
58
|
+
# The ID of the Member to list payment methods for
|
|
51
59
|
member_id:,
|
|
52
60
|
# Returns the elements in the list that come after the specified cursor.
|
|
53
61
|
after: nil,
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
module WhopSDK
|
|
4
4
|
module Resources
|
|
5
5
|
class Payments
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
6
|
+
# Charge an existing member off-session using one of their stored payment methods.
|
|
7
|
+
# You can provide an existing plan, or create a new one in-line. This endpoint
|
|
8
|
+
# will respond with a payment object immediately, but the payment is processed
|
|
9
|
+
# asynchronously in the background. Use webhooks to be notified when the payment
|
|
10
|
+
# succeeds or fails.
|
|
9
11
|
#
|
|
10
12
|
# Required permissions:
|
|
11
13
|
#
|
|
@@ -23,7 +25,7 @@ module WhopSDK
|
|
|
23
25
|
params(
|
|
24
26
|
company_id: String,
|
|
25
27
|
member_id: String,
|
|
26
|
-
|
|
28
|
+
payment_method_id: String,
|
|
27
29
|
plan: WhopSDK::PaymentCreateParams::Plan::OrHash,
|
|
28
30
|
plan_id: String,
|
|
29
31
|
request_options: WhopSDK::RequestOptions::OrHash
|
|
@@ -34,9 +36,9 @@ module WhopSDK
|
|
|
34
36
|
company_id:,
|
|
35
37
|
# The ID of the member to create the payment for.
|
|
36
38
|
member_id:,
|
|
37
|
-
# The ID of the payment
|
|
39
|
+
# The ID of the payment method to use for the payment. It must be connected to the
|
|
38
40
|
# Member being charged.
|
|
39
|
-
|
|
41
|
+
payment_method_id:,
|
|
40
42
|
# Pass this object to create a new plan for this payment
|
|
41
43
|
plan:,
|
|
42
44
|
# An ID of an existing plan to use for the payment.
|
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
module WhopSDK
|
|
4
4
|
module Resources
|
|
5
5
|
class SetupIntents
|
|
6
|
-
#
|
|
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
|
#
|
|
@@ -23,7 +27,11 @@ module WhopSDK
|
|
|
23
27
|
)
|
|
24
28
|
end
|
|
25
29
|
|
|
26
|
-
#
|
|
30
|
+
# A setup intent is an object used to securely collect and store a member’s
|
|
31
|
+
# payment method for future use without charging them immediately. It handles
|
|
32
|
+
# authentication steps up front so future off-session payments can be completed
|
|
33
|
+
# smoothly. This ensures the payment method is verified and ready for later
|
|
34
|
+
# billing.
|
|
27
35
|
#
|
|
28
36
|
# Required permissions:
|
|
29
37
|
#
|
data/sig/whop_sdk/client.rbs
CHANGED
|
@@ -88,7 +88,7 @@ module WhopSDK
|
|
|
88
88
|
|
|
89
89
|
attr_reader setup_intents: WhopSDK::Resources::SetupIntents
|
|
90
90
|
|
|
91
|
-
attr_reader
|
|
91
|
+
attr_reader payment_methods: WhopSDK::Resources::PaymentMethods
|
|
92
92
|
|
|
93
93
|
private def auth_headers: -> ::Hash[String, String]
|
|
94
94
|
|
|
@@ -10,6 +10,7 @@ module WhopSDK
|
|
|
10
10
|
product: WhopSDK::InvoiceCreateParams::Product,
|
|
11
11
|
charge_buyer_fee: bool?,
|
|
12
12
|
customer_name: String?,
|
|
13
|
+
payment_method_id: String?,
|
|
13
14
|
payment_token_id: String?,
|
|
14
15
|
email_address: String,
|
|
15
16
|
product_id: String
|
|
@@ -36,6 +37,8 @@ module WhopSDK
|
|
|
36
37
|
|
|
37
38
|
attr_accessor customer_name: String?
|
|
38
39
|
|
|
40
|
+
attr_accessor payment_method_id: String?
|
|
41
|
+
|
|
39
42
|
attr_accessor payment_token_id: String?
|
|
40
43
|
|
|
41
44
|
attr_accessor email_address: String
|
|
@@ -53,6 +56,7 @@ module WhopSDK
|
|
|
53
56
|
product_id: String,
|
|
54
57
|
?charge_buyer_fee: bool?,
|
|
55
58
|
?customer_name: String?,
|
|
59
|
+
?payment_method_id: String?,
|
|
56
60
|
?payment_token_id: String?,
|
|
57
61
|
?request_options: WhopSDK::request_opts
|
|
58
62
|
) -> void
|
|
@@ -66,6 +70,7 @@ module WhopSDK
|
|
|
66
70
|
product: WhopSDK::InvoiceCreateParams::Product,
|
|
67
71
|
charge_buyer_fee: bool?,
|
|
68
72
|
customer_name: String?,
|
|
73
|
+
payment_method_id: String?,
|
|
69
74
|
payment_token_id: String?,
|
|
70
75
|
email_address: String,
|
|
71
76
|
product_id: String,
|
|
@@ -19,8 +19,8 @@ module WhopSDK
|
|
|
19
19
|
membership: WhopSDK::Payment::Membership?,
|
|
20
20
|
metadata: ::Hash[Symbol, top]?,
|
|
21
21
|
paid_at: Time?,
|
|
22
|
+
payment_method: WhopSDK::Payment::PaymentMethod?,
|
|
22
23
|
payment_method_type: WhopSDK::Models::payment_method_types?,
|
|
23
|
-
payment_token: WhopSDK::Payment::PaymentToken?,
|
|
24
24
|
plan: WhopSDK::Payment::Plan?,
|
|
25
25
|
product: WhopSDK::Payment::Product?,
|
|
26
26
|
promo_code: WhopSDK::Payment::PromoCode?,
|
|
@@ -72,9 +72,9 @@ module WhopSDK
|
|
|
72
72
|
|
|
73
73
|
attr_accessor paid_at: Time?
|
|
74
74
|
|
|
75
|
-
attr_accessor
|
|
75
|
+
attr_accessor payment_method: WhopSDK::Payment::PaymentMethod?
|
|
76
76
|
|
|
77
|
-
attr_accessor
|
|
77
|
+
attr_accessor payment_method_type: WhopSDK::Models::payment_method_types?
|
|
78
78
|
|
|
79
79
|
attr_accessor plan: WhopSDK::Payment::Plan?
|
|
80
80
|
|
|
@@ -122,8 +122,8 @@ module WhopSDK
|
|
|
122
122
|
membership: WhopSDK::Payment::Membership?,
|
|
123
123
|
metadata: ::Hash[Symbol, top]?,
|
|
124
124
|
paid_at: Time?,
|
|
125
|
+
payment_method: WhopSDK::Payment::PaymentMethod?,
|
|
125
126
|
payment_method_type: WhopSDK::Models::payment_method_types?,
|
|
126
|
-
payment_token: WhopSDK::Payment::PaymentToken?,
|
|
127
127
|
plan: WhopSDK::Payment::Plan?,
|
|
128
128
|
product: WhopSDK::Payment::Product?,
|
|
129
129
|
promo_code: WhopSDK::Payment::PromoCode?,
|
|
@@ -158,8 +158,8 @@ module WhopSDK
|
|
|
158
158
|
membership: WhopSDK::Payment::Membership?,
|
|
159
159
|
metadata: ::Hash[Symbol, top]?,
|
|
160
160
|
paid_at: Time?,
|
|
161
|
+
payment_method: WhopSDK::Payment::PaymentMethod?,
|
|
161
162
|
payment_method_type: WhopSDK::Models::payment_method_types?,
|
|
162
|
-
payment_token: WhopSDK::Payment::PaymentToken?,
|
|
163
163
|
plan: WhopSDK::Payment::Plan?,
|
|
164
164
|
product: WhopSDK::Payment::Product?,
|
|
165
165
|
promo_code: WhopSDK::Payment::PromoCode?,
|
|
@@ -268,18 +268,18 @@ module WhopSDK
|
|
|
268
268
|
}
|
|
269
269
|
end
|
|
270
270
|
|
|
271
|
-
type
|
|
271
|
+
type payment_method =
|
|
272
272
|
{
|
|
273
273
|
id: String,
|
|
274
|
-
card: WhopSDK::Payment::
|
|
274
|
+
card: WhopSDK::Payment::PaymentMethod::Card?,
|
|
275
275
|
created_at: Time,
|
|
276
276
|
payment_method_type: WhopSDK::Models::payment_method_types
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
-
class
|
|
279
|
+
class PaymentMethod < WhopSDK::Internal::Type::BaseModel
|
|
280
280
|
attr_accessor id: String
|
|
281
281
|
|
|
282
|
-
attr_accessor card: WhopSDK::Payment::
|
|
282
|
+
attr_accessor card: WhopSDK::Payment::PaymentMethod::Card?
|
|
283
283
|
|
|
284
284
|
attr_accessor created_at: Time
|
|
285
285
|
|
|
@@ -287,14 +287,14 @@ module WhopSDK
|
|
|
287
287
|
|
|
288
288
|
def initialize: (
|
|
289
289
|
id: String,
|
|
290
|
-
card: WhopSDK::Payment::
|
|
290
|
+
card: WhopSDK::Payment::PaymentMethod::Card?,
|
|
291
291
|
created_at: Time,
|
|
292
292
|
payment_method_type: WhopSDK::Models::payment_method_types
|
|
293
293
|
) -> void
|
|
294
294
|
|
|
295
295
|
def to_hash: -> {
|
|
296
296
|
id: String,
|
|
297
|
-
card: WhopSDK::Payment::
|
|
297
|
+
card: WhopSDK::Payment::PaymentMethod::Card?,
|
|
298
298
|
created_at: Time,
|
|
299
299
|
payment_method_type: WhopSDK::Models::payment_method_types
|
|
300
300
|
}
|
|
@@ -4,7 +4,7 @@ module WhopSDK
|
|
|
4
4
|
{
|
|
5
5
|
company_id: String,
|
|
6
6
|
member_id: String,
|
|
7
|
-
|
|
7
|
+
payment_method_id: String,
|
|
8
8
|
plan: WhopSDK::PaymentCreateParams::Plan,
|
|
9
9
|
plan_id: String
|
|
10
10
|
}
|
|
@@ -18,7 +18,7 @@ module WhopSDK
|
|
|
18
18
|
|
|
19
19
|
attr_accessor member_id: String
|
|
20
20
|
|
|
21
|
-
attr_accessor
|
|
21
|
+
attr_accessor payment_method_id: String
|
|
22
22
|
|
|
23
23
|
attr_accessor plan: WhopSDK::PaymentCreateParams::Plan
|
|
24
24
|
|
|
@@ -27,7 +27,7 @@ module WhopSDK
|
|
|
27
27
|
def initialize: (
|
|
28
28
|
company_id: String,
|
|
29
29
|
member_id: String,
|
|
30
|
-
|
|
30
|
+
payment_method_id: String,
|
|
31
31
|
plan: WhopSDK::PaymentCreateParams::Plan,
|
|
32
32
|
plan_id: String,
|
|
33
33
|
?request_options: WhopSDK::request_opts
|
|
@@ -36,7 +36,7 @@ module WhopSDK
|
|
|
36
36
|
def to_hash: -> {
|
|
37
37
|
company_id: String,
|
|
38
38
|
member_id: String,
|
|
39
|
-
|
|
39
|
+
payment_method_id: String,
|
|
40
40
|
plan: WhopSDK::PaymentCreateParams::Plan,
|
|
41
41
|
plan_id: String,
|
|
42
42
|
request_options: WhopSDK::RequestOptions
|