whop_sdk 0.0.9 → 0.0.10

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 (78) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/README.md +1 -1
  4. data/lib/whop_sdk/client.rb +8 -0
  5. data/lib/whop_sdk/models/app_build_create_params.rb +9 -1
  6. data/lib/whop_sdk/models/payment.rb +90 -1
  7. data/lib/whop_sdk/models/payment_create_params.rb +307 -0
  8. data/lib/whop_sdk/models/payment_list_response.rb +90 -1
  9. data/lib/whop_sdk/models/payment_token_list_params.rb +78 -0
  10. data/lib/whop_sdk/models/payment_token_list_response.rb +86 -0
  11. data/lib/whop_sdk/models/payment_token_retrieve_params.rb +22 -0
  12. data/lib/whop_sdk/models/payment_token_retrieve_response.rb +86 -0
  13. data/lib/whop_sdk/models/setup_intent.rb +253 -0
  14. data/lib/whop_sdk/models/setup_intent_canceled_webhook_event.rb +52 -0
  15. data/lib/whop_sdk/models/setup_intent_list_params.rb +78 -0
  16. data/lib/whop_sdk/models/setup_intent_list_response.rb +255 -0
  17. data/lib/whop_sdk/models/setup_intent_requires_action_webhook_event.rb +52 -0
  18. data/lib/whop_sdk/models/setup_intent_retrieve_params.rb +14 -0
  19. data/lib/whop_sdk/models/setup_intent_status.rb +18 -0
  20. data/lib/whop_sdk/models/setup_intent_succeeded_webhook_event.rb +52 -0
  21. data/lib/whop_sdk/models/unwrap_webhook_event.rb +7 -1
  22. data/lib/whop_sdk/models.rb +20 -0
  23. data/lib/whop_sdk/resources/app_builds.rb +3 -1
  24. data/lib/whop_sdk/resources/payment_tokens.rb +83 -0
  25. data/lib/whop_sdk/resources/payments.rb +48 -0
  26. data/lib/whop_sdk/resources/setup_intents.rb +83 -0
  27. data/lib/whop_sdk/resources/webhooks.rb +1 -1
  28. data/lib/whop_sdk/version.rb +1 -1
  29. data/lib/whop_sdk.rb +15 -0
  30. data/rbi/whop_sdk/client.rbi +6 -0
  31. data/rbi/whop_sdk/models/app_build_create_params.rbi +8 -0
  32. data/rbi/whop_sdk/models/payment.rbi +142 -0
  33. data/rbi/whop_sdk/models/payment_create_params.rbi +384 -0
  34. data/rbi/whop_sdk/models/payment_list_response.rbi +167 -0
  35. data/rbi/whop_sdk/models/payment_token_list_params.rbi +99 -0
  36. data/rbi/whop_sdk/models/payment_token_list_response.rbi +139 -0
  37. data/rbi/whop_sdk/models/payment_token_retrieve_params.rbi +40 -0
  38. data/rbi/whop_sdk/models/payment_token_retrieve_response.rbi +144 -0
  39. data/rbi/whop_sdk/models/setup_intent.rbi +412 -0
  40. data/rbi/whop_sdk/models/setup_intent_canceled_webhook_event.rbi +77 -0
  41. data/rbi/whop_sdk/models/setup_intent_list_params.rbi +99 -0
  42. data/rbi/whop_sdk/models/setup_intent_list_response.rbi +492 -0
  43. data/rbi/whop_sdk/models/setup_intent_requires_action_webhook_event.rbi +77 -0
  44. data/rbi/whop_sdk/models/setup_intent_retrieve_params.rbi +27 -0
  45. data/rbi/whop_sdk/models/setup_intent_status.rbi +25 -0
  46. data/rbi/whop_sdk/models/setup_intent_succeeded_webhook_event.rbi +77 -0
  47. data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +3 -0
  48. data/rbi/whop_sdk/models.rbi +23 -0
  49. data/rbi/whop_sdk/resources/app_builds.rbi +3 -0
  50. data/rbi/whop_sdk/resources/payment_tokens.rbi +76 -0
  51. data/rbi/whop_sdk/resources/payments.rbi +42 -0
  52. data/rbi/whop_sdk/resources/setup_intents.rbi +77 -0
  53. data/rbi/whop_sdk/resources/webhooks.rbi +3 -0
  54. data/sig/whop_sdk/client.rbs +4 -0
  55. data/sig/whop_sdk/models/app_build_create_params.rbs +5 -0
  56. data/sig/whop_sdk/models/payment.rbs +69 -0
  57. data/sig/whop_sdk/models/payment_create_params.rbs +210 -0
  58. data/sig/whop_sdk/models/payment_list_response.rbs +69 -0
  59. data/sig/whop_sdk/models/payment_token_list_params.rbs +61 -0
  60. data/sig/whop_sdk/models/payment_token_list_response.rbs +67 -0
  61. data/sig/whop_sdk/models/payment_token_retrieve_params.rbs +23 -0
  62. data/sig/whop_sdk/models/payment_token_retrieve_response.rbs +67 -0
  63. data/sig/whop_sdk/models/setup_intent.rbs +189 -0
  64. data/sig/whop_sdk/models/setup_intent_canceled_webhook_event.rbs +40 -0
  65. data/sig/whop_sdk/models/setup_intent_list_params.rbs +61 -0
  66. data/sig/whop_sdk/models/setup_intent_list_response.rbs +193 -0
  67. data/sig/whop_sdk/models/setup_intent_requires_action_webhook_event.rbs +40 -0
  68. data/sig/whop_sdk/models/setup_intent_retrieve_params.rbs +15 -0
  69. data/sig/whop_sdk/models/setup_intent_status.rbs +17 -0
  70. data/sig/whop_sdk/models/setup_intent_succeeded_webhook_event.rbs +40 -0
  71. data/sig/whop_sdk/models/unwrap_webhook_event.rbs +3 -0
  72. data/sig/whop_sdk/models.rbs +20 -0
  73. data/sig/whop_sdk/resources/app_builds.rbs +1 -0
  74. data/sig/whop_sdk/resources/payment_tokens.rbs +25 -0
  75. data/sig/whop_sdk/resources/payments.rbs +9 -0
  76. data/sig/whop_sdk/resources/setup_intents.rbs +24 -0
  77. data/sig/whop_sdk/resources/webhooks.rbs +3 -0
  78. metadata +47 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c10840499139acda05743f2fc27c566c608b2d5361559820d43db0be286fe9a5
