whop_sdk 0.0.9 → 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 +23 -0
- data/README.md +1 -1
- data/lib/whop_sdk/client.rb +8 -0
- data/lib/whop_sdk/internal/type/union.rb +12 -0
- data/lib/whop_sdk/models/app_build_create_params.rb +9 -1
- data/lib/whop_sdk/models/invoice_create_params.rb +10 -1
- data/lib/whop_sdk/models/payment.rb +88 -1
- data/lib/whop_sdk/models/payment_create_params.rb +307 -0
- data/lib/whop_sdk/models/payment_list_response.rb +88 -1
- data/lib/whop_sdk/models/payment_method_list_params.rb +78 -0
- data/lib/whop_sdk/models/payment_method_list_response.rb +85 -0
- data/lib/whop_sdk/models/payment_method_retrieve_params.rb +22 -0
- data/lib/whop_sdk/models/payment_method_retrieve_response.rb +85 -0
- data/lib/whop_sdk/models/setup_intent.rb +251 -0
- data/lib/whop_sdk/models/setup_intent_canceled_webhook_event.rb +52 -0
- data/lib/whop_sdk/models/setup_intent_list_params.rb +78 -0
- data/lib/whop_sdk/models/setup_intent_list_response.rb +253 -0
- data/lib/whop_sdk/models/setup_intent_requires_action_webhook_event.rb +52 -0
- data/lib/whop_sdk/models/setup_intent_retrieve_params.rb +14 -0
- data/lib/whop_sdk/models/setup_intent_status.rb +18 -0
- data/lib/whop_sdk/models/setup_intent_succeeded_webhook_event.rb +52 -0
- data/lib/whop_sdk/models/unwrap_webhook_event.rb +28 -19
- data/lib/whop_sdk/models.rb +20 -0
- data/lib/whop_sdk/resources/app_builds.rb +3 -1
- data/lib/whop_sdk/resources/invoices.rb +3 -1
- data/lib/whop_sdk/resources/payment_methods.rb +91 -0
- data/lib/whop_sdk/resources/payments.rb +50 -0
- data/lib/whop_sdk/resources/setup_intents.rb +91 -0
- data/lib/whop_sdk/resources/webhooks.rb +1 -1
- data/lib/whop_sdk/version.rb +1 -1
- data/lib/whop_sdk.rb +15 -0
- data/rbi/whop_sdk/client.rbi +6 -0
- data/rbi/whop_sdk/models/app_build_create_params.rbi +8 -0
- data/rbi/whop_sdk/models/invoice_create_params.rbi +10 -0
- data/rbi/whop_sdk/models/payment.rbi +139 -0
- data/rbi/whop_sdk/models/payment_create_params.rbi +384 -0
- data/rbi/whop_sdk/models/payment_list_response.rbi +164 -0
- data/rbi/whop_sdk/models/payment_method_list_params.rbi +99 -0
- data/rbi/whop_sdk/models/payment_method_list_response.rbi +137 -0
- data/rbi/whop_sdk/models/payment_method_retrieve_params.rbi +43 -0
- data/rbi/whop_sdk/models/payment_method_retrieve_response.rbi +142 -0
- data/rbi/whop_sdk/models/setup_intent.rbi +410 -0
- data/rbi/whop_sdk/models/setup_intent_canceled_webhook_event.rbi +77 -0
- data/rbi/whop_sdk/models/setup_intent_list_params.rbi +99 -0
- data/rbi/whop_sdk/models/setup_intent_list_response.rbi +491 -0
- data/rbi/whop_sdk/models/setup_intent_requires_action_webhook_event.rbi +77 -0
- data/rbi/whop_sdk/models/setup_intent_retrieve_params.rbi +27 -0
- data/rbi/whop_sdk/models/setup_intent_status.rbi +25 -0
- data/rbi/whop_sdk/models/setup_intent_succeeded_webhook_event.rbi +77 -0
- data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +3 -0
- data/rbi/whop_sdk/models.rbi +23 -0
- data/rbi/whop_sdk/resources/app_builds.rbi +3 -0
- data/rbi/whop_sdk/resources/invoices.rbi +4 -0
- data/rbi/whop_sdk/resources/payment_methods.rbi +84 -0
- data/rbi/whop_sdk/resources/payments.rbi +44 -0
- data/rbi/whop_sdk/resources/setup_intents.rbi +85 -0
- data/rbi/whop_sdk/resources/webhooks.rbi +3 -0
- data/sig/whop_sdk/client.rbs +4 -0
- data/sig/whop_sdk/models/app_build_create_params.rbs +5 -0
- data/sig/whop_sdk/models/invoice_create_params.rbs +5 -0
- data/sig/whop_sdk/models/payment.rbs +69 -0
- data/sig/whop_sdk/models/payment_create_params.rbs +210 -0
- data/sig/whop_sdk/models/payment_list_response.rbs +69 -0
- data/sig/whop_sdk/models/payment_method_list_params.rbs +61 -0
- data/sig/whop_sdk/models/payment_method_list_response.rbs +67 -0
- data/sig/whop_sdk/models/payment_method_retrieve_params.rbs +23 -0
- data/sig/whop_sdk/models/payment_method_retrieve_response.rbs +67 -0
- data/sig/whop_sdk/models/setup_intent.rbs +189 -0
- data/sig/whop_sdk/models/setup_intent_canceled_webhook_event.rbs +40 -0
- data/sig/whop_sdk/models/setup_intent_list_params.rbs +61 -0
- data/sig/whop_sdk/models/setup_intent_list_response.rbs +193 -0
- data/sig/whop_sdk/models/setup_intent_requires_action_webhook_event.rbs +40 -0
- data/sig/whop_sdk/models/setup_intent_retrieve_params.rbs +15 -0
- data/sig/whop_sdk/models/setup_intent_status.rbs +17 -0
- data/sig/whop_sdk/models/setup_intent_succeeded_webhook_event.rbs +40 -0
- data/sig/whop_sdk/models/unwrap_webhook_event.rbs +3 -0
- data/sig/whop_sdk/models.rbs +20 -0
- data/sig/whop_sdk/resources/app_builds.rbs +1 -0
- data/sig/whop_sdk/resources/invoices.rbs +1 -0
- data/sig/whop_sdk/resources/payment_methods.rbs +25 -0
- data/sig/whop_sdk/resources/payments.rbs +9 -0
- data/sig/whop_sdk/resources/setup_intents.rbs +24 -0
- data/sig/whop_sdk/resources/webhooks.rbs +3 -0
- metadata +47 -2
|
@@ -107,6 +107,12 @@ module WhopSDK
|
|
|
107
107
|
# @return [Time, nil]
|
|
108
108
|
required :paid_at, Time, nil?: true
|
|
109
109
|
|
|
110
|
+
# @!attribute payment_method
|
|
111
|
+
# The payment method used for the payment, if available.
|
|
112
|
+
#
|
|
113
|
+
# @return [WhopSDK::Models::PaymentListResponse::PaymentMethod, nil]
|
|
114
|
+
required :payment_method, -> { WhopSDK::Models::PaymentListResponse::PaymentMethod }, nil?: true
|
|
115
|
+
|
|
110
116
|
# @!attribute payment_method_type
|
|
111
117
|
# The different types of payment methods that can be used.
|
|
112
118
|
#
|
|
@@ -201,7 +207,7 @@ module WhopSDK
|
|
|
201
207
|
# @return [Boolean]
|
|
202
208
|
required :voidable, WhopSDK::Internal::Type::Boolean
|
|
203
209
|
|
|
204
|
-
# @!method initialize(id:, amount_after_fees:, auto_refunded:, billing_address:, billing_reason:, card_brand:, card_last4:, company:, created_at:, currency:, dispute_alerted_at:, failure_message:, last_payment_attempt:, member:, membership:, metadata:, paid_at:, payment_method_type:, plan:, product:, promo_code:, refundable:, refunded_amount:, refunded_at:, retryable:, status:, substatus:, subtotal:, total:, usd_total:, user:, voidable:)
|
|
210
|
+
# @!method initialize(id:, amount_after_fees:, auto_refunded:, billing_address:, billing_reason:, card_brand:, card_last4:, company:, created_at:, currency:, dispute_alerted_at:, failure_message:, last_payment_attempt:, member:, membership:, metadata:, paid_at:, payment_method:, payment_method_type:, plan:, product:, promo_code:, refundable:, refunded_amount:, refunded_at:, retryable:, status:, substatus:, subtotal:, total:, usd_total:, user:, voidable:)
|
|
205
211
|
# Some parameter documentations has been truncated, see
|
|
206
212
|
# {WhopSDK::Models::PaymentListResponse} for more details.
|
|
207
213
|
#
|
|
@@ -241,6 +247,8 @@ module WhopSDK
|
|
|
241
247
|
#
|
|
242
248
|
# @param paid_at [Time, nil] The datetime the payment was paid
|
|
243
249
|
#
|
|
250
|
+
# @param payment_method [WhopSDK::Models::PaymentListResponse::PaymentMethod, nil] The payment method used for the payment, if available.
|
|
251
|
+
#
|
|
244
252
|
# @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes, nil] The different types of payment methods that can be used.
|
|
245
253
|
#
|
|
246
254
|
# @param plan [WhopSDK::Models::PaymentListResponse::Plan, nil] The plan attached to this payment.
|
|
@@ -407,6 +415,85 @@ module WhopSDK
|
|
|
407
415
|
# @param status [Symbol, WhopSDK::Models::MembershipStatus] The state of the membership.
|
|
408
416
|
end
|
|
409
417
|
|
|
418
|
+
# @see WhopSDK::Models::PaymentListResponse#payment_method
|
|
419
|
+
class PaymentMethod < WhopSDK::Internal::Type::BaseModel
|
|
420
|
+
# @!attribute id
|
|
421
|
+
# The ID of the payment method
|
|
422
|
+
#
|
|
423
|
+
# @return [String]
|
|
424
|
+
required :id, String
|
|
425
|
+
|
|
426
|
+
# @!attribute card
|
|
427
|
+
# The card data associated with the payment method, if its a debit or credit card.
|
|
428
|
+
#
|
|
429
|
+
# @return [WhopSDK::Models::PaymentListResponse::PaymentMethod::Card, nil]
|
|
430
|
+
required :card, -> { WhopSDK::Models::PaymentListResponse::PaymentMethod::Card }, nil?: true
|
|
431
|
+
|
|
432
|
+
# @!attribute created_at
|
|
433
|
+
# The date and time the payment method was created
|
|
434
|
+
#
|
|
435
|
+
# @return [Time]
|
|
436
|
+
required :created_at, Time
|
|
437
|
+
|
|
438
|
+
# @!attribute payment_method_type
|
|
439
|
+
# The payment method type of the payment method
|
|
440
|
+
#
|
|
441
|
+
# @return [Symbol, WhopSDK::Models::PaymentMethodTypes]
|
|
442
|
+
required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }
|
|
443
|
+
|
|
444
|
+
# @!method initialize(id:, card:, created_at:, payment_method_type:)
|
|
445
|
+
# Some parameter documentations has been truncated, see
|
|
446
|
+
# {WhopSDK::Models::PaymentListResponse::PaymentMethod} for more details.
|
|
447
|
+
#
|
|
448
|
+
# The payment method used for the payment, if available.
|
|
449
|
+
#
|
|
450
|
+
# @param id [String] The ID of the payment method
|
|
451
|
+
#
|
|
452
|
+
# @param card [WhopSDK::Models::PaymentListResponse::PaymentMethod::Card, nil] The card data associated with the payment method, if its a debit or credit card.
|
|
453
|
+
#
|
|
454
|
+
# @param created_at [Time] The date and time the payment method was created
|
|
455
|
+
#
|
|
456
|
+
# @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The payment method type of the payment method
|
|
457
|
+
|
|
458
|
+
# @see WhopSDK::Models::PaymentListResponse::PaymentMethod#card
|
|
459
|
+
class Card < WhopSDK::Internal::Type::BaseModel
|
|
460
|
+
# @!attribute brand
|
|
461
|
+
# Possible card brands that a payment token can have
|
|
462
|
+
#
|
|
463
|
+
# @return [Symbol, WhopSDK::Models::CardBrands, nil]
|
|
464
|
+
required :brand, enum: -> { WhopSDK::CardBrands }, nil?: true
|
|
465
|
+
|
|
466
|
+
# @!attribute exp_month
|
|
467
|
+
# Card expiration month, like 03 for March.
|
|
468
|
+
#
|
|
469
|
+
# @return [Integer, nil]
|
|
470
|
+
required :exp_month, Integer, nil?: true
|
|
471
|
+
|
|
472
|
+
# @!attribute exp_year
|
|
473
|
+
# Card expiration year, like 27 for 2027.
|
|
474
|
+
#
|
|
475
|
+
# @return [Integer, nil]
|
|
476
|
+
required :exp_year, Integer, nil?: true
|
|
477
|
+
|
|
478
|
+
# @!attribute last4
|
|
479
|
+
# Last four digits of the card.
|
|
480
|
+
#
|
|
481
|
+
# @return [String, nil]
|
|
482
|
+
required :last4, String, nil?: true
|
|
483
|
+
|
|
484
|
+
# @!method initialize(brand:, exp_month:, exp_year:, last4:)
|
|
485
|
+
# The card data associated with the payment method, if its a debit or credit card.
|
|
486
|
+
#
|
|
487
|
+
# @param brand [Symbol, WhopSDK::Models::CardBrands, nil] Possible card brands that a payment token can have
|
|
488
|
+
#
|
|
489
|
+
# @param exp_month [Integer, nil] Card expiration month, like 03 for March.
|
|
490
|
+
#
|
|
491
|
+
# @param exp_year [Integer, nil] Card expiration year, like 27 for 2027.
|
|
492
|
+
#
|
|
493
|
+
# @param last4 [String, nil] Last four digits of the card.
|
|
494
|
+
end
|
|
495
|
+
end
|
|
496
|
+
|
|
410
497
|
# @see WhopSDK::Models::PaymentListResponse#plan
|
|
411
498
|
class Plan < WhopSDK::Internal::Type::BaseModel
|
|
412
499
|
# @!attribute id
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::PaymentMethods#list
|
|
6
|
+
class PaymentMethodListParams < WhopSDK::Internal::Type::BaseModel
|
|
7
|
+
extend WhopSDK::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include WhopSDK::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute member_id
|
|
11
|
+
# The ID of the Member to list payment methods for
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :member_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 created_after
|
|
29
|
+
# The minimum creation date to filter by
|
|
30
|
+
#
|
|
31
|
+
# @return [Time, nil]
|
|
32
|
+
optional :created_after, Time, nil?: true
|
|
33
|
+
|
|
34
|
+
# @!attribute created_before
|
|
35
|
+
# The maximum creation date to filter by
|
|
36
|
+
#
|
|
37
|
+
# @return [Time, nil]
|
|
38
|
+
optional :created_before, Time, nil?: true
|
|
39
|
+
|
|
40
|
+
# @!attribute direction
|
|
41
|
+
# The direction of the sort.
|
|
42
|
+
#
|
|
43
|
+
# @return [Symbol, WhopSDK::Models::Direction, nil]
|
|
44
|
+
optional :direction, enum: -> { WhopSDK::Direction }, nil?: true
|
|
45
|
+
|
|
46
|
+
# @!attribute first
|
|
47
|
+
# Returns the first _n_ elements from the list.
|
|
48
|
+
#
|
|
49
|
+
# @return [Integer, nil]
|
|
50
|
+
optional :first, Integer, nil?: true
|
|
51
|
+
|
|
52
|
+
# @!attribute last
|
|
53
|
+
# Returns the last _n_ elements from the list.
|
|
54
|
+
#
|
|
55
|
+
# @return [Integer, nil]
|
|
56
|
+
optional :last, Integer, nil?: true
|
|
57
|
+
|
|
58
|
+
# @!method initialize(member_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {})
|
|
59
|
+
# @param member_id [String] The ID of the Member to list payment methods for
|
|
60
|
+
#
|
|
61
|
+
# @param after [String, nil] Returns the elements in the list that come after the specified cursor.
|
|
62
|
+
#
|
|
63
|
+
# @param before [String, nil] Returns the elements in the list that come before the specified cursor.
|
|
64
|
+
#
|
|
65
|
+
# @param created_after [Time, nil] The minimum creation date to filter by
|
|
66
|
+
#
|
|
67
|
+
# @param created_before [Time, nil] The maximum creation date to filter by
|
|
68
|
+
#
|
|
69
|
+
# @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort.
|
|
70
|
+
#
|
|
71
|
+
# @param first [Integer, nil] Returns the first _n_ elements from the list.
|
|
72
|
+
#
|
|
73
|
+
# @param last [Integer, nil] Returns the last _n_ elements from the list.
|
|
74
|
+
#
|
|
75
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @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.
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::PaymentMethods#retrieve
|
|
6
|
+
class PaymentMethodRetrieveParams < WhopSDK::Internal::Type::BaseModel
|
|
7
|
+
extend WhopSDK::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include WhopSDK::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute member_id
|
|
11
|
+
# The ID of the Member associated with the PaymentMethod
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :member_id, String
|
|
15
|
+
|
|
16
|
+
# @!method initialize(member_id:, request_options: {})
|
|
17
|
+
# @param member_id [String] The ID of the Member associated with the PaymentMethod
|
|
18
|
+
#
|
|
19
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @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.
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::SetupIntents#retrieve
|
|
6
|
+
class SetupIntent < WhopSDK::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# The setup intent ID
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute checkout_configuration
|
|
14
|
+
# The checkout configuration associated with the setup intent
|
|
15
|
+
#
|
|
16
|
+
# @return [WhopSDK::Models::SetupIntent::CheckoutConfiguration, nil]
|
|
17
|
+
required :checkout_configuration, -> { WhopSDK::SetupIntent::CheckoutConfiguration }, nil?: true
|
|
18
|
+
|
|
19
|
+
# @!attribute company
|
|
20
|
+
# The company of the setup intent
|
|
21
|
+
#
|
|
22
|
+
# @return [WhopSDK::Models::SetupIntent::Company, nil]
|
|
23
|
+
required :company, -> { WhopSDK::SetupIntent::Company }, nil?: true
|
|
24
|
+
|
|
25
|
+
# @!attribute created_at
|
|
26
|
+
# The datetime the payment was created
|
|
27
|
+
#
|
|
28
|
+
# @return [Time]
|
|
29
|
+
required :created_at, Time
|
|
30
|
+
|
|
31
|
+
# @!attribute error_message
|
|
32
|
+
# The error message, if any.
|
|
33
|
+
#
|
|
34
|
+
# @return [String, nil]
|
|
35
|
+
required :error_message, String, nil?: true
|
|
36
|
+
|
|
37
|
+
# @!attribute member
|
|
38
|
+
# The member connected to the setup intent
|
|
39
|
+
#
|
|
40
|
+
# @return [WhopSDK::Models::SetupIntent::Member, nil]
|
|
41
|
+
required :member, -> { WhopSDK::SetupIntent::Member }, nil?: true
|
|
42
|
+
|
|
43
|
+
# @!attribute metadata
|
|
44
|
+
# The metadata associated with the setup intent
|
|
45
|
+
#
|
|
46
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
47
|
+
required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true
|
|
48
|
+
|
|
49
|
+
# @!attribute payment_method
|
|
50
|
+
# The payment method created during the setup, if available.
|
|
51
|
+
#
|
|
52
|
+
# @return [WhopSDK::Models::SetupIntent::PaymentMethod, nil]
|
|
53
|
+
required :payment_method, -> { WhopSDK::SetupIntent::PaymentMethod }, nil?: true
|
|
54
|
+
|
|
55
|
+
# @!attribute status
|
|
56
|
+
# The status of the setup intent
|
|
57
|
+
#
|
|
58
|
+
# @return [Symbol, WhopSDK::Models::SetupIntentStatus]
|
|
59
|
+
required :status, enum: -> { WhopSDK::SetupIntentStatus }
|
|
60
|
+
|
|
61
|
+
# @!method initialize(id:, checkout_configuration:, company:, created_at:, error_message:, member:, metadata:, payment_method:, status:)
|
|
62
|
+
# An object representing a setup intent, which is a flow for allowing a customer
|
|
63
|
+
# to add a payment method to their account without making a purchase.
|
|
64
|
+
#
|
|
65
|
+
# @param id [String] The setup intent ID
|
|
66
|
+
#
|
|
67
|
+
# @param checkout_configuration [WhopSDK::Models::SetupIntent::CheckoutConfiguration, nil] The checkout configuration associated with the setup intent
|
|
68
|
+
#
|
|
69
|
+
# @param company [WhopSDK::Models::SetupIntent::Company, nil] The company of the setup intent
|
|
70
|
+
#
|
|
71
|
+
# @param created_at [Time] The datetime the payment was created
|
|
72
|
+
#
|
|
73
|
+
# @param error_message [String, nil] The error message, if any.
|
|
74
|
+
#
|
|
75
|
+
# @param member [WhopSDK::Models::SetupIntent::Member, nil] The member connected to the setup intent
|
|
76
|
+
#
|
|
77
|
+
# @param metadata [Hash{Symbol=>Object}, nil] The metadata associated with the setup intent
|
|
78
|
+
#
|
|
79
|
+
# @param payment_method [WhopSDK::Models::SetupIntent::PaymentMethod, nil] The payment method created during the setup, if available.
|
|
80
|
+
#
|
|
81
|
+
# @param status [Symbol, WhopSDK::Models::SetupIntentStatus] The status of the setup intent
|
|
82
|
+
|
|
83
|
+
# @see WhopSDK::Models::SetupIntent#checkout_configuration
|
|
84
|
+
class CheckoutConfiguration < WhopSDK::Internal::Type::BaseModel
|
|
85
|
+
# @!attribute id
|
|
86
|
+
# The ID of the checkout configuration
|
|
87
|
+
#
|
|
88
|
+
# @return [String]
|
|
89
|
+
required :id, String
|
|
90
|
+
|
|
91
|
+
# @!method initialize(id:)
|
|
92
|
+
# The checkout configuration associated with the setup intent
|
|
93
|
+
#
|
|
94
|
+
# @param id [String] The ID of the checkout configuration
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# @see WhopSDK::Models::SetupIntent#company
|
|
98
|
+
class Company < WhopSDK::Internal::Type::BaseModel
|
|
99
|
+
# @!attribute id
|
|
100
|
+
# The ID (tag) of the company.
|
|
101
|
+
#
|
|
102
|
+
# @return [String]
|
|
103
|
+
required :id, String
|
|
104
|
+
|
|
105
|
+
# @!method initialize(id:)
|
|
106
|
+
# The company of the setup intent
|
|
107
|
+
#
|
|
108
|
+
# @param id [String] The ID (tag) of the company.
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# @see WhopSDK::Models::SetupIntent#member
|
|
112
|
+
class Member < WhopSDK::Internal::Type::BaseModel
|
|
113
|
+
# @!attribute id
|
|
114
|
+
# The ID of the member
|
|
115
|
+
#
|
|
116
|
+
# @return [String]
|
|
117
|
+
required :id, String
|
|
118
|
+
|
|
119
|
+
# @!attribute user
|
|
120
|
+
# The user for this member, if any.
|
|
121
|
+
#
|
|
122
|
+
# @return [WhopSDK::Models::SetupIntent::Member::User, nil]
|
|
123
|
+
required :user, -> { WhopSDK::SetupIntent::Member::User }, nil?: true
|
|
124
|
+
|
|
125
|
+
# @!method initialize(id:, user:)
|
|
126
|
+
# The member connected to the setup intent
|
|
127
|
+
#
|
|
128
|
+
# @param id [String] The ID of the member
|
|
129
|
+
#
|
|
130
|
+
# @param user [WhopSDK::Models::SetupIntent::Member::User, nil] The user for this member, if any.
|
|
131
|
+
|
|
132
|
+
# @see WhopSDK::Models::SetupIntent::Member#user
|
|
133
|
+
class User < WhopSDK::Internal::Type::BaseModel
|
|
134
|
+
# @!attribute id
|
|
135
|
+
# The internal ID of the user account.
|
|
136
|
+
#
|
|
137
|
+
# @return [String]
|
|
138
|
+
required :id, String
|
|
139
|
+
|
|
140
|
+
# @!attribute email
|
|
141
|
+
# The digital mailing address of the user.
|
|
142
|
+
#
|
|
143
|
+
# @return [String, nil]
|
|
144
|
+
required :email, String, nil?: true
|
|
145
|
+
|
|
146
|
+
# @!attribute name
|
|
147
|
+
# The user's full name.
|
|
148
|
+
#
|
|
149
|
+
# @return [String, nil]
|
|
150
|
+
required :name, String, nil?: true
|
|
151
|
+
|
|
152
|
+
# @!attribute username
|
|
153
|
+
# The whop username.
|
|
154
|
+
#
|
|
155
|
+
# @return [String]
|
|
156
|
+
required :username, String
|
|
157
|
+
|
|
158
|
+
# @!method initialize(id:, email:, name:, username:)
|
|
159
|
+
# The user for this member, if any.
|
|
160
|
+
#
|
|
161
|
+
# @param id [String] The internal ID of the user account.
|
|
162
|
+
#
|
|
163
|
+
# @param email [String, nil] The digital mailing address of the user.
|
|
164
|
+
#
|
|
165
|
+
# @param name [String, nil] The user's full name.
|
|
166
|
+
#
|
|
167
|
+
# @param username [String] The whop username.
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# @see WhopSDK::Models::SetupIntent#payment_method
|
|
172
|
+
class PaymentMethod < WhopSDK::Internal::Type::BaseModel
|
|
173
|
+
# @!attribute id
|
|
174
|
+
# The ID of the payment method
|
|
175
|
+
#
|
|
176
|
+
# @return [String]
|
|
177
|
+
required :id, String
|
|
178
|
+
|
|
179
|
+
# @!attribute card
|
|
180
|
+
# The card data associated with the payment method, if its a debit or credit card.
|
|
181
|
+
#
|
|
182
|
+
# @return [WhopSDK::Models::SetupIntent::PaymentMethod::Card, nil]
|
|
183
|
+
required :card, -> { WhopSDK::SetupIntent::PaymentMethod::Card }, nil?: true
|
|
184
|
+
|
|
185
|
+
# @!attribute created_at
|
|
186
|
+
# The date and time the payment method was created
|
|
187
|
+
#
|
|
188
|
+
# @return [Time]
|
|
189
|
+
required :created_at, Time
|
|
190
|
+
|
|
191
|
+
# @!attribute payment_method_type
|
|
192
|
+
# The payment method type of the payment method
|
|
193
|
+
#
|
|
194
|
+
# @return [Symbol, WhopSDK::Models::PaymentMethodTypes]
|
|
195
|
+
required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }
|
|
196
|
+
|
|
197
|
+
# @!method initialize(id:, card:, created_at:, payment_method_type:)
|
|
198
|
+
# Some parameter documentations has been truncated, see
|
|
199
|
+
# {WhopSDK::Models::SetupIntent::PaymentMethod} for more details.
|
|
200
|
+
#
|
|
201
|
+
# The payment method created during the setup, if available.
|
|
202
|
+
#
|
|
203
|
+
# @param id [String] The ID of the payment method
|
|
204
|
+
#
|
|
205
|
+
# @param card [WhopSDK::Models::SetupIntent::PaymentMethod::Card, nil] The card data associated with the payment method, if its a debit or credit card.
|
|
206
|
+
#
|
|
207
|
+
# @param created_at [Time] The date and time the payment method was created
|
|
208
|
+
#
|
|
209
|
+
# @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The payment method type of the payment method
|
|
210
|
+
|
|
211
|
+
# @see WhopSDK::Models::SetupIntent::PaymentMethod#card
|
|
212
|
+
class Card < WhopSDK::Internal::Type::BaseModel
|
|
213
|
+
# @!attribute brand
|
|
214
|
+
# Possible card brands that a payment token can have
|
|
215
|
+
#
|
|
216
|
+
# @return [Symbol, WhopSDK::Models::CardBrands, nil]
|
|
217
|
+
required :brand, enum: -> { WhopSDK::CardBrands }, nil?: true
|
|
218
|
+
|
|
219
|
+
# @!attribute exp_month
|
|
220
|
+
# Card expiration month, like 03 for March.
|
|
221
|
+
#
|
|
222
|
+
# @return [Integer, nil]
|
|
223
|
+
required :exp_month, Integer, nil?: true
|
|
224
|
+
|
|
225
|
+
# @!attribute exp_year
|
|
226
|
+
# Card expiration year, like 27 for 2027.
|
|
227
|
+
#
|
|
228
|
+
# @return [Integer, nil]
|
|
229
|
+
required :exp_year, Integer, nil?: true
|
|
230
|
+
|
|
231
|
+
# @!attribute last4
|
|
232
|
+
# Last four digits of the card.
|
|
233
|
+
#
|
|
234
|
+
# @return [String, nil]
|
|
235
|
+
required :last4, String, nil?: true
|
|
236
|
+
|
|
237
|
+
# @!method initialize(brand:, exp_month:, exp_year:, last4:)
|
|
238
|
+
# The card data associated with the payment method, if its a debit or credit card.
|
|
239
|
+
#
|
|
240
|
+
# @param brand [Symbol, WhopSDK::Models::CardBrands, nil] Possible card brands that a payment token can have
|
|
241
|
+
#
|
|
242
|
+
# @param exp_month [Integer, nil] Card expiration month, like 03 for March.
|
|
243
|
+
#
|
|
244
|
+
# @param exp_year [Integer, nil] Card expiration year, like 27 for 2027.
|
|
245
|
+
#
|
|
246
|
+
# @param last4 [String, nil] Last four digits of the card.
|
|
247
|
+
end
|
|
248
|
+
end
|
|
249
|
+
end
|
|
250
|
+
end
|
|
251
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
class SetupIntentCanceledWebhookEvent < 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
|
+
# An object representing a setup intent, which is a flow for allowing a customer
|
|
20
|
+
# to add a payment method to their account without making a purchase.
|
|
21
|
+
#
|
|
22
|
+
# @return [WhopSDK::Models::SetupIntent]
|
|
23
|
+
required :data, -> { WhopSDK::SetupIntent }
|
|
24
|
+
|
|
25
|
+
# @!attribute timestamp
|
|
26
|
+
# The timestamp in ISO 8601 format that the webhook was sent at on the server
|
|
27
|
+
#
|
|
28
|
+
# @return [Time]
|
|
29
|
+
required :timestamp, Time
|
|
30
|
+
|
|
31
|
+
# @!attribute type
|
|
32
|
+
# The webhook event type
|
|
33
|
+
#
|
|
34
|
+
# @return [Symbol, :"setup_intent.canceled"]
|
|
35
|
+
required :type, const: :"setup_intent.canceled"
|
|
36
|
+
|
|
37
|
+
# @!method initialize(id:, data:, timestamp:, api_version: :v1, type: :"setup_intent.canceled")
|
|
38
|
+
# Some parameter documentations has been truncated, see
|
|
39
|
+
# {WhopSDK::Models::SetupIntentCanceledWebhookEvent} for more details.
|
|
40
|
+
#
|
|
41
|
+
# @param id [String] A unique ID for every single webhook request
|
|
42
|
+
#
|
|
43
|
+
# @param data [WhopSDK::Models::SetupIntent] An object representing a setup intent, which is a flow for allowing a customer t
|
|
44
|
+
#
|
|
45
|
+
# @param timestamp [Time] The timestamp in ISO 8601 format that the webhook was sent at on the server
|
|
46
|
+
#
|
|
47
|
+
# @param api_version [Symbol, :v1] The API version for this webhook
|
|
48
|
+
#
|
|
49
|
+
# @param type [Symbol, :"setup_intent.canceled"] The webhook event type
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|