whop_sdk 0.0.8 → 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 (181) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +1 -1
  4. data/lib/whop_sdk/client.rb +12 -0
  5. data/lib/whop_sdk/models/account_link_create_params.rb +62 -0
  6. data/lib/whop_sdk/models/account_link_create_response.rb +28 -0
  7. data/lib/whop_sdk/models/app_build_create_params.rb +9 -1
  8. data/lib/whop_sdk/models/app_build_list_params.rb +17 -1
  9. data/lib/whop_sdk/models/app_list_params.rb +1 -0
  10. data/lib/whop_sdk/models/authorized_user_list_params.rb +17 -1
  11. data/lib/whop_sdk/models/checkout_configuration_list_params.rb +17 -1
  12. data/lib/whop_sdk/models/company_list_params.rb +17 -1
  13. data/lib/whop_sdk/models/dispute_list_params.rb +17 -1
  14. data/lib/whop_sdk/models/entry_list_params.rb +17 -1
  15. data/lib/whop_sdk/models/experience_list_params.rb +17 -1
  16. data/lib/whop_sdk/models/invoice_list_params.rb +17 -1
  17. data/lib/whop_sdk/models/payment.rb +90 -1
  18. data/lib/whop_sdk/models/payment_create_params.rb +307 -0
  19. data/lib/whop_sdk/models/payment_list_response.rb +90 -1
  20. data/lib/whop_sdk/models/payment_method_types.rb +1 -0
  21. data/lib/whop_sdk/models/payment_token_list_params.rb +78 -0
  22. data/lib/whop_sdk/models/payment_token_list_response.rb +86 -0
  23. data/lib/whop_sdk/models/payment_token_retrieve_params.rb +22 -0
  24. data/lib/whop_sdk/models/payment_token_retrieve_response.rb +86 -0
  25. data/lib/whop_sdk/models/plan_create_params.rb +3 -21
  26. data/lib/whop_sdk/models/plan_list_params.rb +17 -1
  27. data/lib/whop_sdk/models/product_list_params.rb +17 -1
  28. data/lib/whop_sdk/models/product_update_params.rb +1 -61
  29. data/lib/whop_sdk/models/promo_code_list_params.rb +17 -1
  30. data/lib/whop_sdk/models/refund_list_params.rb +17 -1
  31. data/lib/whop_sdk/models/review_list_params.rb +17 -1
  32. data/lib/whop_sdk/models/setup_intent.rb +253 -0
  33. data/lib/whop_sdk/models/setup_intent_canceled_webhook_event.rb +52 -0
  34. data/lib/whop_sdk/models/setup_intent_list_params.rb +78 -0
  35. data/lib/whop_sdk/models/setup_intent_list_response.rb +255 -0
  36. data/lib/whop_sdk/models/setup_intent_requires_action_webhook_event.rb +52 -0
  37. data/lib/whop_sdk/models/setup_intent_retrieve_params.rb +14 -0
  38. data/lib/whop_sdk/models/setup_intent_status.rb +18 -0
  39. data/lib/whop_sdk/models/setup_intent_succeeded_webhook_event.rb +52 -0
  40. data/lib/whop_sdk/models/transfer_list_params.rb +17 -1
  41. data/lib/whop_sdk/models/unwrap_webhook_event.rb +7 -1
  42. data/lib/whop_sdk/models.rb +22 -0
  43. data/lib/whop_sdk/resources/account_links.rb +47 -0
  44. data/lib/whop_sdk/resources/app_builds.rb +8 -2
  45. data/lib/whop_sdk/resources/authorized_users.rb +5 -1
  46. data/lib/whop_sdk/resources/checkout_configurations.rb +5 -1
  47. data/lib/whop_sdk/resources/companies.rb +5 -1
  48. data/lib/whop_sdk/resources/disputes.rb +5 -1
  49. data/lib/whop_sdk/resources/entries.rb +5 -1
  50. data/lib/whop_sdk/resources/experiences.rb +5 -1
  51. data/lib/whop_sdk/resources/invoices.rb +5 -1
  52. data/lib/whop_sdk/resources/payment_tokens.rb +83 -0
  53. data/lib/whop_sdk/resources/payments.rb +48 -0
  54. data/lib/whop_sdk/resources/plans.rb +7 -7
  55. data/lib/whop_sdk/resources/products.rb +6 -4
  56. data/lib/whop_sdk/resources/promo_codes.rb +5 -1
  57. data/lib/whop_sdk/resources/refunds.rb +5 -1
  58. data/lib/whop_sdk/resources/reviews.rb +5 -1
  59. data/lib/whop_sdk/resources/setup_intents.rb +83 -0
  60. data/lib/whop_sdk/resources/transfers.rb +5 -1
  61. data/lib/whop_sdk/resources/webhooks.rb +1 -1
  62. data/lib/whop_sdk/version.rb +1 -1
  63. data/lib/whop_sdk.rb +19 -0
  64. data/manifest.yaml +1 -0
  65. data/rbi/whop_sdk/client.rbi +9 -0
  66. data/rbi/whop_sdk/models/account_link_create_params.rbi +101 -0
  67. data/rbi/whop_sdk/models/account_link_create_response.rbi +38 -0
  68. data/rbi/whop_sdk/models/app_build_create_params.rbi +8 -0
  69. data/rbi/whop_sdk/models/app_build_list_params.rbi +16 -0
  70. data/rbi/whop_sdk/models/app_list_params.rbi +5 -0
  71. data/rbi/whop_sdk/models/authorized_user_list_params.rbi +16 -0
  72. data/rbi/whop_sdk/models/checkout_configuration_list_params.rbi +16 -0
  73. data/rbi/whop_sdk/models/company_list_params.rbi +16 -0
  74. data/rbi/whop_sdk/models/dispute_list_params.rbi +16 -0
  75. data/rbi/whop_sdk/models/entry_list_params.rbi +16 -0
  76. data/rbi/whop_sdk/models/experience_list_params.rbi +16 -0
  77. data/rbi/whop_sdk/models/invoice_list_params.rbi +16 -0
  78. data/rbi/whop_sdk/models/payment.rbi +142 -0
  79. data/rbi/whop_sdk/models/payment_create_params.rbi +384 -0
  80. data/rbi/whop_sdk/models/payment_list_response.rbi +167 -0
  81. data/rbi/whop_sdk/models/payment_method_types.rbi +1 -0
  82. data/rbi/whop_sdk/models/payment_token_list_params.rbi +99 -0
  83. data/rbi/whop_sdk/models/payment_token_list_response.rbi +139 -0
  84. data/rbi/whop_sdk/models/payment_token_retrieve_params.rbi +40 -0
  85. data/rbi/whop_sdk/models/payment_token_retrieve_response.rbi +144 -0
  86. data/rbi/whop_sdk/models/plan_create_params.rbi +2 -22
  87. data/rbi/whop_sdk/models/plan_list_params.rbi +16 -0
  88. data/rbi/whop_sdk/models/product_list_params.rbi +16 -0
  89. data/rbi/whop_sdk/models/product_update_params.rbi +0 -110
  90. data/rbi/whop_sdk/models/promo_code_list_params.rbi +16 -0
  91. data/rbi/whop_sdk/models/refund_list_params.rbi +16 -0
  92. data/rbi/whop_sdk/models/review_list_params.rbi +16 -0
  93. data/rbi/whop_sdk/models/setup_intent.rbi +412 -0
  94. data/rbi/whop_sdk/models/setup_intent_canceled_webhook_event.rbi +77 -0
  95. data/rbi/whop_sdk/models/setup_intent_list_params.rbi +99 -0
  96. data/rbi/whop_sdk/models/setup_intent_list_response.rbi +492 -0
  97. data/rbi/whop_sdk/models/setup_intent_requires_action_webhook_event.rbi +77 -0
  98. data/rbi/whop_sdk/models/setup_intent_retrieve_params.rbi +27 -0
  99. data/rbi/whop_sdk/models/setup_intent_status.rbi +25 -0
  100. data/rbi/whop_sdk/models/setup_intent_succeeded_webhook_event.rbi +77 -0
  101. data/rbi/whop_sdk/models/transfer_list_params.rbi +16 -0
  102. data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +3 -0
  103. data/rbi/whop_sdk/models.rbi +25 -0
  104. data/rbi/whop_sdk/resources/account_links.rbi +39 -0
  105. data/rbi/whop_sdk/resources/app_builds.rbi +9 -0
  106. data/rbi/whop_sdk/resources/authorized_users.rbi +6 -0
  107. data/rbi/whop_sdk/resources/checkout_configurations.rbi +6 -0
  108. data/rbi/whop_sdk/resources/companies.rbi +6 -0
  109. data/rbi/whop_sdk/resources/disputes.rbi +6 -0
  110. data/rbi/whop_sdk/resources/entries.rbi +6 -0
  111. data/rbi/whop_sdk/resources/experiences.rbi +6 -0
  112. data/rbi/whop_sdk/resources/invoices.rbi +6 -0
  113. data/rbi/whop_sdk/resources/payment_tokens.rbi +76 -0
  114. data/rbi/whop_sdk/resources/payments.rbi +42 -0
  115. data/rbi/whop_sdk/resources/plans.rbi +7 -9
  116. data/rbi/whop_sdk/resources/products.rbi +6 -9
  117. data/rbi/whop_sdk/resources/promo_codes.rbi +6 -0
  118. data/rbi/whop_sdk/resources/refunds.rbi +6 -0
  119. data/rbi/whop_sdk/resources/reviews.rbi +6 -0
  120. data/rbi/whop_sdk/resources/setup_intents.rbi +77 -0
  121. data/rbi/whop_sdk/resources/transfers.rbi +6 -0
  122. data/rbi/whop_sdk/resources/webhooks.rbi +3 -0
  123. data/sig/whop_sdk/client.rbs +6 -0
  124. data/sig/whop_sdk/models/account_link_create_params.rbs +52 -0
  125. data/sig/whop_sdk/models/account_link_create_response.rbs +15 -0
  126. data/sig/whop_sdk/models/app_build_create_params.rbs +5 -0
  127. data/sig/whop_sdk/models/app_build_list_params.rbs +10 -0
  128. data/sig/whop_sdk/models/app_list_params.rbs +2 -0
  129. data/sig/whop_sdk/models/authorized_user_list_params.rbs +10 -0
  130. data/sig/whop_sdk/models/checkout_configuration_list_params.rbs +10 -0
  131. data/sig/whop_sdk/models/company_list_params.rbs +10 -0
  132. data/sig/whop_sdk/models/dispute_list_params.rbs +10 -0
  133. data/sig/whop_sdk/models/entry_list_params.rbs +10 -0
  134. data/sig/whop_sdk/models/experience_list_params.rbs +10 -0
  135. data/sig/whop_sdk/models/invoice_list_params.rbs +10 -0
  136. data/sig/whop_sdk/models/payment.rbs +69 -0
  137. data/sig/whop_sdk/models/payment_create_params.rbs +210 -0
  138. data/sig/whop_sdk/models/payment_list_response.rbs +69 -0
  139. data/sig/whop_sdk/models/payment_method_types.rbs +2 -0
  140. data/sig/whop_sdk/models/payment_token_list_params.rbs +61 -0
  141. data/sig/whop_sdk/models/payment_token_list_response.rbs +67 -0
  142. data/sig/whop_sdk/models/payment_token_retrieve_params.rbs +23 -0
  143. data/sig/whop_sdk/models/payment_token_retrieve_response.rbs +67 -0
  144. data/sig/whop_sdk/models/plan_create_params.rbs +0 -10
  145. data/sig/whop_sdk/models/plan_list_params.rbs +10 -0
  146. data/sig/whop_sdk/models/product_list_params.rbs +10 -0
  147. data/sig/whop_sdk/models/product_update_params.rbs +0 -36
  148. data/sig/whop_sdk/models/promo_code_list_params.rbs +10 -0
  149. data/sig/whop_sdk/models/refund_list_params.rbs +10 -0
  150. data/sig/whop_sdk/models/review_list_params.rbs +10 -0
  151. data/sig/whop_sdk/models/setup_intent.rbs +189 -0
  152. data/sig/whop_sdk/models/setup_intent_canceled_webhook_event.rbs +40 -0
  153. data/sig/whop_sdk/models/setup_intent_list_params.rbs +61 -0
  154. data/sig/whop_sdk/models/setup_intent_list_response.rbs +193 -0
  155. data/sig/whop_sdk/models/setup_intent_requires_action_webhook_event.rbs +40 -0
  156. data/sig/whop_sdk/models/setup_intent_retrieve_params.rbs +15 -0
  157. data/sig/whop_sdk/models/setup_intent_status.rbs +17 -0
  158. data/sig/whop_sdk/models/setup_intent_succeeded_webhook_event.rbs +40 -0
  159. data/sig/whop_sdk/models/transfer_list_params.rbs +10 -0
  160. data/sig/whop_sdk/models/unwrap_webhook_event.rbs +3 -0
  161. data/sig/whop_sdk/models.rbs +22 -0
  162. data/sig/whop_sdk/resources/account_links.rbs +15 -0
  163. data/sig/whop_sdk/resources/app_builds.rbs +3 -0
  164. data/sig/whop_sdk/resources/authorized_users.rbs +2 -0
  165. data/sig/whop_sdk/resources/checkout_configurations.rbs +2 -0
  166. data/sig/whop_sdk/resources/companies.rbs +2 -0
  167. data/sig/whop_sdk/resources/disputes.rbs +2 -0
  168. data/sig/whop_sdk/resources/entries.rbs +2 -0
  169. data/sig/whop_sdk/resources/experiences.rbs +2 -0
  170. data/sig/whop_sdk/resources/invoices.rbs +2 -0
  171. data/sig/whop_sdk/resources/payment_tokens.rbs +25 -0
  172. data/sig/whop_sdk/resources/payments.rbs +9 -0
  173. data/sig/whop_sdk/resources/plans.rbs +2 -2
  174. data/sig/whop_sdk/resources/products.rbs +2 -1
  175. data/sig/whop_sdk/resources/promo_codes.rbs +2 -0
  176. data/sig/whop_sdk/resources/refunds.rbs +2 -0
  177. data/sig/whop_sdk/resources/reviews.rbs +2 -0
  178. data/sig/whop_sdk/resources/setup_intents.rbs +24 -0
  179. data/sig/whop_sdk/resources/transfers.rbs +2 -0
  180. data/sig/whop_sdk/resources/webhooks.rbs +3 -0
  181. metadata +56 -2