4
- data.tar.gz: 3e285be5b55549d35de9fc885cc6ea3301edce23388f544ece842cd64354a9ce
3
+ metadata.gz: 52fccd60ae7ccaf64e90bd05372f51f66c31948db48f36e7720e3d0ea41bef5b
4
+ data.tar.gz: 240f956383f8b5133ef2190734e248cdd7458caddda070bebb92a6ad8a8d2970
5
5
  SHA512:
6
- metadata.gz: ecfe3f22c5202c573a52632778059a81ad80f61080b90a8afb762a1d39d6f3759937207b66dc06325cdfdab1f5e56acdacb4472b41a69f3047b56fc00eb49fba
7
- data.tar.gz: bb88d51770763c2a9e5d384b16e40e2228cf5731e26dbd935e572157bda9b34ad021eb411f2f037969fef4e4c148603054367ba1fd539eb3669214cd23c85bbf
6
+ metadata.gz: 62b83235379a23d717ec6639bf7cef6c42600a8944a7348ffede85eafee4c5e45d7fdeb936a6c623bd0d8db28f1dd5fdcbd5c11c81c5f9131c75580f6c825089
7
+ data.tar.gz: 128fd87f073ed68505f29d9b73aa581ea030de9541a25ed18962b3e765d602593f2d7696370c759ac91ae35e38edacd979bd1b6bbcb006fa18d0fdc70af4e0a5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.10 (2025-12-02)
4
+
5
+ Full Changelog: [v0.0.9...v0.0.10](https://github.com/whopio/whopsdk-ruby/compare/v0.0.9...v0.0.10)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([1cc25a9](https://github.com/whopio/whopsdk-ruby/commit/1cc25a9b5da017f2929c9660d8fec707fc66210d))
10
+ * **api:** manual updates ([6b53095](https://github.com/whopio/whopsdk-ruby/commit/6b5309501f02321f3653ff353b612f046d0c4ab0))
11
+
3
12
  ## 0.0.9 (2025-12-01)
4
13
 
5
14
  Full Changelog: [v0.0.8...v0.0.9](https://github.com/whopio/whopsdk-ruby/compare/v0.0.8...v0.0.9)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "whop_sdk", "~> 0.0.9"
20
+ gem "whop_sdk", "~> 0.0.10"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -135,6 +135,12 @@ module WhopSDK
135
135
  # @return [WhopSDK::Resources::AccountLinks]
136
136
  attr_reader :account_links
137
137
 
138
+ # @return [WhopSDK::Resources::SetupIntents]
139
+ attr_reader :setup_intents
140
+
141
+ # @return [WhopSDK::Resources::PaymentTokens]
142
+ attr_reader :payment_tokens
143
+
138
144
  # @api private
139
145
  #
140
146
  # @return [Hash{String=>String}]
@@ -229,6 +235,8 @@ module WhopSDK
229
235
  @refunds = WhopSDK::Resources::Refunds.new(client: self)
230
236
  @withdrawals = WhopSDK::Resources::Withdrawals.new(client: self)
231
237
  @account_links = WhopSDK::Resources::AccountLinks.new(client: self)
238
+ @setup_intents = WhopSDK::Resources::SetupIntents.new(client: self)
239
+ @payment_tokens = WhopSDK::Resources::PaymentTokens.new(client: self)
232
240
  end
233
241
 
234
242
  # Verifies a Whop user token
@@ -29,6 +29,12 @@ module WhopSDK
29
29
  # @return [Symbol, WhopSDK::Models::AppBuildPlatforms]
30
30
  required :platform, enum: -> { WhopSDK::AppBuildPlatforms }
31
31
 
32
+ # @!attribute ai_prompt_id
33
+ # The id of the ai prompt that created this build
34
+ #
35
+ # @return [String, nil]
36
+ optional :ai_prompt_id, String, nil?: true
37
+
32
38
  # @!attribute app_id
33
39
  # The ID of the app to create a build for. By default the current app from the api
34
40
  # key is used.
@@ -45,7 +51,7 @@ module WhopSDK
45
51
  -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::AppViewType] },
46
52
  nil?: true
47
53
 
48
- # @!method initialize(attachment:, checksum:, platform:, app_id: nil, supported_app_view_types: nil, request_options: {})
54
+ # @!method initialize(attachment:, checksum:, platform:, ai_prompt_id: nil, app_id: nil, supported_app_view_types: nil, request_options: {})
49
55
  # Some parameter documentations has been truncated, see
50
56
  # {WhopSDK::Models::AppBuildCreateParams} for more details.
51
57
  #
@@ -55,6 +61,8 @@ module WhopSDK
55
61
  #
56
62
  # @param platform [Symbol, WhopSDK::Models::AppBuildPlatforms] The platform of the app build (ios, android, web)
57
63
  #
64
+ # @param ai_prompt_id [String, nil] The id of the ai prompt that created this build
65
+ #
58
66
  # @param app_id [String, nil] The ID of the app to create a build for. By default the current app from the api
59
67
  #
60
68
  # @param supported_app_view_types [Array<Symbol, WhopSDK::Models::AppViewType>, nil] Supported app view types for the app build. A build can specify multiple view ty
@@ -112,6 +112,12 @@ module WhopSDK
112
112
  # @return [Symbol, WhopSDK::Models::PaymentMethodTypes, nil]
113
113
  required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }, nil?: true
114
114
 
115
+ # @!attribute payment_token
116
+ # The payment token used for the payment, if available.
117
+ #
118
+ # @return [WhopSDK::Models::Payment::PaymentToken, nil]
119
+ required :payment_token, -> { WhopSDK::Payment::PaymentToken }, nil?: true
120
+
115
121
  # @!attribute plan
116
122
  # The plan attached to this payment.
117
123
  #
@@ -200,7 +206,7 @@ module WhopSDK
200
206
  # @return [Boolean]
201
207
  required :voidable, WhopSDK::Internal::Type::Boolean
202
208
 
203
- # @!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:)
209
+ # @!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:, payment_token:, plan:, product:, promo_code:, refundable:, refunded_amount:, refunded_at:, retryable:, status:, substatus:, subtotal:, total:, usd_total:, user:, voidable:)
204
210
  # Some parameter documentations has been truncated, see {WhopSDK::Models::Payment}
205
211
  # for more details.
206
212
  #
@@ -242,6 +248,8 @@ module WhopSDK
242
248
  #
243
249
  # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes, nil] The different types of payment methods that can be used.
244
250
  #
251
+ # @param payment_token [WhopSDK::Models::Payment::PaymentToken, nil] The payment token used for the payment, if available.
252
+ #
245
253
  # @param plan [WhopSDK::Models::Payment::Plan, nil] The plan attached to this payment.
246
254
  #
247
255
  # @param product [WhopSDK::Models::Payment::Product, nil] The product this payment was made for
@@ -406,6 +414,87 @@ module WhopSDK
406
414
  # @param status [Symbol, WhopSDK::Models::MembershipStatus] The state of the membership.
407
415
  end
408
416
 
417
+ # @see WhopSDK::Models::Payment#payment_token
418
+ class PaymentToken < WhopSDK::Internal::Type::BaseModel
419
+ # @!attribute id
420
+ # The ID of the payment token
421
+ #
422
+ # @return [String]
423
+ required :id, String
424
+
425
+ # @!attribute card
426
+ # The card data associated with the payment token, if its a debit or credit card
427
+ # token.
428
+ #
429
+ # @return [WhopSDK::Models::Payment::PaymentToken::Card, nil]
430
+ required :card, -> { WhopSDK::Payment::PaymentToken::Card }, nil?: true
431
+
432
+ # @!attribute created_at
433
+ # The date and time the payment token 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 token
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::Payment::PaymentToken} for more details.
447
+ #
448
+ # The payment token used for the payment, if available.
449
+ #
450
+ # @param id [String] The ID of the payment token
451
+ #
452
+ # @param card [WhopSDK::Models::Payment::PaymentToken::Card, nil] The card data associated with the payment token, if its a debit or credit card t
453
+ #
454
+ # @param created_at [Time] The date and time the payment token was created
455
+ #
456
+ # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The payment method type of the payment token
457
+
458
+ # @see WhopSDK::Models::Payment::PaymentToken#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 token, if its a debit or credit card
486
+ # token.
487
+ #
488
+ # @param brand [Symbol, WhopSDK::Models::CardBrands, nil] Possible card brands that a payment token can have
489
+ #
490
+ # @param exp_month [Integer, nil] Card expiration month, like 03 for March.
491
+ #
492
+ # @param exp_year [Integer, nil] Card expiration year, like 27 for 2027.
493
+ #
494
+ # @param last4 [String, nil] Last four digits of the card.
495
+ end
496
+ end
497
+
409
498
  # @see WhopSDK::Models::Payment#plan
