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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +1 -1
  4. data/lib/whop_sdk/client.rb +3 -3
  5. data/lib/whop_sdk/internal/type/union.rb +12 -0
  6. data/lib/whop_sdk/models/invoice_create_params.rb +10 -1
  7. data/lib/whop_sdk/models/payment.rb +25 -27
  8. data/lib/whop_sdk/models/payment_create_params.rb +5 -5
  9. data/lib/whop_sdk/models/payment_list_response.rb +25 -27
  10. data/lib/whop_sdk/models/{payment_token_list_params.rb → payment_method_list_params.rb} +4 -4
  11. data/lib/whop_sdk/models/{payment_token_list_response.rb → payment_method_list_response.rb} +17 -18
  12. data/lib/whop_sdk/models/{payment_token_retrieve_params.rb → payment_method_retrieve_params.rb} +4 -4
  13. data/lib/whop_sdk/models/{payment_token_retrieve_response.rb → payment_method_retrieve_response.rb} +17 -18
  14. data/lib/whop_sdk/models/setup_intent.rb +22 -24
  15. data/lib/whop_sdk/models/setup_intent_list_response.rb +22 -24
  16. data/lib/whop_sdk/models/unwrap_webhook_event.rb +24 -21
  17. data/lib/whop_sdk/models.rb +4 -4
  18. data/lib/whop_sdk/resources/invoices.rb +3 -1
  19. data/lib/whop_sdk/resources/{payment_tokens.rb → payment_methods.rb} +24 -16
  20. data/lib/whop_sdk/resources/payments.rb +7 -5
  21. data/lib/whop_sdk/resources/setup_intents.rb +10 -2
  22. data/lib/whop_sdk/version.rb +1 -1
  23. data/lib/whop_sdk.rb +5 -5
  24. data/rbi/whop_sdk/client.rbi +2 -2
  25. data/rbi/whop_sdk/models/invoice_create_params.rbi +10 -0
  26. data/rbi/whop_sdk/models/payment.rbi +30 -33
  27. data/rbi/whop_sdk/models/payment_create_params.rbi +6 -6
  28. data/rbi/whop_sdk/models/payment_list_response.rbi +34 -37
  29. data/rbi/whop_sdk/models/{payment_token_list_params.rbi → payment_method_list_params.rbi} +4 -4
  30. data/rbi/whop_sdk/models/{payment_token_list_response.rbi → payment_method_list_response.rbi} +18 -20
  31. data/rbi/whop_sdk/models/{payment_token_retrieve_params.rbi → payment_method_retrieve_params.rbi} +7 -4
  32. data/rbi/whop_sdk/models/{payment_token_retrieve_response.rbi → payment_method_retrieve_response.rbi} +18 -20
  33. data/rbi/whop_sdk/models/setup_intent.rbi +27 -29
  34. data/rbi/whop_sdk/models/setup_intent_list_response.rbi +31 -32
  35. data/rbi/whop_sdk/models.rbi +4 -4
  36. data/rbi/whop_sdk/resources/invoices.rbi +4 -0
  37. data/rbi/whop_sdk/resources/{payment_tokens.rbi → payment_methods.rbi} +16 -8
  38. data/rbi/whop_sdk/resources/payments.rbi +8 -6
  39. data/rbi/whop_sdk/resources/setup_intents.rbi +10 -2
  40. data/sig/whop_sdk/client.rbs +1 -1
  41. data/sig/whop_sdk/models/invoice_create_params.rbs +5 -0
  42. data/sig/whop_sdk/models/payment.rbs +11 -11
  43. data/sig/whop_sdk/models/payment_create_params.rbs +4 -4
  44. data/sig/whop_sdk/models/payment_list_response.rbs +11 -11
  45. data/sig/whop_sdk/models/{payment_token_list_params.rbs → payment_method_list_params.rbs} +2 -2
  46. data/sig/whop_sdk/models/{payment_token_list_response.rbs → payment_method_list_response.rbs} +6 -6
  47. data/sig/whop_sdk/models/{payment_token_retrieve_params.rbs → payment_method_retrieve_params.rbs} +2 -2
  48. data/sig/whop_sdk/models/{payment_token_retrieve_response.rbs → payment_method_retrieve_response.rbs} +6 -6
  49. data/sig/whop_sdk/models/setup_intent.rbs +10 -10
  50. data/sig/whop_sdk/models/setup_intent_list_response.rbs +10 -10
  51. data/sig/whop_sdk/models.rbs +4 -4
  52. data/sig/whop_sdk/resources/invoices.rbs +1 -0
  53. data/sig/whop_sdk/resources/{payment_tokens.rbs → payment_methods.rbs} +3 -3
  54. data/sig/whop_sdk/resources/payments.rbs +1 -1
  55. 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 payment_token