@@ -97,6 +97,17 @@ module WhopSDK
97
97
  sig { returns(T.nilable(WhopSDK::PaymentMethodTypes::TaggedSymbol)) }
98
98
  attr_accessor :payment_method_type
99
99
 
100
+ # The payment token used for the payment, if available.
101
+ sig { returns(T.nilable(WhopSDK::Payment::PaymentToken)) }
102
+ attr_reader :payment_token
103
+
104
+ sig do
105
+ params(
106
+ payment_token: T.nilable(WhopSDK::Payment::PaymentToken::OrHash)
107
+ ).void
108
+ end
109
+ attr_writer :payment_token
110
+
100
111
  # The plan attached to this payment.
101
112
  sig { returns(T.nilable(WhopSDK::Payment::Plan)) }
102
113
  attr_reader :plan
@@ -192,6 +203,7 @@ module WhopSDK
192
203
  metadata: T.nilable(T::Hash[Symbol, T.anything]),
193
204
  paid_at: T.nilable(Time),
194
205
  payment_method_type: T.nilable(WhopSDK::PaymentMethodTypes::OrSymbol),
206
+ payment_token: T.nilable(WhopSDK::Payment::PaymentToken::OrHash),
195
207
  plan: T.nilable(WhopSDK::Payment::Plan::OrHash),