410
499
  class Plan < WhopSDK::Internal::Type::BaseModel
411
500
  # @!attribute id
@@ -0,0 +1,307 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::Payments#create
6
+ class PaymentCreateParams < WhopSDK::Internal::Type::BaseModel
7
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
8
+ include WhopSDK::Internal::Type::RequestParameters
9
+
10
+ # @!attribute company_id
11
+ # The ID of the company to create the payment for.
12
+ #
13
+ # @return [String]
14
+ required :company_id, String
15
+
16
+ # @!attribute member_id
17
+ # The ID of the member to create the payment for.
18
+ #
19
+ # @return [String]
20
+ required :member_id, String
21
+
22
+ # @!attribute payment_token_id
23
+ # The ID of the payment token to use for the payment. It must be connected to the
24
+ # Member being charged.
25
+ #
26
+ # @return [String]
27
+ required :payment_token_id, String
28
+
29
+ # @!attribute plan
30
+ # Pass this object to create a new plan for this payment
31
+ #
32
+ # @return [WhopSDK::Models::PaymentCreateParams::Plan]
33
+ required :plan, -> { WhopSDK::PaymentCreateParams::Plan }
34
+
35
+ # @!attribute plan_id
36
+ # An ID of an existing plan to use for the payment.
37
+ #
38
+ # @return [String]
39
+ required :plan_id, String
40
+
41
+ # @!method initialize(company_id:, member_id:, payment_token_id:, plan:, plan_id:, request_options: {})
42
+ # Some parameter documentations has been truncated, see
43
+ # {WhopSDK::Models::PaymentCreateParams} for more details.
44
+ #
45
+ # @param company_id [String] The ID of the company to create the payment for.
46
+ #
47
+ # @param member_id [String] The ID of the member to create the payment for.
48
+ #
49
+ # @param payment_token_id [String] The ID of the payment token to use for the payment. It must be connected to the
50
+ #
51
+ # @param plan [WhopSDK::Models::PaymentCreateParams::Plan] Pass this object to create a new plan for this payment
52
+ #
53
+ # @param plan_id [String] An ID of an existing plan to use for the payment.
54
+ #
55
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
56
+
57
+ class Plan < WhopSDK::Internal::Type::BaseModel
58
+ # @!attribute currency
59
+ # The respective currency identifier for the plan.
60
+ #
61
+ # @return [Symbol, WhopSDK::Models::Currency]
62
+ required :currency, enum: -> { WhopSDK::Currency }
63
+
64
+ # @!attribute billing_period
65
+ # The interval at which the plan charges (renewal plans).
66
+ #
67
+ # @return [Integer, nil]
68
+ optional :billing_period, Integer, nil?: true
69
+
70
+ # @!attribute description
71
+ # The description of the plan.
72
+ #
73
+ # @return [String, nil]
74
+ optional :description, String, nil?: true
75
+
76
+ # @!attribute expiration_days
77
+ # The interval at which the plan charges (expiration plans).
78
+ #
79
+ # @return [Integer, nil]
80
+ optional :expiration_days, Integer, nil?: true
81
+
82
+ # @!attribute force_create_new_plan
83
+ # Whether to force the creation of a new plan even if one with the same attributes
84
+ # already exists.
85
+ #
86
+ # @return [Boolean, nil]
87
+ optional :force_create_new_plan, WhopSDK::Internal::Type::Boolean, nil?: true
88
+
89
+ # @!attribute initial_price
90
+ # An additional amount charged upon first purchase.
91
+ #
92
+ # @return [Float, nil]
93
+ optional :initial_price, Float, nil?: true
94
+
95
+ # @!attribute internal_notes
96
+ # A personal description or notes section for the business.
97
+ #
98
+ # @return [String, nil]
99
+ optional :internal_notes, String, nil?: true
100
+
101
+ # @!attribute plan_type
102
+ # The type of plan that can be attached to a product
103
+ #
104
+ # @return [Symbol, WhopSDK::Models::PlanType, nil]
105
+ optional :plan_type, enum: -> { WhopSDK::PlanType }, nil?: true
106
+
107
+ # @!attribute product
108
+ # Pass this object to create a new product for this plan. We will use the product
109
+ # external identifier to find or create an existing product.
110
+ #
111
+ # @return [WhopSDK::Models::PaymentCreateParams::Plan::Product, nil]
112
+ optional :product, -> { WhopSDK::PaymentCreateParams::Plan::Product }, nil?: true
113
+
114
+ # @!attribute product_id
115
+ # The product the plan is related to. Either this or product is required.
116
+ #
117
+ # @return [String, nil]
118
+ optional :product_id, String, nil?: true
119
+
120
+ # @!attribute renewal_price
121
+ # The amount the customer is charged every billing period.
122
+ #
123
+ # @return [Float, nil]
124
+ optional :renewal_price, Float, nil?: true
125
+
126
+ # @!attribute title
127
+ # The title of the plan. This will be visible on the product page to customers.
128
+ #
129
+ # @return [String, nil]
130
+ optional :title, String, nil?: true
131
+
132
+ # @!attribute trial_period_days
133
+ # The number of free trial days added before a renewal plan.
134
+ #
135
+ # @return [Integer, nil]
136
+ optional :trial_period_days, Integer, nil?: true
137
+
138
+ # @!attribute visibility
139
+ # Visibility of a resource
140
+ #
141
+ # @return [Symbol, WhopSDK::Models::Visibility, nil]
142
+ optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true
143
+
144
+ # @!method initialize(currency:, billing_period: nil, description: nil, expiration_days: nil, force_create_new_plan: nil, initial_price: nil, internal_notes: nil, plan_type: nil, product: nil, product_id: nil, renewal_price: nil, title: nil, trial_period_days: nil, visibility: nil)
145
+ # Some parameter documentations has been truncated, see
146
+ # {WhopSDK::Models::PaymentCreateParams::Plan} for more details.
147
+ #
148
+ # Pass this object to create a new plan for this payment
149
+ #
150
+ # @param currency [Symbol, WhopSDK::Models::Currency] The respective currency identifier for the plan.
151
+ #
152
+ # @param billing_period [Integer, nil] The interval at which the plan charges (renewal plans).
153
+ #
154
+ # @param description [String, nil] The description of the plan.
155
+ #
156
+ # @param expiration_days [Integer, nil] The interval at which the plan charges (expiration plans).
157
+ #
158
+ # @param force_create_new_plan [Boolean, nil] Whether to force the creation of a new plan even if one with the same attributes
159
+ #
160
+ # @param initial_price [Float, nil] An additional amount charged upon first purchase.
161
+ #
162
+ # @param internal_notes [String, nil] A personal description or notes section for the business.
163
+ #
164
+ # @param plan_type [Symbol, WhopSDK::Models::PlanType, nil] The type of plan that can be attached to a product
165
+ #
166
+ # @param product [WhopSDK::Models::PaymentCreateParams::Plan::Product, nil] Pass this object to create a new product for this plan. We will use the product
167
+ #
168
+ # @param product_id [String, nil] The product the plan is related to. Either this or product is required.
169
+ #
170
+ # @param renewal_price [Float, nil] The amount the customer is charged every billing period.
171
+ #
172
+ # @param title [String, nil] The title of the plan. This will be visible on the product page to customers.
173
+ #
174
+ # @param trial_period_days [Integer, nil] The number of free trial days added before a renewal plan.
175
+ #
176
+ # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource
177
+
178
+ # @see WhopSDK::Models::PaymentCreateParams::Plan#product
179
+ class Product < WhopSDK::Internal::Type::BaseModel
180
+ # @!attribute external_identifier
181
+ # A unique ID used to find or create a product. When provided during creation, we
182
+ # will look for an existing product with this external identifier — if found, it
183
+ # will be updated; otherwise, a new product will be created.
184
+ #
185
+ # @return [String]
186
+ required :external_identifier, String
187
+
188
+ # @!attribute title
189
+ # The title of the product.
190
+ #
191
+ # @return [String]
192
+ required :title, String
193
+
194
+ # @!attribute business_type
195
+ # The different business types a company can be.
196
+ #
197
+ # @return [Symbol, WhopSDK::Models::BusinessTypes, nil]
198
+ optional :business_type, enum: -> { WhopSDK::BusinessTypes }, nil?: true
199
+
200
+ # @!attribute collect_shipping_address
201
+ # Whether or not to collect shipping information at checkout from the customer.
202
+ #
203
+ # @return [Boolean, nil]
204
+ optional :collect_shipping_address, WhopSDK::Internal::Type::Boolean, nil?: true
205
+
206
+ # @!attribute custom_statement_descriptor
207
+ # The custom statement descriptor for the product i.e. WHOP\*SPORTS, must be
208
+ # between 5 and 22 characters, contain at least one letter, and not contain any of
209
+ # the following characters: <, >, \, ', "
210
+ #
211
+ # @return [String, nil]
212
+ optional :custom_statement_descriptor, String, nil?: true
213
+
214
+ # @!attribute description
215
+ # A written description of the product.
216
+ #
217
+ # @return [String, nil]
218
+ optional :description, String, nil?: true
219
+
220
+ # @!attribute global_affiliate_percentage
221
+ # The percentage of the revenue that goes to the global affiliate program.
222
+ #
223
+ # @return [Float, nil]
224
+ optional :global_affiliate_percentage, Float, nil?: true
225
+
226
+ # @!attribute global_affiliate_status
227
+ # The different statuses of the global affiliate program for a product.
228
+ #
229
+ # @return [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil]
230
+ optional :global_affiliate_status, enum: -> { WhopSDK::GlobalAffiliateStatus }, nil?: true
231
+
232
+ # @!attribute headline
233
+ # The headline of the product.
234
+ #
235
+ # @return [String, nil]
236
+ optional :headline, String, nil?: true
237
+
238
+ # @!attribute industry_type
239
+ # The different industry types a company can be in.
240
+ #
241
+ # @return [Symbol, WhopSDK::Models::IndustryTypes, nil]
242
+ optional :industry_type, enum: -> { WhopSDK::IndustryTypes }, nil?: true
243
+
244
+ # @!attribute product_tax_code_id
245
+ # The ID of the product tax code to apply to this product.
246
+ #
247
+ # @return [String, nil]
248
+ optional :product_tax_code_id, String, nil?: true
249
+
250
+ # @!attribute redirect_purchase_url
251
+ # The URL to redirect the customer to after a purchase.
252
+ #
253
+ # @return [String, nil]
254
+ optional :redirect_purchase_url, String, nil?: true
255
+
256
+ # @!attribute route
257
+ # The route of the product.
258
+ #
259
+ # @return [String, nil]
260
+ optional :route, String, nil?: true
261
+
262
+ # @!attribute visibility
263
+ # Visibility of a resource
264
+ #
265
+ # @return [Symbol, WhopSDK::Models::Visibility, nil]
266
+ optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true
267
+
268
+ # @!method initialize(external_identifier:, title:, business_type: nil, collect_shipping_address: nil, custom_statement_descriptor: nil, description: nil, global_affiliate_percentage: nil, global_affiliate_status: nil, headline: nil, industry_type: nil, product_tax_code_id: nil, redirect_purchase_url: nil, route: nil, visibility: nil)
269
+ # Some parameter documentations has been truncated, see
270
+ # {WhopSDK::Models::PaymentCreateParams::Plan::Product} for more details.
271
+ #
272
+ # Pass this object to create a new product for this plan. We will use the product
273
+ # external identifier to find or create an existing product.
274
+ #
275
+ # @param external_identifier [String] A unique ID used to find or create a product. When provided during creation, we
276
+ #
277
+ # @param title [String] The title of the product.
278
+ #
279
+ # @param business_type [Symbol, WhopSDK::Models::BusinessTypes, nil] The different business types a company can be.
280
+ #
281
+ # @param collect_shipping_address [Boolean, nil] Whether or not to collect shipping information at checkout from the customer.
282
+ #
283
+ # @param custom_statement_descriptor [String, nil] The custom statement descriptor for the product i.e. WHOP\*SPORTS, must be
284
+ # betwee
285
+ #
286
+ # @param description [String, nil] A written description of the product.
287
+ #
288
+ # @param global_affiliate_percentage [Float, nil] The percentage of the revenue that goes to the global affiliate program.
289
+ #
290
+ # @param global_affiliate_status [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil] The different statuses of the global affiliate program for a product.
291
+ #
292
+ # @param headline [String, nil] The headline of the product.
293
+ #
294
+ # @param industry_type [Symbol, WhopSDK::Models::IndustryTypes, nil] The different industry types a company can be in.
295
+ #
296
+ # @param product_tax_code_id [String, nil] The ID of the product tax code to apply to this product.
297
+ #
298
+ # @param redirect_purchase_url [String, nil] The URL to redirect the customer to after a purchase.
299
+ #
300
+ # @param route [String, nil] The route of the product.
301
+ #
302
+ # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource
303
+ end
304
+ end
305
+ end
306
+ end
307
+ end
@@ -113,6 +113,12 @@ module WhopSDK
113
113
  # @return [Symbol, WhopSDK::Models::PaymentMethodTypes, nil]