50
- # The payment token created during the setup, if available.
49
+ # @!attribute payment_method
50
+ # The payment method created during the setup, if available.
51
51
  #
52
- # @return [WhopSDK::Models::SetupIntent::PaymentToken, nil]
53
- required :payment_token, -> { WhopSDK::SetupIntent::PaymentToken }, nil?: true
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:, payment_token:, status:)
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 payment_token [WhopSDK::Models::SetupIntent::PaymentToken, nil] The payment token created during the setup, if available.
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#payment_token
172
- class PaymentToken < WhopSDK::Internal::Type::BaseModel
171
+ # @see WhopSDK::Models::SetupIntent#payment_method
172
+ class PaymentMethod < WhopSDK::Internal::Type::BaseModel
173
173
  # @!attribute id
174
- # The ID of the payment token
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 token, if its a debit or credit card
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::PaymentToken::Card, nil]
184
- required :card, -> { WhopSDK::SetupIntent::PaymentToken::Card }, nil?: true
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 token was created
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 token
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::PaymentToken} for more details.
199
+ # {WhopSDK::Models::SetupIntent::PaymentMethod} for more details.
201
200
  #
202
- # The payment token created during the setup, if available.
201
+ # The payment method created during the setup, if available.
203
202
  #
204
- # @param id [String] The ID of the payment token
203
+ # @param id [String] The ID of the payment method
205
204
  #
206
- # @param card [WhopSDK::Models::SetupIntent::PaymentToken::Card, nil] The card data associated with the payment token, if its a debit or credit card t
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 token was created
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 token
209
+ # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The payment method type of the payment method
211
210
 
212
- # @see WhopSDK::Models::SetupIntent::PaymentToken#card
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 token, if its a debit or credit card
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 payment_token
52
- # The payment token created during the setup, if available.
51
+ # @!attribute payment_method
52
+ # The payment method created during the setup, if available.
53
53
  #
54
- # @return [WhopSDK::Models::SetupIntentListResponse::PaymentToken, nil]
55
- required :payment_token, -> { WhopSDK::Models::SetupIntentListResponse::PaymentToken }, nil?: true
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:, payment_token:, status:)
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 payment_token [WhopSDK::Models::SetupIntentListResponse::PaymentToken, nil] The payment token created during the setup, if available.
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#payment_token
174
- class PaymentToken < WhopSDK::Internal::Type::BaseModel
173
+ # @see WhopSDK::Models::SetupIntentListResponse#payment_method
174
+ class PaymentMethod < WhopSDK::Internal::Type::BaseModel
175
175
  # @!attribute id
176
- # The ID of the payment token
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 token, if its a debit or credit card
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::PaymentToken::Card, nil]
186
- required :card, -> { WhopSDK::Models::SetupIntentListResponse::PaymentToken::Card }, nil?: true
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 token was created
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 token
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::PaymentToken} for more details.
201
+ # {WhopSDK::Models::SetupIntentListResponse::PaymentMethod} for more details.
203
202
  #
204
- # The payment token created during the setup, if available.
203
+ # The payment method created during the setup, if available.
205
204
  #
206
- # @param id [String] The ID of the payment token
205
+ # @param id [String] The ID of the payment method
207
206
  #
208
- # @param card [WhopSDK::Models::SetupIntentListResponse::PaymentToken::Card, nil] The card data associated with the payment token, if its a debit or credit card t
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 token was created
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 token
211
+ # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The payment method type of the payment method
213
212
 
214
- # @see WhopSDK::Models::SetupIntentListResponse::PaymentToken#card
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 token, if its a debit or credit card
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
- variant -> { WhopSDK::InvoiceCreatedWebhookEvent }
8
+ discriminator :type
9
9
 
10
- variant -> { WhopSDK::InvoicePaidWebhookEvent }
10
+ variant :"invoice.created", -> { WhopSDK::InvoiceCreatedWebhookEvent }
11
11
 