196
208
  product: T.nilable(WhopSDK::Payment::Product::OrHash),
197
209
  promo_code: T.nilable(WhopSDK::Payment::PromoCode::OrHash),
@@ -246,6 +258,8 @@ module WhopSDK
246
258
  paid_at:,
247
259
  # The different types of payment methods that can be used.
248
260
  payment_method_type:,
261
+ # The payment token used for the payment, if available.
262
+ payment_token:,
249
263
  # The plan attached to this payment.
250
264
  plan:,
251
265
  # The product this payment was made for
@@ -303,6 +317,7 @@ module WhopSDK
303
317
  paid_at: T.nilable(Time),
304
318
  payment_method_type:
305
319
  T.nilable(WhopSDK::PaymentMethodTypes::TaggedSymbol),
320
+ payment_token: T.nilable(WhopSDK::Payment::PaymentToken),
306
321
  plan: T.nilable(WhopSDK::Payment::Plan),
307
322
  product: T.nilable(WhopSDK::Payment::Product),
308
323
  promo_code: T.nilable(WhopSDK::Payment::PromoCode),
@@ -512,6 +527,133 @@ module WhopSDK
512
527
  end
513
528
  end
514
529
 
530
+ class PaymentToken < WhopSDK::Internal::Type::BaseModel
531
+ OrHash =
532
+ T.type_alias do
533
+ T.any(WhopSDK::Payment::PaymentToken, WhopSDK::Internal::AnyHash)
534
+ end
535
+
536
+ # The ID of the payment token
537
+ sig { returns(String) }
538
+ attr_accessor :id
539
+
540
+ # The card data associated with the payment token, if its a debit or credit card
541
+ # token.
542
+ sig { returns(T.nilable(WhopSDK::Payment::PaymentToken::Card)) }
543
+ attr_reader :card
544
+
545
+ sig do
546
+ params(
547
+ card: T.nilable(WhopSDK::Payment::PaymentToken::Card::OrHash)
548
+ ).void
549
+ end
550
+ attr_writer :card
551
+
552
+ # The date and time the payment token was created
553
+ sig { returns(Time) }
554
+ attr_accessor :created_at
555
+
556
+ # The payment method type of the payment token
557
+ sig { returns(WhopSDK::PaymentMethodTypes::TaggedSymbol) }
558
+ attr_accessor :payment_method_type
559
+
560
+ # The payment token used for the payment, if available.
561
+ sig do
562
+ params(
563
+ id: String,
564
+ card: T.nilable(WhopSDK::Payment::PaymentToken::Card::OrHash),
565
+ created_at: Time,
566
+ payment_method_type: WhopSDK::PaymentMethodTypes::OrSymbol
567
+ ).returns(T.attached_class)
568
+ end
569
+ def self.new(
570
+ # The ID of the payment token
571
+ id:,
572
+ # The card data associated with the payment token, if its a debit or credit card
573
+ # token.
574
+ card:,
575
+ # The date and time the payment token was created
576
+ created_at:,
577
+ # The payment method type of the payment token
578
+ payment_method_type:
579
+ )
580
+ end
581
+
582
+ sig do
583
+ override.returns(
584
+ {
585
+ id: String,
586
+ card: T.nilable(WhopSDK::Payment::PaymentToken::Card),
587
+ created_at: Time,
588
+ payment_method_type: WhopSDK::PaymentMethodTypes::TaggedSymbol
589
+ }
590
+ )
591
+ end
592
+ def to_hash
593
+ end
594
+
595
+ class Card < WhopSDK::Internal::Type::BaseModel
596
+ OrHash =
597
+ T.type_alias do
598
+ T.any(
599
+ WhopSDK::Payment::PaymentToken::Card,
600
+ WhopSDK::Internal::AnyHash
601
+ )
602
+ end
603
+
604
+ # Possible card brands that a payment token can have
605
+ sig { returns(T.nilable(WhopSDK::CardBrands::TaggedSymbol)) }
606
+ attr_accessor :brand
607
+
608
+ # Card expiration month, like 03 for March.
609
+ sig { returns(T.nilable(Integer)) }
610
+ attr_accessor :exp_month
611
+
612
+ # Card expiration year, like 27 for 2027.
613
+ sig { returns(T.nilable(Integer)) }
614
+ attr_accessor :exp_year
615
+
616
+ # Last four digits of the card.
617
+ sig { returns(T.nilable(String)) }
618
+ attr_accessor :last4
619
+
620
+ # The card data associated with the payment token, if its a debit or credit card
621
+ # token.
622
+ sig do
623
+ params(
624
+ brand: T.nilable(WhopSDK::CardBrands::OrSymbol),
625
+ exp_month: T.nilable(Integer),
626
+ exp_year: T.nilable(Integer),
627
+ last4: T.nilable(String)
628
+ ).returns(T.attached_class)
629
+ end
630
+ def self.new(
631
+ # Possible card brands that a payment token can have
632
+ brand:,
633
+ # Card expiration month, like 03 for March.
634
+ exp_month:,
635
+ # Card expiration year, like 27 for 2027.
636
+ exp_year:,
637
+ # Last four digits of the card.
638
+ last4:
639
+ )
640
+ end
641
+
642
+ sig do
643
+ override.returns(
644
+ {
645
+ brand: T.nilable(WhopSDK::CardBrands::TaggedSymbol),
646
+ exp_month: T.nilable(Integer),
647
+ exp_year: T.nilable(Integer),
648
+ last4: T.nilable(String)
649
+ }
650
+ )
651
+ end
652
+ def to_hash
653
+ end
654
+ end
655
+ end
656
+
515
657
  class Plan < WhopSDK::Internal::Type::BaseModel
