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
|
@@ -46,11 +46,11 @@ module WhopSDK
|
|
|
46
46
|
# @return [Hash{Symbol=>Object}, nil]
|
|
47
47
|
required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true
|
|
48
48
|
|
|
49
|
-
# @!attribute
|
|
50
|
-
# The payment
|
|
49
|
+
# @!attribute payment_method
|
|
50
|
+
# The payment method created during the setup, if available.
|
|
51
51
|
#
|
|
52
|
-
# @return [WhopSDK::Models::SetupIntent::
|
|
53
|
-
required :
|
|
52
|
+
# @return [WhopSDK::Models::SetupIntent::PaymentMethod, nil]
|
|
53
|
+
required :payment_method, -> { WhopSDK::SetupIntent::PaymentMethod }, nil?: true
|
|
54
54
|
|
|
55
55
|
# @!attribute status
|
|
56
56
|
# The status of the setup intent
|
|
@@ -58,7 +58,7 @@ module WhopSDK
|
|
|
58
58
|
# @return [Symbol, WhopSDK::Models::SetupIntentStatus]
|
|
59
59
|
required :status, enum: -> { WhopSDK::SetupIntentStatus }
|
|
60
60
|
|
|
61
|
-
# @!method initialize(id:, checkout_configuration:, company:, created_at:, error_message:, member:, metadata:,
|
|
61
|
+
# @!method initialize(id:, checkout_configuration:, company:, created_at:, error_message:, member:, metadata:, payment_method:, status:)
|
|
62
62
|
# An object representing a setup intent, which is a flow for allowing a customer
|
|
63
63
|
# to add a payment method to their account without making a purchase.
|
|
64
64
|
#
|
|
@@ -76,7 +76,7 @@ module WhopSDK
|
|
|
76
76
|
#
|
|
77
77
|
# @param metadata [Hash{Symbol=>Object}, nil] The metadata associated with the setup intent
|
|
78
78
|
#
|
|
79
|
-
# @param
|
|
79
|
+
# @param payment_method [WhopSDK::Models::SetupIntent::PaymentMethod, nil] The payment method created during the setup, if available.
|
|
80
80
|
#
|
|
81
81
|
# @param status [Symbol, WhopSDK::Models::SetupIntentStatus] The status of the setup intent
|
|
82
82
|
|
|
@@ -168,48 +168,47 @@ module WhopSDK
|
|
|
168
168
|
end
|
|
169
169
|
end
|
|
170
170
|
|
|
171
|
-
# @see WhopSDK::Models::SetupIntent#
|
|
172
|
-
class
|
|
171
|
+
# @see WhopSDK::Models::SetupIntent#payment_method
|
|
172
|
+
class PaymentMethod < WhopSDK::Internal::Type::BaseModel
|
|
173
173
|
# @!attribute id
|
|
174
|
-
# The ID of the payment
|
|
174
|
+
# The ID of the payment method
|
|
175
175
|
#
|
|
176
176
|
# @return [String]
|
|
177
177
|
required :id, String
|
|
178
178
|
|
|
179
179
|
# @!attribute card
|
|
180
|
-
# The card data associated with the payment
|
|
181
|
-
# token.
|
|
180
|
+
# The card data associated with the payment method, if its a debit or credit card.
|
|
182
181
|
#
|
|
183
|
-
# @return [WhopSDK::Models::SetupIntent::
|
|
184
|
-
required :card, -> { WhopSDK::SetupIntent::
|
|
182
|
+
# @return [WhopSDK::Models::SetupIntent::PaymentMethod::Card, nil]
|
|
183
|
+
required :card, -> { WhopSDK::SetupIntent::PaymentMethod::Card }, nil?: true
|
|
185
184
|
|
|
186
185
|
# @!attribute created_at
|
|
187
|
-
# The date and time the payment
|
|
186
|
+
# The date and time the payment method was created
|
|
188
187
|
#
|
|
189
188
|
# @return [Time]
|
|
190
189
|
required :created_at, Time
|
|
191
190
|
|
|
192
191
|
# @!attribute payment_method_type
|
|
193
|
-
# The payment method type of the payment
|
|
192
|
+
# The payment method type of the payment method
|
|
194
193
|
#
|
|
195
194
|
# @return [Symbol, WhopSDK::Models::PaymentMethodTypes]
|
|
196
195
|
required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }
|
|
197
196
|
|
|
198
197
|
# @!method initialize(id:, card:, created_at:, payment_method_type:)
|
|
199
198
|
# Some parameter documentations has been truncated, see
|
|
200
|
-
# {WhopSDK::Models::SetupIntent::
|
|
199
|
+
# {WhopSDK::Models::SetupIntent::PaymentMethod} for more details.
|
|
201
200
|
#
|
|
202
|
-
# The payment
|
|
201
|
+
# The payment method created during the setup, if available.
|
|
203
202
|
#
|
|
204
|
-
# @param id [String] The ID of the payment
|
|
203
|
+
# @param id [String] The ID of the payment method
|
|
205
204
|
#
|
|
206
|
-
# @param card [WhopSDK::Models::SetupIntent::
|
|
205
|
+
# @param card [WhopSDK::Models::SetupIntent::PaymentMethod::Card, nil] The card data associated with the payment method, if its a debit or credit card.
|
|
207
206
|
#
|
|
208
|
-
# @param created_at [Time] The date and time the payment
|
|
207
|
+
# @param created_at [Time] The date and time the payment method was created
|
|
209
208
|
#
|
|
210
|
-
# @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The payment method type of the payment
|
|
209
|
+
# @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The payment method type of the payment method
|
|
211
210
|
|
|
212
|
-
# @see WhopSDK::Models::SetupIntent::
|
|
211
|
+
# @see WhopSDK::Models::SetupIntent::PaymentMethod#card
|
|
213
212
|
class Card < WhopSDK::Internal::Type::BaseModel
|
|
214
213
|
# @!attribute brand
|
|
215
214
|
# Possible card brands that a payment token can have
|
|
@@ -236,8 +235,7 @@ module WhopSDK
|
|
|
236
235
|
required :last4, String, nil?: true
|
|
237
236
|
|
|
238
237
|
# @!method initialize(brand:, exp_month:, exp_year:, last4:)
|
|
239
|
-
# The card data associated with the payment
|
|
240
|
-
# token.
|
|
238
|
+
# The card data associated with the payment method, if its a debit or credit card.
|
|
241
239
|
#
|
|
242
240
|
# @param brand [Symbol, WhopSDK::Models::CardBrands, nil] Possible card brands that a payment token can have
|
|
243
241
|
#
|
|
@@ -48,11 +48,11 @@ module WhopSDK
|
|
|
48
48
|
# @return [Hash{Symbol=>Object}, nil]
|
|
49
49
|
required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true
|
|
50
50
|
|
|
51
|
-
# @!attribute
|
|
52
|
-
# The payment
|
|
51
|
+
# @!attribute payment_method
|
|
52
|
+
# The payment method created during the setup, if available.
|
|
53
53
|
#
|
|
54
|
-
# @return [WhopSDK::Models::SetupIntentListResponse::
|
|
55
|
-
required :
|
|
54
|
+
# @return [WhopSDK::Models::SetupIntentListResponse::PaymentMethod, nil]
|
|
55
|
+
required :payment_method, -> { WhopSDK::Models::SetupIntentListResponse::PaymentMethod }, nil?: true
|
|
56
56
|
|
|
57
57
|
# @!attribute status
|
|
58
58
|
# The status of the setup intent
|
|
@@ -60,7 +60,7 @@ module WhopSDK
|
|
|
60
60
|
# @return [Symbol, WhopSDK::Models::SetupIntentStatus]
|
|
61
61
|
required :status, enum: -> { WhopSDK::SetupIntentStatus }
|
|
62
62
|
|
|
63
|
-
# @!method initialize(id:, checkout_configuration:, company:, created_at:, error_message:, member:, metadata:,
|
|
63
|
+
# @!method initialize(id:, checkout_configuration:, company:, created_at:, error_message:, member:, metadata:, payment_method:, status:)
|
|
64
64
|
# An object representing a setup intent, which is a flow for allowing a customer
|
|
65
65
|
# to add a payment method to their account without making a purchase.
|
|
66
66
|
#
|
|
@@ -78,7 +78,7 @@ module WhopSDK
|
|
|
78
78
|
#
|
|
79
79
|
# @param metadata [Hash{Symbol=>Object}, nil] The metadata associated with the setup intent
|
|
80
80
|
#
|
|
81
|
-
# @param
|
|
81
|
+
# @param payment_method [WhopSDK::Models::SetupIntentListResponse::PaymentMethod, nil] The payment method created during the setup, if available.
|
|
82
82
|
#
|
|
83
83
|
# @param status [Symbol, WhopSDK::Models::SetupIntentStatus] The status of the setup intent
|
|
84
84
|
|
|
@@ -170,48 +170,47 @@ module WhopSDK
|
|
|
170
170
|
end
|
|
171
171
|
end
|
|
172
172
|
|
|
173
|
-
# @see WhopSDK::Models::SetupIntentListResponse#
|
|
174
|
-
class
|
|
173
|
+
# @see WhopSDK::Models::SetupIntentListResponse#payment_method
|
|
174
|
+
class PaymentMethod < WhopSDK::Internal::Type::BaseModel
|
|
175
175
|
# @!attribute id
|
|
176
|
-
# The ID of the payment
|
|
176
|
+
# The ID of the payment method
|
|
177
177
|
#
|
|
178
178
|
# @return [String]
|
|
179
179
|
required :id, String
|
|
180
180
|
|
|
181
181
|
# @!attribute card
|
|
182
|
-
# The card data associated with the payment
|
|
183
|
-
# token.
|
|
182
|
+
# The card data associated with the payment method, if its a debit or credit card.
|
|
184
183
|
#
|
|
185
|
-
# @return [WhopSDK::Models::SetupIntentListResponse::
|
|
186
|
-
required :card, -> { WhopSDK::Models::SetupIntentListResponse::
|
|
184
|
+
# @return [WhopSDK::Models::SetupIntentListResponse::PaymentMethod::Card, nil]
|
|
185
|
+
required :card, -> { WhopSDK::Models::SetupIntentListResponse::PaymentMethod::Card }, nil?: true
|
|
187
186
|
|
|
188
187
|
# @!attribute created_at
|
|
189
|
-
# The date and time the payment
|
|
188
|
+
# The date and time the payment method was created
|
|
190
189
|
#
|
|
191
190
|
# @return [Time]
|
|
192
191
|
required :created_at, Time
|
|
193
192
|
|
|
194
193
|
# @!attribute payment_method_type
|
|
195
|
-
# The payment method type of the payment
|
|
194
|
+
# The payment method type of the payment method
|
|
196
195
|
#
|
|
197
196
|
# @return [Symbol, WhopSDK::Models::PaymentMethodTypes]
|
|
198
197
|
required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }
|
|
199
198
|
|
|
200
199
|
# @!method initialize(id:, card:, created_at:, payment_method_type:)
|
|
201
200
|
# Some parameter documentations has been truncated, see
|
|
202
|
-
# {WhopSDK::Models::SetupIntentListResponse::
|
|
201
|
+
# {WhopSDK::Models::SetupIntentListResponse::PaymentMethod} for more details.
|
|
203
202
|
#
|
|
204
|
-
# The payment
|
|
203
|
+
# The payment method created during the setup, if available.
|
|
205
204
|
#
|
|
206
|
-
# @param id [String] The ID of the payment
|
|
205
|
+
# @param id [String] The ID of the payment method
|
|
207
206
|
#
|
|
208
|
-
# @param card [WhopSDK::Models::SetupIntentListResponse::
|
|
207
|
+
# @param card [WhopSDK::Models::SetupIntentListResponse::PaymentMethod::Card, nil] The card data associated with the payment method, if its a debit or credit card.
|
|
209
208
|
#
|
|
210
|
-
# @param created_at [Time] The date and time the payment
|
|
209
|
+
# @param created_at [Time] The date and time the payment method was created
|
|
211
210
|
#
|
|
212
|
-
# @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The payment method type of the payment
|
|
211
|
+
# @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The payment method type of the payment method
|
|
213
212
|
|
|
214
|
-
# @see WhopSDK::Models::SetupIntentListResponse::
|
|
213
|
+
# @see WhopSDK::Models::SetupIntentListResponse::PaymentMethod#card
|
|
215
214
|
class Card < WhopSDK::Internal::Type::BaseModel
|
|
216
215
|
# @!attribute brand
|
|
217
216
|
# Possible card brands that a payment token can have
|
|
@@ -238,8 +237,7 @@ module WhopSDK
|
|
|
238
237
|
required :last4, String, nil?: true
|
|
239
238
|
|
|
240
239
|
# @!method initialize(brand:, exp_month:, exp_year:, last4:)
|
|
241
|
-
# The card data associated with the payment
|
|
242
|
-
# token.
|
|
240
|
+
# The card data associated with the payment method, if its a debit or credit card.
|
|
243
241
|
#
|
|
244
242
|
# @param brand [Symbol, WhopSDK::Models::CardBrands, nil] Possible card brands that a payment token can have
|
|
245
243
|
#
|
|
@@ -5,47 +5,50 @@ module WhopSDK
|
|
|
5
5
|
module UnwrapWebhookEvent
|
|
6
6
|
extend WhopSDK::Internal::Type::Union
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
discriminator :type
|
|
9
9
|
|
|
10
|
-
variant -> { WhopSDK::
|
|
10
|
+
variant :"invoice.created", -> { WhopSDK::InvoiceCreatedWebhookEvent }
|
|
11
11
|
|
|
12
|
-
variant -> { WhopSDK::
|
|
12
|
+
variant :"invoice.paid", -> { WhopSDK::InvoicePaidWebhookEvent }
|
|
13
13
|
|
|
14
|
-
variant -> { WhopSDK::
|
|
14
|
+
variant :"invoice.past_due", -> { WhopSDK::InvoicePastDueWebhookEvent }
|
|
15
15
|
|
|
16
|
-
variant -> { WhopSDK::
|
|
16
|
+
variant :"invoice.voided", -> { WhopSDK::InvoiceVoidedWebhookEvent }
|
|
17
17
|
|
|
18
|
-
variant -> { WhopSDK::
|
|
18
|
+
variant :"membership.activated", -> { WhopSDK::MembershipActivatedWebhookEvent }
|
|
19
19
|
|
|
20
|
-
variant -> { WhopSDK::
|
|
20
|
+
variant :"membership.deactivated", -> { WhopSDK::MembershipDeactivatedWebhookEvent }
|
|
21
21
|
|
|
22
|
-
variant -> { WhopSDK::
|
|
22
|
+
variant :"entry.created", -> { WhopSDK::EntryCreatedWebhookEvent }
|
|
23
23
|
|
|
24
|
-
variant -> { WhopSDK::
|
|
24
|
+
variant :"entry.approved", -> { WhopSDK::EntryApprovedWebhookEvent }
|
|
25
25
|
|
|
26
|
-
variant -> { WhopSDK::
|
|
26
|
+
variant :"entry.denied", -> { WhopSDK::EntryDeniedWebhookEvent }
|
|
27
27
|
|
|
28
|
-
variant -> { WhopSDK::
|
|
28
|
+
variant :"entry.deleted", -> { WhopSDK::EntryDeletedWebhookEvent }
|
|
29
29
|
|
|
30
|
-
variant -> { WhopSDK::
|
|
30
|
+
variant :"setup_intent.requires_action", -> { WhopSDK::SetupIntentRequiresActionWebhookEvent }
|
|
31
31
|
|
|
32
|
-
variant -> { WhopSDK::
|
|
32
|
+
variant :"setup_intent.succeeded", -> { WhopSDK::SetupIntentSucceededWebhookEvent }
|
|
33
33
|
|
|
34
|
-
variant -> { WhopSDK::
|
|
34
|
+
variant :"setup_intent.canceled", -> { WhopSDK::SetupIntentCanceledWebhookEvent }
|
|
35
35
|
|
|
36
|
-
variant
|
|
36
|
+
variant :"course_lesson_interaction.completed",
|
|
37
|
+
-> { WhopSDK::CourseLessonInteractionCompletedWebhookEvent }
|
|
37
38
|
|
|
38
|
-
variant -> { WhopSDK::
|
|
39
|
+
variant :"payment.succeeded", -> { WhopSDK::PaymentSucceededWebhookEvent }
|
|
39
40
|
|
|
40
|
-
variant -> { WhopSDK::
|
|
41
|
+
variant :"payment.failed", -> { WhopSDK::PaymentFailedWebhookEvent }
|
|
41
42
|
|
|
42
|
-
variant -> { WhopSDK::
|
|
43
|
+
variant :"payment.pending", -> { WhopSDK::PaymentPendingWebhookEvent }
|
|
43
44
|
|
|
44
|
-
variant -> { WhopSDK::
|
|
45
|
+
variant :"dispute.created", -> { WhopSDK::DisputeCreatedWebhookEvent }
|
|
45
46
|
|
|
46
|
-
variant -> { WhopSDK::
|
|
47
|
+
variant :"dispute.updated", -> { WhopSDK::DisputeUpdatedWebhookEvent }
|
|
47
48
|
|
|
48
|
-
variant -> { WhopSDK::
|
|
49
|
+
variant :"refund.created", -> { WhopSDK::RefundCreatedWebhookEvent }
|
|
50
|
+
|
|
51
|
+
variant :"refund.updated", -> { WhopSDK::RefundUpdatedWebhookEvent }
|
|
49
52
|
|
|
50
53
|
# @!method self.variants
|
|
51
54
|
# @return [Array(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)]
|
data/lib/whop_sdk/models.rb
CHANGED
|
@@ -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
|
|
@@ -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
|
|
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
|
#
|
|
@@ -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
|
|
18
|
+
# @param id [String] The ID of the PaymentMethod
|
|
15
19
|
#
|
|
16
|
-
# @param member_id [String] The ID of the Member associated with the
|
|
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::
|
|
24
|
+
# @return [WhopSDK::Models::PaymentMethodRetrieveResponse]
|
|
21
25
|
#
|
|
22
|
-
# @see WhopSDK::Models::
|
|
26
|
+
# @see WhopSDK::Models::PaymentMethodRetrieveParams
|
|
23
27
|
def retrieve(id, params)
|
|
24
|
-
parsed, options = WhopSDK::
|
|
28
|
+
parsed, options = WhopSDK::PaymentMethodRetrieveParams.dump_request(params)
|
|
25
29
|
@client.request(
|
|
26
30
|
method: :get,
|
|
27
|
-
path: ["
|
|
31
|
+
path: ["payment_methods/%1$s", id],
|
|
28
32
|
query: parsed,
|
|
29
|
-
model: WhopSDK::Models::
|
|
33
|
+
model: WhopSDK::Models::PaymentMethodRetrieveResponse,
|
|
30
34
|
options: options
|
|
31
35
|
)
|
|
32
36
|
end
|
|
33
37
|
|
|
34
|
-
#
|
|
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
|
|
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::
|
|
68
|
+
# @return [WhopSDK::Internal::CursorPage<WhopSDK::Models::PaymentMethodListResponse>]
|
|
61
69
|
#
|
|
62
|
-
# @see WhopSDK::Models::
|
|
70
|
+
# @see WhopSDK::Models::PaymentMethodListParams
|
|
63
71
|
def list(params)
|
|
64
|
-
parsed, options = WhopSDK::
|
|
72
|
+
parsed, options = WhopSDK::PaymentMethodListParams.dump_request(params)
|
|
65
73
|
@client.request(
|
|
66
74
|
method: :get,
|
|
67
|
-
path: "
|
|
75
|
+
path: "payment_methods",
|
|
68
76
|
query: parsed,
|
|
69
77
|
page: WhopSDK::Internal::CursorPage,
|
|
70
|
-
model: WhopSDK::Models::
|
|
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
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
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:,
|
|
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
|
|
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
|
#
|
|
@@ -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
|
#
|
|
@@ -29,7 +33,11 @@ module WhopSDK
|
|
|
29
33
|
)
|
|
30
34
|
end
|
|
31
35
|
|
|
32
|
-
#
|
|
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
|
#
|
data/lib/whop_sdk/version.rb
CHANGED
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"
|
|
@@ -375,8 +375,8 @@ require_relative "whop_sdk/resources/members"
|
|
|
375
375
|
require_relative "whop_sdk/resources/memberships"
|
|
376
376
|
require_relative "whop_sdk/resources/messages"
|
|
377
377
|
require_relative "whop_sdk/resources/notifications"
|
|
378
|
+
require_relative "whop_sdk/resources/payment_methods"
|
|
378
379
|
require_relative "whop_sdk/resources/payments"
|
|
379
|
-
require_relative "whop_sdk/resources/payment_tokens"
|
|
380
380
|
require_relative "whop_sdk/resources/plans"
|
|
381
381
|
require_relative "whop_sdk/resources/products"
|
|
382
382
|
require_relative "whop_sdk/resources/promo_codes"
|
data/rbi/whop_sdk/client.rbi
CHANGED
|
@@ -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::
|
|
137
|
-
attr_reader :
|
|
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]) }
|
|
@@ -57,6 +57,11 @@ module WhopSDK
|
|
|
57
57
|
sig { returns(T.nilable(String)) }
|
|
58
58
|
attr_accessor :customer_name
|
|
59
59
|
|
|
60
|
+
# The payment method ID to use for this invoice. If using charge_automatically,
|
|
61
|
+
# you must provide a payment_method_id.
|
|
62
|
+
sig { returns(T.nilable(String)) }
|
|
63
|
+
attr_accessor :payment_method_id
|
|
64
|
+
|
|
60
65
|
# The payment token ID to use for this invoice. If using charge_automatically, you
|
|
61
66
|
# must provide a payment_token.
|
|
62
67
|
sig { returns(T.nilable(String)) }
|
|
@@ -84,6 +89,7 @@ module WhopSDK
|
|
|
84
89
|
product_id: String,
|
|
85
90
|
charge_buyer_fee: T.nilable(T::Boolean),
|
|
86
91
|
customer_name: T.nilable(String),
|
|
92
|
+
payment_method_id: T.nilable(String),
|
|
87
93
|
payment_token_id: T.nilable(String),
|
|
88
94
|
request_options: WhopSDK::RequestOptions::OrHash
|
|
89
95
|
).returns(T.attached_class)
|
|
@@ -117,6 +123,9 @@ module WhopSDK
|
|
|
117
123
|
# want to create an invoice for a customer who does not have a member of your
|
|
118
124
|
# company yet.
|
|
119
125
|
customer_name: nil,
|
|
126
|
+
# The payment method ID to use for this invoice. If using charge_automatically,
|
|
127
|
+
# you must provide a payment_method_id.
|
|
128
|
+
payment_method_id: nil,
|
|
120
129
|
# The payment token ID to use for this invoice. If using charge_automatically, you
|
|
121
130
|
# must provide a payment_token.
|
|
122
131
|
payment_token_id: nil,
|
|
@@ -135,6 +144,7 @@ module WhopSDK
|
|
|
135
144
|
product: WhopSDK::InvoiceCreateParams::Product,
|
|
136
145
|
charge_buyer_fee: T.nilable(T::Boolean),
|
|
137
146
|
customer_name: T.nilable(String),
|
|
147
|
+
payment_method_id: T.nilable(String),
|
|
138
148
|
payment_token_id: T.nilable(String),
|
|
139
149
|
email_address: String,
|
|
140
150
|
product_id: String,
|