12
- variant -> { WhopSDK::InvoicePastDueWebhookEvent }
12
+ variant :"invoice.paid", -> { WhopSDK::InvoicePaidWebhookEvent }
13
13
 
14
- variant -> { WhopSDK::InvoiceVoidedWebhookEvent }
14
+ variant :"invoice.past_due", -> { WhopSDK::InvoicePastDueWebhookEvent }
15
15
 
16
- variant -> { WhopSDK::MembershipActivatedWebhookEvent }
16
+ variant :"invoice.voided", -> { WhopSDK::InvoiceVoidedWebhookEvent }
17
17
 
18
- variant -> { WhopSDK::MembershipDeactivatedWebhookEvent }
18
+ variant :"membership.activated", -> { WhopSDK::MembershipActivatedWebhookEvent }
19
19
 
20
- variant -> { WhopSDK::EntryCreatedWebhookEvent }
20
+ variant :"membership.deactivated", -> { WhopSDK::MembershipDeactivatedWebhookEvent }
21
21
 
22
- variant -> { WhopSDK::EntryApprovedWebhookEvent }
22
+ variant :"entry.created", -> { WhopSDK::EntryCreatedWebhookEvent }
23
23
 
24
- variant -> { WhopSDK::EntryDeniedWebhookEvent }
24
+ variant :"entry.approved", -> { WhopSDK::EntryApprovedWebhookEvent }
25
25
 
26
- variant -> { WhopSDK::EntryDeletedWebhookEvent }
26
+ variant :"entry.denied", -> { WhopSDK::EntryDeniedWebhookEvent }
27
27
 
28
- variant -> { WhopSDK::SetupIntentRequiresActionWebhookEvent }
28
+ variant :"entry.deleted", -> { WhopSDK::EntryDeletedWebhookEvent }
29
29
 
30
- variant -> { WhopSDK::SetupIntentSucceededWebhookEvent }
30
+ variant :"setup_intent.requires_action", -> { WhopSDK::SetupIntentRequiresActionWebhookEvent }
31
31
 
32
- variant -> { WhopSDK::SetupIntentCanceledWebhookEvent }
32
+ variant :"setup_intent.succeeded", -> { WhopSDK::SetupIntentSucceededWebhookEvent }
33
33
 
34
- variant -> { WhopSDK::CourseLessonInteractionCompletedWebhookEvent }
34
+ variant :"setup_intent.canceled", -> { WhopSDK::SetupIntentCanceledWebhookEvent }
35
35
 
36
- variant -> { WhopSDK::PaymentSucceededWebhookEvent }
36
+ variant :"course_lesson_interaction.completed",
37
+ -> { WhopSDK::CourseLessonInteractionCompletedWebhookEvent }
37
38
 
38
- variant -> { WhopSDK::PaymentFailedWebhookEvent }
39
+ variant :"payment.succeeded", -> { WhopSDK::PaymentSucceededWebhookEvent }
39
40
 
40
- variant -> { WhopSDK::PaymentPendingWebhookEvent }
41
+ variant :"payment.failed", -> { WhopSDK::PaymentFailedWebhookEvent }
41
42
 
42
- variant -> { WhopSDK::DisputeCreatedWebhookEvent }
43
+ variant :"payment.pending", -> { WhopSDK::PaymentPendingWebhookEvent }
43
44
 
44
- variant -> { WhopSDK::DisputeUpdatedWebhookEvent }
45
+ variant :"dispute.created", -> { WhopSDK::DisputeCreatedWebhookEvent }
45
46
 
46
- variant -> { WhopSDK::RefundCreatedWebhookEvent }
47
+ variant :"dispute.updated", -> { WhopSDK::DisputeUpdatedWebhookEvent }
47
48
 
48
- variant -> { WhopSDK::RefundUpdatedWebhookEvent }
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)]
@@ -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 PaymentTokens
6
- # Retrieves a PaymentToken by ID
5
+ class PaymentMethods
6
+ # A payment method is a stored representation of how a customer intends to pay,
7
+ # such as a card, bank account, or digital wallet. It holds the necessary billing
8
+ # details and can be attached to a member for future one-time or recurring
9
+ # charges. This lets you reuse the same payment credentials across multiple
10
+ # payments.
7
11
  #
