whop_sdk 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +1 -1
  4. data/lib/whop_sdk/client.rb +8 -0
  5. data/lib/whop_sdk/internal/type/union.rb +12 -0
  6. data/lib/whop_sdk/models/app_build_create_params.rb +9 -1
  7. data/lib/whop_sdk/models/invoice_create_params.rb +10 -1
  8. data/lib/whop_sdk/models/payment.rb +88 -1
  9. data/lib/whop_sdk/models/payment_create_params.rb +307 -0
  10. data/lib/whop_sdk/models/payment_list_response.rb +88 -1
  11. data/lib/whop_sdk/models/payment_method_list_params.rb +78 -0
  12. data/lib/whop_sdk/models/payment_method_list_response.rb +85 -0
  13. data/lib/whop_sdk/models/payment_method_retrieve_params.rb +22 -0
  14. data/lib/whop_sdk/models/payment_method_retrieve_response.rb +85 -0
  15. data/lib/whop_sdk/models/setup_intent.rb +251 -0
  16. data/lib/whop_sdk/models/setup_intent_canceled_webhook_event.rb +52 -0
  17. data/lib/whop_sdk/models/setup_intent_list_params.rb +78 -0
  18. data/lib/whop_sdk/models/setup_intent_list_response.rb +253 -0
  19. data/lib/whop_sdk/models/setup_intent_requires_action_webhook_event.rb +52 -0
  20. data/lib/whop_sdk/models/setup_intent_retrieve_params.rb +14 -0
  21. data/lib/whop_sdk/models/setup_intent_status.rb +18 -0
  22. data/lib/whop_sdk/models/setup_intent_succeeded_webhook_event.rb +52 -0
  23. data/lib/whop_sdk/models/unwrap_webhook_event.rb +28 -19
  24. data/lib/whop_sdk/models.rb +20 -0
  25. data/lib/whop_sdk/resources/app_builds.rb +3 -1
  26. data/lib/whop_sdk/resources/invoices.rb +3 -1
  27. data/lib/whop_sdk/resources/payment_methods.rb +91 -0
  28. data/lib/whop_sdk/resources/payments.rb +50 -0
  29. data/lib/whop_sdk/resources/setup_intents.rb +91 -0
  30. data/lib/whop_sdk/resources/webhooks.rb +1 -1
  31. data/lib/whop_sdk/version.rb +1 -1
  32. data/lib/whop_sdk.rb +15 -0
  33. data/rbi/whop_sdk/client.rbi +6 -0
  34. data/rbi/whop_sdk/models/app_build_create_params.rbi +8 -0
  35. data/rbi/whop_sdk/models/invoice_create_params.rbi +10 -0
  36. data/rbi/whop_sdk/models/payment.rbi +139 -0
  37. data/rbi/whop_sdk/models/payment_create_params.rbi +384 -0
  38. data/rbi/whop_sdk/models/payment_list_response.rbi +164 -0
  39. data/rbi/whop_sdk/models/payment_method_list_params.rbi +99 -0
  40. data/rbi/whop_sdk/models/payment_method_list_response.rbi +137 -0
  41. data/rbi/whop_sdk/models/payment_method_retrieve_params.rbi +43 -0
  42. data/rbi/whop_sdk/models/payment_method_retrieve_response.rbi +142 -0
  43. data/rbi/whop_sdk/models/setup_intent.rbi +410 -0
  44. data/rbi/whop_sdk/models/setup_intent_canceled_webhook_event.rbi +77 -0
  45. data/rbi/whop_sdk/models/setup_intent_list_params.rbi +99 -0
  46. data/rbi/whop_sdk/models/setup_intent_list_response.rbi +491 -0
  47. data/rbi/whop_sdk/models/setup_intent_requires_action_webhook_event.rbi +77 -0
  48. data/rbi/whop_sdk/models/setup_intent_retrieve_params.rbi +27 -0
  49. data/rbi/whop_sdk/models/setup_intent_status.rbi +25 -0
  50. data/rbi/whop_sdk/models/setup_intent_succeeded_webhook_event.rbi +77 -0
  51. data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +3 -0
  52. data/rbi/whop_sdk/models.rbi +23 -0
  53. data/rbi/whop_sdk/resources/app_builds.rbi +3 -0
  54. data/rbi/whop_sdk/resources/invoices.rbi +4 -0
  55. data/rbi/whop_sdk/resources/payment_methods.rbi +84 -0
  56. data/rbi/whop_sdk/resources/payments.rbi +44 -0
  57. data/rbi/whop_sdk/resources/setup_intents.rbi +85 -0
  58. data/rbi/whop_sdk/resources/webhooks.rbi +3 -0
  59. data/sig/whop_sdk/client.rbs +4 -0
  60. data/sig/whop_sdk/models/app_build_create_params.rbs +5 -0
  61. data/sig/whop_sdk/models/invoice_create_params.rbs +5 -0
  62. data/sig/whop_sdk/models/payment.rbs +69 -0
  63. data/sig/whop_sdk/models/payment_create_params.rbs +210 -0
  64. data/sig/whop_sdk/models/payment_list_response.rbs +69 -0
  65. data/sig/whop_sdk/models/payment_method_list_params.rbs +61 -0
  66. data/sig/whop_sdk/models/payment_method_list_response.rbs +67 -0
  67. data/sig/whop_sdk/models/payment_method_retrieve_params.rbs +23 -0
  68. data/sig/whop_sdk/models/payment_method_retrieve_response.rbs +67 -0
  69. data/sig/whop_sdk/models/setup_intent.rbs +189 -0
  70. data/sig/whop_sdk/models/setup_intent_canceled_webhook_event.rbs +40 -0
  71. data/sig/whop_sdk/models/setup_intent_list_params.rbs +61 -0
  72. data/sig/whop_sdk/models/setup_intent_list_response.rbs +193 -0
  73. data/sig/whop_sdk/models/setup_intent_requires_action_webhook_event.rbs +40 -0
  74. data/sig/whop_sdk/models/setup_intent_retrieve_params.rbs +15 -0
  75. data/sig/whop_sdk/models/setup_intent_status.rbs +17 -0
  76. data/sig/whop_sdk/models/setup_intent_succeeded_webhook_event.rbs +40 -0
  77. data/sig/whop_sdk/models/unwrap_webhook_event.rbs +3 -0
  78. data/sig/whop_sdk/models.rbs +20 -0
  79. data/sig/whop_sdk/resources/app_builds.rbs +1 -0
  80. data/sig/whop_sdk/resources/invoices.rbs +1 -0
  81. data/sig/whop_sdk/resources/payment_methods.rbs +25 -0
  82. data/sig/whop_sdk/resources/payments.rbs +9 -0
  83. data/sig/whop_sdk/resources/setup_intents.rbs +24 -0
  84. data/sig/whop_sdk/resources/webhooks.rbs +3 -0
  85. 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: 2c1fa6283e78ac7d35742c7972630f30bde25fb899730ccb1b10daad50ee5dcb