516
658
  OrHash =
517
659
  T.type_alias do
@@ -0,0 +1,384 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class PaymentCreateParams < WhopSDK::Internal::Type::BaseModel
6
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
7
+ include WhopSDK::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(WhopSDK::PaymentCreateParams, WhopSDK::Internal::AnyHash)
12
+ end
13
+
14
+ # The ID of the company to create the payment for.
15
+ sig { returns(String) }
16
+ attr_accessor :company_id
17
+
18
+ # The ID of the member to create the payment for.
19
+ sig { returns(String) }
20
+ attr_accessor :member_id
21
+
22
+ # The ID of the payment token to use for the payment. It must be connected to the
23
+ # Member being charged.
24
+ sig { returns(String) }
25
+ attr_accessor :payment_token_id
26
+
27
+ # Pass this object to create a new plan for this payment
28
+ sig { returns(WhopSDK::PaymentCreateParams::Plan) }
29
+ attr_reader :plan
30
+
31
+ sig { params(plan: WhopSDK::PaymentCreateParams::Plan::OrHash).void }
32
+ attr_writer :plan
33
+
34
+ # An ID of an existing plan to use for the payment.
35
+ sig { returns(String) }
36
+ attr_accessor :plan_id
37
+
38
+ sig do
39
+ params(
40
+ company_id: String,
41
+ member_id: String,
42
+ payment_token_id: String,
43
+ plan: WhopSDK::PaymentCreateParams::Plan::OrHash,
44
+ plan_id: String,
45
+ request_options: WhopSDK::RequestOptions::OrHash
46
+ ).returns(T.attached_class)
47
+ end
48
+ def self.new(
49
+ # The ID of the company to create the payment for.
50
+ company_id:,
51
+ # The ID of the member to create the payment for.
52
+ member_id:,
53
+ # The ID of the payment token to use for the payment. It must be connected to the
54
+ # Member being charged.
55
+ payment_token_id:,
56
+ # Pass this object to create a new plan for this payment
57
+ plan:,
58
+ # An ID of an existing plan to use for the payment.
59
+ plan_id:,
60
+ request_options: {}
61
+ )
62
+ end
63
+
64
+ sig do
65
+ override.returns(
66
+ {
67
+ company_id: String,
68
+ member_id: String,
69
+ payment_token_id: String,
70
+ plan: WhopSDK::PaymentCreateParams::Plan,
71
+ plan_id: String,
72
+ request_options: WhopSDK::RequestOptions
73
+ }
74
+ )
75
+ end
76
+ def to_hash
77
+ end
78
+
79
+ class Plan < WhopSDK::Internal::Type::BaseModel
80
+ OrHash =
81
+ T.type_alias do
82
+ T.any(
83
+ WhopSDK::PaymentCreateParams::Plan,
84
+ WhopSDK::Internal::AnyHash
85
+ )
86
+ end
87
+
88
+ # The respective currency identifier for the plan.
89
+ sig { returns(WhopSDK::Currency::OrSymbol) }
90
+ attr_accessor :currency
91
+
92
+ # The interval at which the plan charges (renewal plans).
93
+ sig { returns(T.nilable(Integer)) }
94
+ attr_accessor :billing_period
95
+
96
+ # The description of the plan.
97
+ sig { returns(T.nilable(String)) }
98
+ attr_accessor :description
99
+
100
+ # The interval at which the plan charges (expiration plans).
101
+ sig { returns(T.nilable(Integer)) }
102
+ attr_accessor :expiration_days
103
+
104
+ # Whether to force the creation of a new plan even if one with the same attributes
105
+ # already exists.
106
+ sig { returns(T.nilable(T::Boolean)) }
107
+ attr_accessor :force_create_new_plan
108
+
109
+ # An additional amount charged upon first purchase.
110
+ sig { returns(T.nilable(Float)) }
111
+ attr_accessor :initial_price
112
+
113
+ # A personal description or notes section for the business.
114
+ sig { returns(T.nilable(String)) }
115
+ attr_accessor :internal_notes
116
+
117
+ # The type of plan that can be attached to a product
118
+ sig { returns(T.nilable(WhopSDK::PlanType::OrSymbol)) }
119
+ attr_accessor :plan_type
120
+
121
+ # Pass this object to create a new product for this plan. We will use the product
122
+ # external identifier to find or create an existing product.
123
+ sig { returns(T.nilable(WhopSDK::PaymentCreateParams::Plan::Product)) }
124
+ attr_reader :product
125
+
126
+ sig do
127
+ params(
128
+ product:
129
+ T.nilable(WhopSDK::PaymentCreateParams::Plan::Product::OrHash)
130
+ ).void
131
+ end
132
+ attr_writer :product
133
+
134
+ # The product the plan is related to. Either this or product is required.
135
+ sig { returns(T.nilable(String)) }
136
+ attr_accessor :product_id
137
+
138
+ # The amount the customer is charged every billing period.
139
+ sig { returns(T.nilable(Float)) }
140
+ attr_accessor :renewal_price
141
+
142
+ # The title of the plan. This will be visible on the product page to customers.
143
+ sig { returns(T.nilable(String)) }
144
+ attr_accessor :title
145
+
146
+ # The number of free trial days added before a renewal plan.
147
+ sig { returns(T.nilable(Integer)) }
148
+ attr_accessor :trial_period_days
149
+
150
+ # Visibility of a resource
151
+ sig { returns(T.nilable(WhopSDK::Visibility::OrSymbol)) }
152
+ attr_accessor :visibility
153
+
154
+ # Pass this object to create a new plan for this payment
155
+ sig do
156
+ params(
157
+ currency: WhopSDK::Currency::OrSymbol,
158
+ billing_period: T.nilable(Integer),
159
+ description: T.nilable(String),
160
+ expiration_days: T.nilable(Integer),
161
+ force_create_new_plan: T.nilable(T::Boolean),
162
+ initial_price: T.nilable(Float),
163
+ internal_notes: T.nilable(String),
164
+ plan_type: T.nilable(WhopSDK::PlanType::OrSymbol),
165
+ product:
166
+ T.nilable(WhopSDK::PaymentCreateParams::Plan::Product::OrHash),
167
+ product_id: T.nilable(String),
168
+ renewal_price: T.nilable(Float),
169
+ title: T.nilable(String),
170
+ trial_period_days: T.nilable(Integer),
171
+ visibility: T.nilable(WhopSDK::Visibility::OrSymbol)
172
+ ).returns(T.attached_class)
173
+ end
174
+ def self.new(
175
+ # The respective currency identifier for the plan.
176
+ currency:,
177
+ # The interval at which the plan charges (renewal plans).
178
+ billing_period: nil,
179
+ # The description of the plan.
180
+ description: nil,
181
+ # The interval at which the plan charges (expiration plans).
182
+ expiration_days: nil,
183
+ # Whether to force the creation of a new plan even if one with the same attributes
184
+ # already exists.
185
+ force_create_new_plan: nil,
186
+ # An additional amount charged upon first purchase.
187
+ initial_price: nil,
188
+ # A personal description or notes section for the business.
189
+ internal_notes: nil,
190
+ # The type of plan that can be attached to a product
191
+ plan_type: nil,
192
+ # Pass this object to create a new product for this plan. We will use the product
193
+ # external identifier to find or create an existing product.
194
+ product: nil,
195
+ # The product the plan is related to. Either this or product is required.
196
+ product_id: nil,
197
+ # The amount the customer is charged every billing period.
198
+ renewal_price: nil,
199
+ # The title of the plan. This will be visible on the product page to customers.
200
+ title: nil,
201
+ # The number of free trial days added before a renewal plan.
202
+ trial_period_days: nil,
203
+ # Visibility of a resource
204
+ visibility: nil
205
+ )
206
+ end
207
+
208
+ sig do
209
+ override.returns(
210
+ {
211
+ currency: WhopSDK::Currency::OrSymbol,
212
+ billing_period: T.nilable(Integer),
213
+ description: T.nilable(String),
214
+ expiration_days: T.nilable(Integer),
215
+ force_create_new_plan: T.nilable(T::Boolean),
216
+ initial_price: T.nilable(Float),
217
+ internal_notes: T.nilable(String),
218
+ plan_type: T.nilable(WhopSDK::PlanType::OrSymbol),
219
+ product: T.nilable(WhopSDK::PaymentCreateParams::Plan::Product),
220
+ product_id: T.nilable(String),
221
+ renewal_price: T.nilable(Float),
222
+ title: T.nilable(String),
223
+ trial_period_days: T.nilable(Integer),
224
+ visibility: T.nilable(WhopSDK::Visibility::OrSymbol)
225
+ }
226
+ )
227
+ end
228
+ def to_hash
229
+ end
230
+
231
+ class Product < WhopSDK::Internal::Type::BaseModel
232
+ OrHash =
233
+ T.type_alias do
234
+ T.any(
235
+ WhopSDK::PaymentCreateParams::Plan::Product,
236
+ WhopSDK::Internal::AnyHash
237
+ )
238
+ end
239
+
240
+ # A unique ID used to find or create a product. When provided during creation, we
241
+ # will look for an existing product with this external identifier — if found, it
242
+ # will be updated; otherwise, a new product will be created.
243
+ sig { returns(String) }
244
+ attr_accessor :external_identifier
245
+
246
+ # The title of the product.
247
+ sig { returns(String) }
248
+ attr_accessor :title
249
+
250
+ # The different business types a company can be.
251
+ sig { returns(T.nilable(WhopSDK::BusinessTypes::OrSymbol)) }
252
+ attr_accessor :business_type
253
+
254
+ # Whether or not to collect shipping information at checkout from the customer.
255
+ sig { returns(T.nilable(T::Boolean)) }
256
+ attr_accessor :collect_shipping_address
257
+
258
+ # The custom statement descriptor for the product i.e. WHOP\*SPORTS, must be
259
+ # between 5 and 22 characters, contain at least one letter, and not contain any of
260
+ # the following characters: <, >, \, ', "
261
+ sig { returns(T.nilable(String)) }
262
+ attr_accessor :custom_statement_descriptor
263
+
264
+ # A written description of the product.
265
+ sig { returns(T.nilable(String)) }
266
+ attr_accessor :description
267
+
268
+ # The percentage of the revenue that goes to the global affiliate program.
269
+ sig { returns(T.nilable(Float)) }
270
+ attr_accessor :global_affiliate_percentage
271
+
272
+ # The different statuses of the global affiliate program for a product.
273
+ sig { returns(T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol)) }
274
+ attr_accessor :global_affiliate_status
275
+
276
+ # The headline of the product.
277
+ sig { returns(T.nilable(String)) }
278
+ attr_accessor :headline
279
+
280
+ # The different industry types a company can be in.
281
+ sig { returns(T.nilable(WhopSDK::IndustryTypes::OrSymbol)) }
282
+ attr_accessor :industry_type
283
+
284
+ # The ID of the product tax code to apply to this product.
285
+ sig { returns(T.nilable(String)) }
286
+ attr_accessor :product_tax_code_id
287
+
288
+ # The URL to redirect the customer to after a purchase.
289
+ sig { returns(T.nilable(String)) }
290
+ attr_accessor :redirect_purchase_url
291
+
292
+ # The route of the product.
293
+ sig { returns(T.nilable(String)) }
294
+ attr_accessor :route
295
+
296
+ # Visibility of a resource
297
+ sig { returns(T.nilable(WhopSDK::Visibility::OrSymbol)) }
298
+ attr_accessor :visibility
299
+
300
+ # Pass this object to create a new product for this plan. We will use the product
301
+ # external identifier to find or create an existing product.
302
+ sig do
303
+ params(
304
+ external_identifier: String,
305
+ title: String,
306
+ business_type: T.nilable(WhopSDK::BusinessTypes::OrSymbol),
307
+ collect_shipping_address: T.nilable(T::Boolean),
308
+ custom_statement_descriptor: T.nilable(String),
309
+ description: T.nilable(String),
310
+ global_affiliate_percentage: T.nilable(Float),
311
+ global_affiliate_status:
312
+ T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol),
313
+ headline: T.nilable(String),
314
+ industry_type: T.nilable(WhopSDK::IndustryTypes::OrSymbol),
315
+ product_tax_code_id: T.nilable(String),
316
+ redirect_purchase_url: T.nilable(String),
317
+ route: T.nilable(String),
318
+ visibility: T.nilable(WhopSDK::Visibility::OrSymbol)
319
+ ).returns(T.attached_class)
320
+ end
321
+ def self.new(
322
+ # A unique ID used to find or create a product. When provided during creation, we
323
+ # will look for an existing product with this external identifier — if found, it
324
+ # will be updated; otherwise, a new product will be created.
325
+ external_identifier:,
326
+ # The title of the product.
327
+ title:,
328
+ # The different business types a company can be.
329
+ business_type: nil,
330
+ # Whether or not to collect shipping information at checkout from the customer.
331
+ collect_shipping_address: nil,
332
+ # The custom statement descriptor for the product i.e. WHOP\*SPORTS, must be
333
+ # between 5 and 22 characters, contain at least one letter, and not contain any of
334
+ # the following characters: <, >, \, ', "
335
+ custom_statement_descriptor: nil,
336
+ # A written description of the product.
337
+ description: nil,
338
+ # The percentage of the revenue that goes to the global affiliate program.
339
+ global_affiliate_percentage: nil,
340
+ # The different statuses of the global affiliate program for a product.
341
+ global_affiliate_status: nil,
342
+ # The headline of the product.
343
+ headline: nil,
344
+ # The different industry types a company can be in.
345
+ industry_type: nil,
346
+ # The ID of the product tax code to apply to this product.
347
+ product_tax_code_id: nil,
348
+ # The URL to redirect the customer to after a purchase.
349
+ redirect_purchase_url: nil,
350
+ # The route of the product.
351
+ route: nil,
352
+ # Visibility of a resource
353
+ visibility: nil
354
+ )
355
+ end
356
+
357
+ sig do
358
+ override.returns(
359
+ {
360
+ external_identifier: String,
361
+ title: String,
362
+ business_type: T.nilable(WhopSDK::BusinessTypes::OrSymbol),
363
+ collect_shipping_address: T.nilable(T::Boolean),
364
+ custom_statement_descriptor: T.nilable(String),
365
+ description: T.nilable(String),
366
+ global_affiliate_percentage: T.nilable(Float),
367
+ global_affiliate_status:
368
+ T.nilable(WhopSDK::GlobalAffiliateStatus::OrSymbol),
369
+ headline: T.nilable(String),
370
+ industry_type: T.nilable(WhopSDK::IndustryTypes::OrSymbol),
371
+ product_tax_code_id: T.nilable(String),
372
+ redirect_purchase_url: T.nilable(String),
373
+ route: T.nilable(String),
374
+ visibility: T.nilable(WhopSDK::Visibility::OrSymbol)
375
+ }
376
+ )
377
+ end
378
+ def to_hash
379
+ end
380
+ end
381
+ end
382
+ end
383
+ end
384
+ end