8
12
  # Required permissions:
9
13
  #
@@ -11,27 +15,31 @@ module WhopSDK
11
15
  #
12
16
  # @overload retrieve(id, member_id:, request_options: {})
13
17
  #
14
- # @param id [String] The ID of the PaymentToken
18
+ # @param id [String] The ID of the PaymentMethod
15
19
  #
16
- # @param member_id [String] The ID of the Member associated with the PaymentToken
20
+ # @param member_id [String] The ID of the Member associated with the PaymentMethod
17
21
  #
18
22
  # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
19
23
  #
20
- # @return [WhopSDK::Models::PaymentTokenRetrieveResponse]
24
+ # @return [WhopSDK::Models::PaymentMethodRetrieveResponse]
21
25
  #
22
- # @see WhopSDK::Models::PaymentTokenRetrieveParams
26
+ # @see WhopSDK::Models::PaymentMethodRetrieveParams
23
27
  def retrieve(id, params)
24
- parsed, options = WhopSDK::PaymentTokenRetrieveParams.dump_request(params)
28
+ parsed, options = WhopSDK::PaymentMethodRetrieveParams.dump_request(params)
25
29
  @client.request(
26
30
  method: :get,
27
- path: ["payment_tokens/%1$s", id],
31
+ path: ["payment_methods/%1$s", id],
28
32
  query: parsed,
29
- model: WhopSDK::Models::PaymentTokenRetrieveResponse,
33
+ model: WhopSDK::Models::PaymentMethodRetrieveResponse,
30
34
  options: options
31
35
  )
32
36
  end
33
37
 
34
- # Lists PaymentTokens
38
+ # A payment method is a stored representation of how a customer intends to pay,
39
+ # such as a card, bank account, or digital wallet. It holds the necessary billing
40
+ # details and can be attached to a member for future one-time or recurring
41
+ # charges. This lets you reuse the same payment credentials across multiple
42
+ # payments.
35
43
  #
36
44
  # Required permissions:
37
45
  #
@@ -39,7 +47,7 @@ module WhopSDK
39
47
  #
40
48
  # @overload list(member_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {})
41
49
  #
42
- # @param member_id [String] The ID of the Member to list payment tokens for
50
+ # @param member_id [String] The ID of the Member to list payment methods for
43
51
  #
44
52
  # @param after [String, nil] Returns the elements in the list that come after the specified cursor.
45
53
  #
@@ -57,17 +65,17 @@ module WhopSDK
57
65
  #
58
66
  # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
59
67
  #
60
- # @return [WhopSDK::Internal::CursorPage<WhopSDK::Models::PaymentTokenListResponse>]
68
+ # @return [WhopSDK::Internal::CursorPage<WhopSDK::Models::PaymentMethodListResponse>]
61
69
  #
62
- # @see WhopSDK::Models::PaymentTokenListParams
70
+ # @see WhopSDK::Models::PaymentMethodListParams
63
71
  def list(params)
64
- parsed, options = WhopSDK::PaymentTokenListParams.dump_request(params)
72
+ parsed, options = WhopSDK::PaymentMethodListParams.dump_request(params)
65
73
  @client.request(
66
74
  method: :get,
67
- path: "payment_tokens",
75
+ path: "payment_methods",
68
76
  query: parsed,
69
77
  page: WhopSDK::Internal::CursorPage,
70
- model: WhopSDK::Models::PaymentTokenListResponse,
78
+ model: WhopSDK::Models::PaymentMethodListResponse,
71
79
  options: options
72
80
  )
73
81
  end
@@ -6,9 +6,11 @@ module WhopSDK
6
6
  # Some parameter documentations has been truncated, see
7
7
  # {WhopSDK::Models::PaymentCreateParams} for more details.
8
8
  #
9
- # Creates a payment. This endpoint will respond with a payment object immediately,
10
- # but the payment is processed asynchronously in the background. Use webhooks to
11
- # be notified when the payment succeeds or fails.
9
+ # Charge an existing member off-session using one of their stored payment methods.
10
+ # You can provide an existing plan, or create a new one in-line. This endpoint
11
+ # will respond with a payment object immediately, but the payment is processed
12
+ # asynchronously in the background. Use webhooks to be notified when the payment
13
+ # succeeds or fails.
12
14
  #
13
15
  # Required permissions:
14
16
  #