114
114
  required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }, nil?: true
115
115
 
116
+ # @!attribute payment_token
117
+ # The payment token used for the payment, if available.
118
+ #
119
+ # @return [WhopSDK::Models::PaymentListResponse::PaymentToken, nil]
120
+ required :payment_token, -> { WhopSDK::Models::PaymentListResponse::PaymentToken }, nil?: true
121
+
116
122
  # @!attribute plan
117
123
  # The plan attached to this payment.
118
124
  #
@@ -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_type:, payment_token:, 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
  #
@@ -243,6 +249,8 @@ module WhopSDK
243
249
  #
244
250
  # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes, nil] The different types of payment methods that can be used.
245
251
  #
252
+ # @param payment_token [WhopSDK::Models::PaymentListResponse::PaymentToken, nil] The payment token used for the payment, if available.
253
+ #
246
254
  # @param plan [WhopSDK::Models::PaymentListResponse::Plan, nil] The plan attached to this payment.
247
255
  #
248
256
  # @param product [WhopSDK::Models::PaymentListResponse::Product, nil] The product this payment was made for
@@ -407,6 +415,87 @@ 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_token
419
+ class PaymentToken < WhopSDK::Internal::Type::BaseModel
420
+ # @!attribute id
421
+ # The ID of the payment token
422
+ #
423
+ # @return [String]
424
+ required :id, String
425
+
426
+ # @!attribute card
427
+ # The card data associated with the payment token, if its a debit or credit card
428
+ # token.
429
+ #
430
+ # @return [WhopSDK::Models::PaymentListResponse::PaymentToken::Card, nil]
431
+ required :card, -> { WhopSDK::Models::PaymentListResponse::PaymentToken::Card }, nil?: true
432
+
433
+ # @!attribute created_at
434
+ # The date and time the payment token was created
435
+ #
436
+ # @return [Time]
437
+ required :created_at, Time
438
+
439
+ # @!attribute payment_method_type
440
+ # The payment method type of the payment token
441
+ #
442
+ # @return [Symbol, WhopSDK::Models::PaymentMethodTypes]
443
+ required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }
444
+
445
+ # @!method initialize(id:, card:, created_at:, payment_method_type:)
446
+ # Some parameter documentations has been truncated, see
447
+ # {WhopSDK::Models::PaymentListResponse::PaymentToken} for more details.
448
+ #
449
+ # The payment token used for the payment, if available.
450
+ #
451
+ # @param id [String] The ID of the payment token
452
+ #
453
+ # @param card [WhopSDK::Models::PaymentListResponse::PaymentToken::Card, nil] The card data associated with the payment token, if its a debit or credit card t
454
+ #
455
+ # @param created_at [Time] The date and time the payment token was created
456
+ #
457
+ # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The payment method type of the payment token
458
+
459
+ # @see WhopSDK::Models::PaymentListResponse::PaymentToken#card
460
+ class Card < WhopSDK::Internal::Type::BaseModel
461
+ # @!attribute brand
462
+ # Possible card brands that a payment token can have
463
+ #
464
+ # @return [Symbol, WhopSDK::Models::CardBrands, nil]
465
+ required :brand, enum: -> { WhopSDK::CardBrands }, nil?: true
466
+
467
+ # @!attribute exp_month
468
+ # Card expiration month, like 03 for March.
469
+ #
470
+ # @return [Integer, nil]
471
+ required :exp_month, Integer, nil?: true
472
+
473
+ # @!attribute exp_year
474
+ # Card expiration year, like 27 for 2027.
475
+ #
476
+ # @return [Integer, nil]
477
+ required :exp_year, Integer, nil?: true
478
+
479
+ # @!attribute last4
480
+ # Last four digits of the card.
481
+ #
482
+ # @return [String, nil]
483
+ required :last4, String, nil?: true
484
+
485
+ # @!method initialize(brand:, exp_month:, exp_year:, last4:)
486
+ # The card data associated with the payment token, if its a debit or credit card
487
+ # token.
488
+ #
489
+ # @param brand [Symbol, WhopSDK::Models::CardBrands, nil] Possible card brands that a payment token can have
490
+ #
491
+ # @param exp_month [Integer, nil] Card expiration month, like 03 for March.
492
+ #
493
+ # @param exp_year [Integer, nil] Card expiration year, like 27 for 2027.
494
+ #
495
+ # @param last4 [String, nil] Last four digits of the card.
496
+ end
497
+ end
498
+
410
499
  # @see WhopSDK::Models::PaymentListResponse#plan
411
500
  class Plan < WhopSDK::Internal::Type::BaseModel
412
501
  # @!attribute id