4
+ data.tar.gz: 0a703e1bfda78d55b4780979e20397beff3eaa4ce6ed9d42d55f006f1c948054
5
5
  SHA512:
6
- metadata.gz: ecfe3f22c5202c573a52632778059a81ad80f61080b90a8afb762a1d39d6f3759937207b66dc06325cdfdab1f5e56acdacb4472b41a69f3047b56fc00eb49fba
7
- data.tar.gz: bb88d51770763c2a9e5d384b16e40e2228cf5731e26dbd935e572157bda9b34ad021eb411f2f037969fef4e4c148603054367ba1fd539eb3669214cd23c85bbf
6
+ metadata.gz: c69ac08c3f771766d2167d8ce82d54484979b583a78eb6dcd986101d21a793bbacf9f19cbe52ae5dac09e34e5dea0ff607ea4e2f324d237e8047321f69aa60e9
7
+ data.tar.gz: 9261ba267af898db55bd7283bf75f869e49071d8d36d37c5cfa7648e136f811be5b8f43713192fa622e1e5af0f4faa7aa95776266a22cefe6b84e88b796f5457
data/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.11 (2025-12-02)
4
+
5
+ Full Changelog: [v0.0.10...v0.0.11](https://github.com/whopio/whopsdk-ruby/compare/v0.0.10...v0.0.11)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([eb70106](https://github.com/whopio/whopsdk-ruby/commit/eb70106cabeebd2c9c3ce95c130f5537b65e613b))
10
+ * **api:** manual updates ([ae17f10](https://github.com/whopio/whopsdk-ruby/commit/ae17f10718e7bcbfb51471ea56bfb17c7ada5b72))
11
+
12
+
13
+ ### Chores
14
+
15
+ * **internal:** codegen related update ([6dfe6e1](https://github.com/whopio/whopsdk-ruby/commit/6dfe6e1fa2ffd8f47ae76cfa355fd4b678a128f8))
16
+
17
+ ## 0.0.10 (2025-12-02)
18
+
19
+ Full Changelog: [v0.0.9...v0.0.10](https://github.com/whopio/whopsdk-ruby/compare/v0.0.9...v0.0.10)
20
+
21
+ ### Features
22
+
23
+ * **api:** api update ([1cc25a9](https://github.com/whopio/whopsdk-ruby/commit/1cc25a9b5da017f2929c9660d8fec707fc66210d))
24
+ * **api:** manual updates ([6b53095](https://github.com/whopio/whopsdk-ruby/commit/6b5309501f02321f3653ff353b612f046d0c4ab0))
25
+
3
26
  ## 0.0.9 (2025-12-01)
4
27
 
5
28
  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.11"
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::PaymentMethods]
142
+ attr_reader :payment_methods
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_methods = WhopSDK::Resources::PaymentMethods.new(client: self)
232
240
  end
233
241
 
234
242
  # Verifies a Whop user token
@@ -17,6 +17,18 @@ module WhopSDK
17
17
  # else
18
18
  # puts(unwrap_webhook_event)
19
19
  # end
20
+ #
21
+ # @example
22
+ # case unwrap_webhook_event
23
+ # in {type: :"invoice.created", id: id, api_version: api_version, data: data}
24
+ # puts(id)
25
+ # in {type: :"invoice.paid", id: id, api_version: api_version, data: data}
26
+ # puts(api_version)
27
+ # in {type: :"invoice.past_due", id: id, api_version: api_version, data: data}
28
+ # puts(data)
29
+ # else
30
+ # puts(unwrap_webhook_event)
31
+ # end
20
32
  module Union
21
33
  include WhopSDK::Internal::Type::Converter
22
34
  include WhopSDK::Internal::Util::SorbetRuntimeSupport
@@ -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
@@ -61,6 +61,13 @@ module WhopSDK
61
61
  # @return [String, nil]
62
62
  optional :customer_name, String, nil?: true
63
63
 
64
+ # @!attribute payment_method_id
65
+ # The payment method ID to use for this invoice. If using charge_automatically,
66
+ # you must provide a payment_method_id.
67
+ #
68
+ # @return [String, nil]
69
+ optional :payment_method_id, String, nil?: true
70
+
64
71
  # @!attribute payment_token_id
65
72
  # The payment token ID to use for this invoice. If using charge_automatically, you
66
73
  # must provide a payment_token.
@@ -82,7 +89,7 @@ module WhopSDK
82
89
  # @return [String]
83
90
  required :product_id, String
84
91
 
85
- # @!method initialize(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: {})
92
+ # @!method initialize(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: {})
86
93
  # Some parameter documentations has been truncated, see
87
94
  # {WhopSDK::Models::InvoiceCreateParams} for more details.
88
95
  #
@@ -106,6 +113,8 @@ module WhopSDK
106
113
  #
107
114
  # @param customer_name [String, nil] The name of the customer to create this invoice for. This is required if you wan
108
115
  #
116
+ # @param payment_method_id [String, nil] The payment method ID to use for this invoice. If using charge_automatically, yo
117
+ #
109
118
  # @param payment_token_id [String, nil] The payment token ID to use for this invoice. If using charge_automatically, you
110
119
  #
111
120
  # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
@@ -106,6 +106,12 @@ module WhopSDK
106
106
  # @return [Time, nil]
107
107
  required :paid_at, Time, nil?: true
108
108
 
109
+ # @!attribute payment_method
110
+ # The payment method used for the payment, if available.
111
+ #
112
+ # @return [WhopSDK::Models::Payment::PaymentMethod, nil]
113
+ required :payment_method, -> { WhopSDK::Payment::PaymentMethod }, nil?: true
114
+
109
115
  # @!attribute payment_method_type
110
116
  # The different types of payment methods that can be used.
111
117
  #
@@ -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:, payment_method_type:, 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
  #
@@ -240,6 +246,8 @@ module WhopSDK
240
246
  #
241
247
  # @param paid_at [Time, nil] The datetime the payment was paid
242
248
  #
249
+ # @param payment_method [WhopSDK::Models::Payment::PaymentMethod, nil] The payment method used for the payment, if available.
250
+ #
243
251
  # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes, nil] The different types of payment methods that can be used.
244
252
  #
245
253
  # @param plan [WhopSDK::Models::Payment::Plan, nil] The plan attached to this payment.
@@ -406,6 +414,85 @@ 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_method
418
+ class PaymentMethod < WhopSDK::Internal::Type::BaseModel
419
+ # @!attribute id
420
+ # The ID of the payment method
421
+ #
422
+ # @return [String]
423
+ required :id, String
424
+
425
+ # @!attribute card
426
+ # The card data associated with the payment method, if its a debit or credit card.
427
+ #
428
+ # @return [WhopSDK::Models::Payment::PaymentMethod::Card, nil]
429
+ required :card, -> { WhopSDK::Payment::PaymentMethod::Card }, nil?: true
430
+
431
+ # @!attribute created_at
432
+ # The date and time the payment method was created
433
+ #
434
+ # @return [Time]
435
+ required :created_at, Time
436
+
437
+ # @!attribute payment_method_type
438
+ # The payment method type of the payment method
439
+ #
440
+ # @return [Symbol, WhopSDK::Models::PaymentMethodTypes]
441
+ required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }
442
+
443
+ # @!method initialize(id:, card:, created_at:, payment_method_type:)
444
+ # Some parameter documentations has been truncated, see
445
+ # {WhopSDK::Models::Payment::PaymentMethod} for more details.
446
+ #
447
+ # The payment method used for the payment, if available.
448
+ #
449
+ # @param id [String] The ID of the payment method
450
+ #
451
+ # @param card [WhopSDK::Models::Payment::PaymentMethod::Card, nil] The card data associated with the payment method, if its a debit or credit card.
452
+ #
453
+ # @param created_at [Time] The date and time the payment method was created
454
+ #
455
+ # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The payment method type of the payment method
456
+
457
+ # @see WhopSDK::Models::Payment::PaymentMethod#card
458
+ class Card < WhopSDK::Internal::Type::BaseModel
459
+ # @!attribute brand
460
+ # Possible card brands that a payment token can have
461
+ #
462
+ # @return [Symbol, WhopSDK::Models::CardBrands, nil]
463
+ required :brand, enum: -> { WhopSDK::CardBrands }, nil?: true
464
+
465
+ # @!attribute exp_month
466
+ # Card expiration month, like 03 for March.
467
+ #
468
+ # @return [Integer, nil]
469
+ required :exp_month, Integer, nil?: true
470
+
471
+ # @!attribute exp_year
472
+ # Card expiration year, like 27 for 2027.
473
+ #
474
+ # @return [Integer, nil]
475
+ required :exp_year, Integer, nil?: true
476
+
477
+ # @!attribute last4
478
+ # Last four digits of the card.
479
+ #
480
+ # @return [String, nil]
481
+ required :last4, String, nil?: true
482
+
483
+ # @!method initialize(brand:, exp_month:, exp_year:, last4:)
484
+ # The card data associated with the payment method, if its a debit or credit card.
485
+ #
486
+ # @param brand [Symbol, WhopSDK::Models::CardBrands, nil] Possible card brands that a payment token can have
487
+ #
488
+ # @param exp_month [Integer, nil] Card expiration month, like 03 for March.
489
+ #
490
+ # @param exp_year [Integer, nil] Card expiration year, like 27 for 2027.
491
+ #
492
+ # @param last4 [String, nil] Last four digits of the card.
493
+ end
494
+ end
495
+
409
496
  # @see WhopSDK::Models::Payment#plan
410
497
  class Plan < WhopSDK::Internal::Type::BaseModel
411
498
  # @!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_method_id
23
+ # The ID of the payment method to use for the payment. It must be connected to the
24
+ # Member being charged.
25
+ #
26
+ # @return [String]
27
+ required :payment_method_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_method_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_method_id [String] The ID of the payment method 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