@@ -23,13 +25,13 @@ module WhopSDK
23
25
  # - `member:phone:read`
24
26
  # - `promo_code:basic:read`
25
27
  #
26
- # @overload create(company_id:, member_id:, payment_token_id:, plan:, plan_id:, request_options: {})
28
+ # @overload create(company_id:, member_id:, payment_method_id:, plan:, plan_id:, request_options: {})
27
29
  #
28
30
  # @param company_id [String] The ID of the company to create the payment for.
29
31
  #
30
32
  # @param member_id [String] The ID of the member to create the payment for.
31
33
  #
32
- # @param payment_token_id [String] The ID of the payment token to use for the payment. It must be connected to the
34
+ # @param payment_method_id [String] The ID of the payment method to use for the payment. It must be connected to the
33
35
  #
34
36
  # @param plan [WhopSDK::Models::PaymentCreateParams::Plan] Pass this object to create a new plan for this payment
35
37
  #
@@ -3,7 +3,11 @@
3
3
  module WhopSDK
4
4
  module Resources
5
5
  class SetupIntents
6
- # Retrieves a Setup Intent by ID
6
+ # A setup intent is an object used to securely collect and store a member’s
7
+ # payment method for future use without charging them immediately. It handles
8
+ # authentication steps up front so future off-session payments can be completed
9
+ # smoothly. This ensures the payment method is verified and ready for later
10
+ # billing.
7
11
  #
8
12
  # Required permissions:
9
13
  #
@@ -29,7 +33,11 @@ module WhopSDK
29
33
  )
30
34
  end
31
35
 
32
- # Lists Setup Intents
36
+ # A setup intent is an object used to securely collect and store a member’s
37
+ # payment method for future use without charging them immediately. It handles
38
+ # authentication steps up front so future off-session payments can be completed
39
+ # smoothly. This ensures the payment method is verified and ready for later
40
+ # billing.
33
41
  #
34
42
  # Required permissions:
35
43
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WhopSDK
4
- VERSION = "0.0.10"
4
+ VERSION = "0.0.11"
5
5
  end
data/lib/whop_sdk.rb CHANGED
@@ -243,6 +243,10 @@ require_relative "whop_sdk/models/payment_create_params"
243
243
  require_relative "whop_sdk/models/payment_failed_webhook_event"
244
244
  require_relative "whop_sdk/models/payment_list_params"
245
245
  require_relative "whop_sdk/models/payment_list_response"
246
+ require_relative "whop_sdk/models/payment_method_list_params"
247
+ require_relative "whop_sdk/models/payment_method_list_response"
248
+ require_relative "whop_sdk/models/payment_method_retrieve_params"
249
+ require_relative "whop_sdk/models/payment_method_retrieve_response"
246
250
  require_relative "whop_sdk/models/payment_method_types"
247
251
  require_relative "whop_sdk/models/payment_pending_webhook_event"
248
252
  require_relative "whop_sdk/models/payment_provider"
@@ -250,10 +254,6 @@ require_relative "whop_sdk/models/payment_refund_params"
250
254
  require_relative "whop_sdk/models/payment_retrieve_params"
251
255
  require_relative "whop_sdk/models/payment_retry_params"
252
256
  require_relative "whop_sdk/models/payment_succeeded_webhook_event"
253
- require_relative "whop_sdk/models/payment_token_list_params"
254
- require_relative "whop_sdk/models/payment_token_list_response"
255
- require_relative "whop_sdk/models/payment_token_retrieve_params"
256
- require_relative "whop_sdk/models/payment_token_retrieve_response"
257
257
  require_relative "whop_sdk/models/payment_void_params"
258
258
  require_relative "whop_sdk/models/plan"
259
259
  require_relative "whop_sdk/models/plan_create_params"
@@ -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"
@@ -133,8 +133,8 @@ module WhopSDK
133
133
  sig { returns(WhopSDK::Resources::SetupIntents) }
134
134
  attr_reader :setup_intents
135
135
 
136
- sig { returns(WhopSDK::Resources::PaymentTokens) }
137
- attr_reader :payment_tokens
136
+ sig { returns(WhopSDK::Resources::PaymentMethods) }
137
+ attr_reader :payment_methods
138
138
 
139
139
  # @api private
140
140
  sig { override.returns(T::Hash[String, String]) }
@@ -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,