whop_sdk 0.0.7 → 0.0.8

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 (157) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/README.md +7 -7
  4. data/lib/whop_sdk/client.rb +8 -0
  5. data/lib/whop_sdk/internal/type/base_model.rb +1 -1
  6. data/lib/whop_sdk/models/app.rb +9 -1
  7. data/lib/whop_sdk/models/app_list_params.rb +9 -1
  8. data/lib/whop_sdk/models/app_list_response.rb +9 -1
  9. data/lib/whop_sdk/models/app_type.rb +18 -0
  10. data/lib/whop_sdk/models/app_update_params.rb +9 -1
  11. data/lib/whop_sdk/models/checkout_configuration.rb +69 -7
  12. data/lib/whop_sdk/models/checkout_configuration_create_params.rb +73 -1
  13. data/lib/whop_sdk/models/checkout_configuration_list_response.rb +69 -7
  14. data/lib/whop_sdk/models/checkout_modes.rb +16 -0
  15. data/lib/whop_sdk/models/course.rb +9 -1
  16. data/lib/whop_sdk/models/course_lesson_list_response.rb +9 -1
  17. data/lib/whop_sdk/models/course_lesson_mark_as_completed_params.rb +14 -0
  18. data/lib/whop_sdk/models/course_lesson_mark_as_completed_response.rb +8 -0
  19. data/lib/whop_sdk/models/course_lesson_start_params.rb +14 -0
  20. data/lib/whop_sdk/models/course_lesson_start_response.rb +8 -0
  21. data/lib/whop_sdk/models/course_lesson_submit_assessment_params.rb +52 -0
  22. data/lib/whop_sdk/models/course_lesson_submit_assessment_response.rb +151 -0
  23. data/lib/whop_sdk/models/course_list_response.rb +9 -1
  24. data/lib/whop_sdk/models/forum_post_create_params.rb +3 -14
  25. data/lib/whop_sdk/models/forum_post_update_params.rb +3 -14
  26. data/lib/whop_sdk/models/forum_post_visibility_type.rb +16 -0
  27. data/lib/whop_sdk/models/lesson.rb +104 -2
  28. data/lib/whop_sdk/models/payment_provider.rb +22 -0
  29. data/lib/whop_sdk/models/refund_created_webhook_event.rb +354 -0
  30. data/lib/whop_sdk/models/refund_list_params.rb +62 -0
  31. data/lib/whop_sdk/models/refund_list_response.rb +113 -0
  32. data/lib/whop_sdk/models/refund_reference_status.rb +17 -0
  33. data/lib/whop_sdk/models/refund_reference_type.rb +17 -0
  34. data/lib/whop_sdk/models/refund_retrieve_params.rb +14 -0
  35. data/lib/whop_sdk/models/refund_retrieve_response.rb +307 -0
  36. data/lib/whop_sdk/models/refund_status.rb +19 -0
  37. data/lib/whop_sdk/models/refund_updated_webhook_event.rb +354 -0
  38. data/lib/whop_sdk/models/unwrap_webhook_event.rb +5 -1
  39. data/lib/whop_sdk/models/withdrawal_fee_types.rb +16 -0
  40. data/lib/whop_sdk/models/withdrawal_list_params.rb +78 -0
  41. data/lib/whop_sdk/models/withdrawal_list_response.rb +87 -0
  42. data/lib/whop_sdk/models/withdrawal_retrieve_params.rb +14 -0
  43. data/lib/whop_sdk/models/withdrawal_retrieve_response.rb +320 -0
  44. data/lib/whop_sdk/models/withdrawal_speeds.rb +16 -0
  45. data/lib/whop_sdk/models/withdrawal_status.rb +21 -0
  46. data/lib/whop_sdk/models/withdrawal_types.rb +16 -0
  47. data/lib/whop_sdk/models.rb +40 -0
  48. data/lib/whop_sdk/resources/apps.rb +6 -2
  49. data/lib/whop_sdk/resources/checkout_configurations.rb +11 -1
  50. data/lib/whop_sdk/resources/course_lessons.rb +64 -0
  51. data/lib/whop_sdk/resources/forum_posts.rb +2 -2
  52. data/lib/whop_sdk/resources/refunds.rb +78 -0
  53. data/lib/whop_sdk/resources/webhooks.rb +1 -1
  54. data/lib/whop_sdk/resources/withdrawals.rb +79 -0
  55. data/lib/whop_sdk/version.rb +1 -1
  56. data/lib/whop_sdk.rb +29 -0
  57. data/rbi/whop_sdk/client.rbi +6 -0
  58. data/rbi/whop_sdk/models/app.rbi +8 -0
  59. data/rbi/whop_sdk/models/app_list_params.rbi +8 -0
  60. data/rbi/whop_sdk/models/app_list_response.rbi +8 -0
  61. data/rbi/whop_sdk/models/app_type.rbi +22 -0
  62. data/rbi/whop_sdk/models/app_update_params.rbi +8 -0
  63. data/rbi/whop_sdk/models/checkout_configuration.rbi +117 -7
  64. data/rbi/whop_sdk/models/checkout_configuration_create_params.rbi +116 -0
  65. data/rbi/whop_sdk/models/checkout_configuration_list_response.rbi +127 -7
  66. data/rbi/whop_sdk/models/checkout_modes.rbi +20 -0
  67. data/rbi/whop_sdk/models/course.rbi +8 -0
  68. data/rbi/whop_sdk/models/course_lesson_list_response.rbi +8 -0
  69. data/rbi/whop_sdk/models/course_lesson_mark_as_completed_params.rbi +30 -0
  70. data/rbi/whop_sdk/models/course_lesson_mark_as_completed_response.rbi +8 -0
  71. data/rbi/whop_sdk/models/course_lesson_start_params.rbi +27 -0
  72. data/rbi/whop_sdk/models/course_lesson_start_response.rbi +8 -0
  73. data/rbi/whop_sdk/models/course_lesson_submit_assessment_params.rbi +104 -0
  74. data/rbi/whop_sdk/models/course_lesson_submit_assessment_response.rbi +222 -0
  75. data/rbi/whop_sdk/models/course_list_response.rbi +8 -0
  76. data/rbi/whop_sdk/models/forum_post_create_params.rbi +3 -37
  77. data/rbi/whop_sdk/models/forum_post_update_params.rbi +3 -37
  78. data/rbi/whop_sdk/models/forum_post_visibility_type.rbi +27 -0
  79. data/rbi/whop_sdk/models/lesson.rbi +115 -3
  80. data/rbi/whop_sdk/models/payment_provider.rbi +27 -0
  81. data/rbi/whop_sdk/models/refund_created_webhook_event.rbi +561 -0
  82. data/rbi/whop_sdk/models/refund_list_params.rbi +83 -0
  83. data/rbi/whop_sdk/models/refund_list_response.rbi +155 -0
  84. data/rbi/whop_sdk/models/refund_reference_status.rbi +26 -0
  85. data/rbi/whop_sdk/models/refund_reference_type.rbi +36 -0
  86. data/rbi/whop_sdk/models/refund_retrieve_params.rbi +27 -0
  87. data/rbi/whop_sdk/models/refund_retrieve_response.rbi +484 -0
  88. data/rbi/whop_sdk/models/refund_status.rbi +24 -0
  89. data/rbi/whop_sdk/models/refund_updated_webhook_event.rbi +561 -0
  90. data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +3 -1
  91. data/rbi/whop_sdk/models/withdrawal_fee_types.rbi +22 -0
  92. data/rbi/whop_sdk/models/withdrawal_list_params.rbi +99 -0
  93. data/rbi/whop_sdk/models/withdrawal_list_response.rbi +107 -0
  94. data/rbi/whop_sdk/models/withdrawal_retrieve_params.rbi +27 -0
  95. data/rbi/whop_sdk/models/withdrawal_retrieve_response.rbi +713 -0
  96. data/rbi/whop_sdk/models/withdrawal_speeds.rbi +22 -0
  97. data/rbi/whop_sdk/models/withdrawal_status.rbi +28 -0
  98. data/rbi/whop_sdk/models/withdrawal_types.rbi +20 -0
  99. data/rbi/whop_sdk/models.rbi +42 -0
  100. data/rbi/whop_sdk/resources/apps.rbi +6 -0
  101. data/rbi/whop_sdk/resources/checkout_configurations.rbi +15 -0
  102. data/rbi/whop_sdk/resources/course_lessons.rbi +48 -0
  103. data/rbi/whop_sdk/resources/forum_posts.rbi +2 -4
  104. data/rbi/whop_sdk/resources/refunds.rbi +68 -0
  105. data/rbi/whop_sdk/resources/webhooks.rbi +3 -1
  106. data/rbi/whop_sdk/resources/withdrawals.rbi +71 -0
  107. data/sig/whop_sdk/client.rbs +4 -0
  108. data/sig/whop_sdk/models/app.rbs +5 -0
  109. data/sig/whop_sdk/models/app_list_params.rbs +5 -0
  110. data/sig/whop_sdk/models/app_list_response.rbs +5 -0
  111. data/sig/whop_sdk/models/app_type.rbs +16 -0
  112. data/sig/whop_sdk/models/app_update_params.rbs +5 -0
  113. data/sig/whop_sdk/models/checkout_configuration.rbs +45 -8
  114. data/sig/whop_sdk/models/checkout_configuration_create_params.rbs +43 -1
  115. data/sig/whop_sdk/models/checkout_configuration_list_response.rbs +45 -8
  116. data/sig/whop_sdk/models/checkout_modes.rbs +14 -0
  117. data/sig/whop_sdk/models/course.rbs +5 -0
  118. data/sig/whop_sdk/models/course_lesson_list_response.rbs +5 -0
  119. data/sig/whop_sdk/models/course_lesson_mark_as_completed_params.rbs +15 -0
  120. data/sig/whop_sdk/models/course_lesson_mark_as_completed_response.rbs +5 -0
  121. data/sig/whop_sdk/models/course_lesson_start_params.rbs +15 -0
  122. data/sig/whop_sdk/models/course_lesson_start_response.rbs +5 -0
  123. data/sig/whop_sdk/models/course_lesson_submit_assessment_params.rbs +51 -0
  124. data/sig/whop_sdk/models/course_lesson_submit_assessment_response.rbs +96 -0
  125. data/sig/whop_sdk/models/course_list_response.rbs +5 -0
  126. data/sig/whop_sdk/models/forum_post_create_params.rbs +4 -15
  127. data/sig/whop_sdk/models/forum_post_update_params.rbs +4 -15
  128. data/sig/whop_sdk/models/forum_post_visibility_type.rbs +14 -0
  129. data/sig/whop_sdk/models/lesson.rbs +79 -3
  130. data/sig/whop_sdk/models/payment_provider.rbs +28 -0
  131. data/sig/whop_sdk/models/refund_created_webhook_event.rbs +252 -0
  132. data/sig/whop_sdk/models/refund_list_params.rbs +51 -0
  133. data/sig/whop_sdk/models/refund_list_response.rbs +80 -0
  134. data/sig/whop_sdk/models/refund_reference_status.rbs +15 -0
  135. data/sig/whop_sdk/models/refund_reference_type.rbs +18 -0
  136. data/sig/whop_sdk/models/refund_retrieve_params.rbs +15 -0
  137. data/sig/whop_sdk/models/refund_retrieve_response.rbs +215 -0
  138. data/sig/whop_sdk/models/refund_status.rbs +18 -0
  139. data/sig/whop_sdk/models/refund_updated_webhook_event.rbs +252 -0
  140. data/sig/whop_sdk/models/unwrap_webhook_event.rbs +2 -0
  141. data/sig/whop_sdk/models/withdrawal_fee_types.rbs +14 -0
  142. data/sig/whop_sdk/models/withdrawal_list_params.rbs +61 -0
  143. data/sig/whop_sdk/models/withdrawal_list_response.rbs +60 -0
  144. data/sig/whop_sdk/models/withdrawal_retrieve_params.rbs +15 -0
  145. data/sig/whop_sdk/models/withdrawal_retrieve_response.rbs +297 -0
  146. data/sig/whop_sdk/models/withdrawal_speeds.rbs +14 -0
  147. data/sig/whop_sdk/models/withdrawal_status.rbs +26 -0
  148. data/sig/whop_sdk/models/withdrawal_types.rbs +14 -0
  149. data/sig/whop_sdk/models.rbs +40 -0
  150. data/sig/whop_sdk/resources/apps.rbs +2 -0
  151. data/sig/whop_sdk/resources/checkout_configurations.rbs +3 -0
  152. data/sig/whop_sdk/resources/course_lessons.rbs +16 -0
  153. data/sig/whop_sdk/resources/forum_posts.rbs +2 -2
  154. data/sig/whop_sdk/resources/refunds.rbs +22 -0
  155. data/sig/whop_sdk/resources/webhooks.rbs +3 -1
  156. data/sig/whop_sdk/resources/withdrawals.rbs +24 -0
  157. metadata +89 -2
@@ -21,14 +21,42 @@ module WhopSDK
21
21
  attr_accessor :company_id
22
22
 
23
23
  # The metadata to use for the checkout configuration
24
- sig { returns(T::Hash[Symbol, T.anything]) }
24
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
25
25
  attr_accessor :metadata
26
26
 
27
+ # The mode of the checkout session.
28
+ sig { returns(WhopSDK::CheckoutModes::TaggedSymbol) }
29
+ attr_accessor :mode
30
+
31
+ # The explicit payment method configuration for the session, if any. This
32
+ # currently only works in 'setup' mode. Use the plan's
33
+ # payment_method_configuration for payment method.
34
+ sig do
35
+ returns(
36
+ T.nilable(WhopSDK::CheckoutConfiguration::PaymentMethodConfiguration)
37
+ )
38
+ end
39
+ attr_reader :payment_method_configuration
40
+
41
+ sig do
42
+ params(
43
+ payment_method_configuration:
44
+ T.nilable(
45
+ WhopSDK::CheckoutConfiguration::PaymentMethodConfiguration::OrHash
46
+ )
47
+ ).void
48
+ end
49
+ attr_writer :payment_method_configuration
50
+
27
51
  # The plan to use for the checkout configuration
28
- sig { returns(WhopSDK::CheckoutConfiguration::Plan) }
52
+ sig { returns(T.nilable(WhopSDK::CheckoutConfiguration::Plan)) }
29
53
  attr_reader :plan
30
54
 
31
- sig { params(plan: WhopSDK::CheckoutConfiguration::Plan::OrHash).void }
55
+ sig do
56
+ params(
57
+ plan: T.nilable(WhopSDK::CheckoutConfiguration::Plan::OrHash)
58
+ ).void
59
+ end
32
60
  attr_writer :plan
33
61
 
34
62
  # A URL you can send to customers to complete a checkout. It looks like
@@ -50,8 +78,13 @@ module WhopSDK
50
78
  id: String,
51
79
  affiliate_code: T.nilable(String),
52
80
  company_id: String,
53
- metadata: T::Hash[Symbol, T.anything],
54
- plan: WhopSDK::CheckoutConfiguration::Plan::OrHash,
81
+ metadata: T.nilable(T::Hash[Symbol, T.anything]),
82
+ mode: WhopSDK::CheckoutModes::OrSymbol,
83
+ payment_method_configuration:
84
+ T.nilable(
85
+ WhopSDK::CheckoutConfiguration::PaymentMethodConfiguration::OrHash
86
+ ),
87
+ plan: T.nilable(WhopSDK::CheckoutConfiguration::Plan::OrHash),
55
88
  purchase_url: String,
56
89
  redirect_url: T.nilable(String)
57
90
  ).returns(T.attached_class)
@@ -65,6 +98,12 @@ module WhopSDK
65
98
  company_id:,
66
99
  # The metadata to use for the checkout configuration
67
100
  metadata:,
101
+ # The mode of the checkout session.
102
+ mode:,
103
+ # The explicit payment method configuration for the session, if any. This
104
+ # currently only works in 'setup' mode. Use the plan's
105
+ # payment_method_configuration for payment method.
106
+ payment_method_configuration:,
68
107
  # The plan to use for the checkout configuration
69
108
  plan:,
70
109
  # A URL you can send to customers to complete a checkout. It looks like
@@ -81,8 +120,13 @@ module WhopSDK
81
120
  id: String,
82
121
  affiliate_code: T.nilable(String),
83
122
  company_id: String,
84
- metadata: T::Hash[Symbol, T.anything],
85
- plan: WhopSDK::CheckoutConfiguration::Plan,
123
+ metadata: T.nilable(T::Hash[Symbol, T.anything]),
124
+ mode: WhopSDK::CheckoutModes::TaggedSymbol,
125
+ payment_method_configuration:
126
+ T.nilable(
127
+ WhopSDK::CheckoutConfiguration::PaymentMethodConfiguration
128
+ ),
129
+ plan: T.nilable(WhopSDK::CheckoutConfiguration::Plan),
86
130
  purchase_url: String,
87
131
  redirect_url: T.nilable(String)
88
132
  }
@@ -91,6 +135,72 @@ module WhopSDK
91
135
  def to_hash
92
136
  end
93
137
 
138
+ class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel
139
+ OrHash =
140
+ T.type_alias do
141
+ T.any(
142
+ WhopSDK::CheckoutConfiguration::PaymentMethodConfiguration,
143
+ WhopSDK::Internal::AnyHash
144
+ )
145
+ end
146
+
147
+ # An array of payment method identifiers that are explicitly disabled. Only
148
+ # applies if the include_platform_defaults is true.
149
+ sig { returns(T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol]) }
150
+ attr_accessor :disabled
151
+
152
+ # An array of payment method identifiers that are explicitly enabled. This means
153
+ # these payment methods will be shown on checkout. Example use case is to only
154
+ # enable a specific payment method like cashapp, or extending the platform
155
+ # defaults with additional methods.
156
+ sig { returns(T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol]) }
157
+ attr_accessor :enabled
158
+
159
+ # Whether Whop's platform default payment method enablement settings are included
160
+ # in this configuration. The full list of default payment methods can be found in
161
+ # the documentation at docs.whop.com/payments.
162
+ sig { returns(T::Boolean) }
163
+ attr_accessor :include_platform_defaults
164
+
165
+ # The explicit payment method configuration for the session, if any. This
166
+ # currently only works in 'setup' mode. Use the plan's
167
+ # payment_method_configuration for payment method.
168
+ sig do
169
+ params(
170
+ disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol],
171
+ enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol],
172
+ include_platform_defaults: T::Boolean
173
+ ).returns(T.attached_class)
174
+ end
175
+ def self.new(
176
+ # An array of payment method identifiers that are explicitly disabled. Only
177
+ # applies if the include_platform_defaults is true.
178
+ disabled:,
179
+ # An array of payment method identifiers that are explicitly enabled. This means
180
+ # these payment methods will be shown on checkout. Example use case is to only
181
+ # enable a specific payment method like cashapp, or extending the platform
182
+ # defaults with additional methods.
183
+ enabled:,
184
+ # Whether Whop's platform default payment method enablement settings are included
185
+ # in this configuration. The full list of default payment methods can be found in
186
+ # the documentation at docs.whop.com/payments.
187
+ include_platform_defaults:
188
+ )
189
+ end
190
+
191
+ sig do
192
+ override.returns(
193
+ {
194
+ disabled: T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol],
195
+ enabled: T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol],
196
+ include_platform_defaults: T::Boolean
197
+ }
198
+ )
199
+ end
200
+ def to_hash
201
+ end
202
+ end
203
+
94
204
  class Plan < WhopSDK::Internal::Type::BaseModel
95
205
  OrHash =
96
206
  T.type_alias do
@@ -33,6 +33,31 @@ module WhopSDK
33
33
  sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
34
34
  attr_accessor :metadata
35
35
 
36
+ sig { returns(Symbol) }
37
+ attr_accessor :mode
38
+
39
+ # This currently only works for configurations made in 'setup' mode. The explicit
40
+ # payment method configuration for the checkout session. If not provided, the
41
+ # platform or company's defaults will apply.
42
+ sig do
43
+ returns(
44
+ T.nilable(
45
+ WhopSDK::CheckoutConfigurationCreateParams::PaymentMethodConfiguration
46
+ )
47
+ )
48
+ end
49
+ attr_reader :payment_method_configuration
50
+
51
+ sig do
52
+ params(
53
+ payment_method_configuration:
54
+ T.nilable(
55
+ WhopSDK::CheckoutConfigurationCreateParams::PaymentMethodConfiguration::OrHash
56
+ )
57
+ ).void
58
+ end
59
+ attr_writer :payment_method_configuration
60
+
36
61
  # The URL to redirect the user to after the checkout configuration is created
37
62
  sig { returns(T.nilable(String)) }
38
63
  attr_accessor :redirect_url
@@ -41,13 +66,24 @@ module WhopSDK
41
66
  sig { returns(String) }
42
67
  attr_accessor :plan_id
43
68
 
69
+ # The ID of the company for which to generate the checkout configuration. Only
70
+ # required in setup mode.
71
+ sig { returns(String) }
72
+ attr_accessor :company_id
73
+
44
74
  sig do
45
75
  params(
46
76
  plan: WhopSDK::CheckoutConfigurationCreateParams::Plan::OrHash,
47
77
  plan_id: String,
78
+ company_id: String,
48
79
  affiliate_code: T.nilable(String),
49
80
  metadata: T.nilable(T::Hash[Symbol, T.anything]),
81
+ payment_method_configuration:
82
+ T.nilable(
83
+ WhopSDK::CheckoutConfigurationCreateParams::PaymentMethodConfiguration::OrHash
84
+ ),
50
85
  redirect_url: T.nilable(String),
86
+ mode: Symbol,
51
87
  request_options: WhopSDK::RequestOptions::OrHash
52
88
  ).returns(T.attached_class)
53
89
  end
@@ -56,12 +92,20 @@ module WhopSDK
56
92
  plan:,
57
93
  # The ID of the plan to use for the checkout configuration
58
94
  plan_id:,
95
+ # The ID of the company for which to generate the checkout configuration. Only
96
+ # required in setup mode.
97
+ company_id:,
59
98
  # The affiliate code to use for the checkout configuration
60
99
  affiliate_code: nil,
61
100
  # The metadata to use for the checkout configuration
62
101
  metadata: nil,
102
+ # This currently only works for configurations made in 'setup' mode. The explicit
103
+ # payment method configuration for the checkout session. If not provided, the
104
+ # platform or company's defaults will apply.
105
+ payment_method_configuration: nil,
63
106
  # The URL to redirect the user to after the checkout configuration is created
64
107
  redirect_url: nil,
108
+ mode: :setup,
65
109
  request_options: {}
66
110
  )
67
111
  end
@@ -72,8 +116,14 @@ module WhopSDK
72
116
  plan: WhopSDK::CheckoutConfigurationCreateParams::Plan,
73
117
  affiliate_code: T.nilable(String),
74
118
  metadata: T.nilable(T::Hash[Symbol, T.anything]),
119
+ mode: Symbol,
120
+ payment_method_configuration:
121
+ T.nilable(
122
+ WhopSDK::CheckoutConfigurationCreateParams::PaymentMethodConfiguration
123
+ ),
75
124
  redirect_url: T.nilable(String),
76
125
  plan_id: String,
126
+ company_id: String,
77
127
  request_options: WhopSDK::RequestOptions
78
128
  }
79
129
  )
@@ -731,6 +781,72 @@ module WhopSDK
731
781
  end
732
782
  end
733
783
  end
784
+
785
+ class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel
786
+ OrHash =
787
+ T.type_alias do
788
+ T.any(
789
+ WhopSDK::CheckoutConfigurationCreateParams::PaymentMethodConfiguration,
790
+ WhopSDK::Internal::AnyHash
791
+ )
792
+ end
793
+
794
+ # An array of payment method identifiers that are explicitly disabled. Only
795
+ # applies if the include_platform_defaults is true.
796
+ sig { returns(T::Array[WhopSDK::PaymentMethodTypes::OrSymbol]) }
797
+ attr_accessor :disabled
798
+
799
+ # An array of payment method identifiers that are explicitly enabled. This means
800
+ # these payment methods will be shown on checkout. Example use case is to only
801
+ # enable a specific payment method like cashapp, or extending the platform
802
+ # defaults with additional methods.
803
+ sig { returns(T::Array[WhopSDK::PaymentMethodTypes::OrSymbol]) }
804
+ attr_accessor :enabled
805
+
806
+ # Whether Whop's platform default payment method enablement settings are included
807
+ # in this configuration. The full list of default payment methods can be found in
808
+ # the documentation at docs.whop.com/payments.
809
+ sig { returns(T::Boolean) }
810
+ attr_accessor :include_platform_defaults
811
+
812
+ # This currently only works for configurations made in 'setup' mode. The explicit
813
+ # payment method configuration for the checkout session. If not provided, the
814
+ # platform or company's defaults will apply.
815
+ sig do
816
+ params(
817
+ disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol],
818
+ enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol],
819
+ include_platform_defaults: T::Boolean
820
+ ).returns(T.attached_class)
821
+ end
822
+ def self.new(
823
+ # An array of payment method identifiers that are explicitly disabled. Only
824
+ # applies if the include_platform_defaults is true.
825
+ disabled:,
826
+ # An array of payment method identifiers that are explicitly enabled. This means
827
+ # these payment methods will be shown on checkout. Example use case is to only
828
+ # enable a specific payment method like cashapp, or extending the platform
829
+ # defaults with additional methods.
830
+ enabled:,
831
+ # Whether Whop's platform default payment method enablement settings are included
832
+ # in this configuration. The full list of default payment methods can be found in
833
+ # the documentation at docs.whop.com/payments.
834
+ include_platform_defaults:
835
+ )
836
+ end
837
+
838
+ sig do
839
+ override.returns(
840
+ {
841
+ disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol],
842
+ enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol],
843
+ include_platform_defaults: T::Boolean
844
+ }
845
+ )
846
+ end
847
+ def to_hash
848
+ end
849
+ end
734
850
  end
735
851
  end
736
852
  end
@@ -24,16 +24,49 @@ module WhopSDK
24
24
  attr_accessor :company_id
25
25
 
26
26
  # The metadata to use for the checkout configuration
27
- sig { returns(T::Hash[Symbol, T.anything]) }
27
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
28
28
  attr_accessor :metadata
29
29
 
30
+ # The mode of the checkout session.
31
+ sig { returns(WhopSDK::CheckoutModes::TaggedSymbol) }
32
+ attr_accessor :mode
33
+
34
+ # The explicit payment method configuration for the session, if any. This
35
+ # currently only works in 'setup' mode. Use the plan's
36
+ # payment_method_configuration for payment method.
37
+ sig do
38
+ returns(
39
+ T.nilable(
40
+ WhopSDK::Models::CheckoutConfigurationListResponse::PaymentMethodConfiguration
41
+ )
42
+ )
43
+ end
44
+ attr_reader :payment_method_configuration
45
+
46
+ sig do
47
+ params(
48
+ payment_method_configuration:
49
+ T.nilable(
50
+ WhopSDK::Models::CheckoutConfigurationListResponse::PaymentMethodConfiguration::OrHash
51
+ )
52
+ ).void
53
+ end
54
+ attr_writer :payment_method_configuration
55
+
30
56
  # The plan to use for the checkout configuration
31
- sig { returns(WhopSDK::Models::CheckoutConfigurationListResponse::Plan) }
57
+ sig do
58
+ returns(
59
+ T.nilable(WhopSDK::Models::CheckoutConfigurationListResponse::Plan)
60
+ )
61
+ end
32
62
  attr_reader :plan
33
63
 
34
64
  sig do
35
65
  params(
36
- plan: WhopSDK::Models::CheckoutConfigurationListResponse::Plan::OrHash
66
+ plan:
67
+ T.nilable(
68
+ WhopSDK::Models::CheckoutConfigurationListResponse::Plan::OrHash
69
+ )
37
70
  ).void
38
71
  end
39
72
  attr_writer :plan
@@ -57,9 +90,16 @@ module WhopSDK
57
90
  id: String,
58
91
  affiliate_code: T.nilable(String),
59
92
  company_id: String,
60
- metadata: T::Hash[Symbol, T.anything],
93
+ metadata: T.nilable(T::Hash[Symbol, T.anything]),
94
+ mode: WhopSDK::CheckoutModes::OrSymbol,
95
+ payment_method_configuration:
96
+ T.nilable(
97
+ WhopSDK::Models::CheckoutConfigurationListResponse::PaymentMethodConfiguration::OrHash
98
+ ),
61
99
  plan:
62
- WhopSDK::Models::CheckoutConfigurationListResponse::Plan::OrHash,
100
+ T.nilable(
101
+ WhopSDK::Models::CheckoutConfigurationListResponse::Plan::OrHash
102
+ ),
63
103
  purchase_url: String,
64
104
  redirect_url: T.nilable(String)
65
105
  ).returns(T.attached_class)
@@ -73,6 +113,12 @@ module WhopSDK
73
113
  company_id:,
74
114
  # The metadata to use for the checkout configuration
75
115
  metadata:,
116
+ # The mode of the checkout session.
117
+ mode:,
118
+ # The explicit payment method configuration for the session, if any. This
119
+ # currently only works in 'setup' mode. Use the plan's
120
+ # payment_method_configuration for payment method.
121
+ payment_method_configuration:,
76
122
  # The plan to use for the checkout configuration
77
123
  plan:,
78
124
  # A URL you can send to customers to complete a checkout. It looks like
@@ -89,8 +135,16 @@ module WhopSDK
89
135
  id: String,
90
136
  affiliate_code: T.nilable(String),
91
137
  company_id: String,
92
- metadata: T::Hash[Symbol, T.anything],
93
- plan: WhopSDK::Models::CheckoutConfigurationListResponse::Plan,
138
+ metadata: T.nilable(T::Hash[Symbol, T.anything]),
139
+ mode: WhopSDK::CheckoutModes::TaggedSymbol,
140
+ payment_method_configuration:
141
+ T.nilable(
142
+ WhopSDK::Models::CheckoutConfigurationListResponse::PaymentMethodConfiguration
143
+ ),
144
+ plan:
145
+ T.nilable(
146
+ WhopSDK::Models::CheckoutConfigurationListResponse::Plan
147
+ ),
94
148
  purchase_url: String,
95
149
  redirect_url: T.nilable(String)
96
150
  }
@@ -99,6 +153,72 @@ module WhopSDK
99
153
  def to_hash
100
154
  end
101
155
 
156
+ class PaymentMethodConfiguration < WhopSDK::Internal::Type::BaseModel
157
+ OrHash =
158
+ T.type_alias do
159
+ T.any(
160
+ WhopSDK::Models::CheckoutConfigurationListResponse::PaymentMethodConfiguration,
161
+ WhopSDK::Internal::AnyHash
162
+ )
163
+ end
164
+
165
+ # An array of payment method identifiers that are explicitly disabled. Only
166
+ # applies if the include_platform_defaults is true.
167
+ sig { returns(T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol]) }
168
+ attr_accessor :disabled
169
+
170
+ # An array of payment method identifiers that are explicitly enabled. This means
171
+ # these payment methods will be shown on checkout. Example use case is to only
172
+ # enable a specific payment method like cashapp, or extending the platform
173
+ # defaults with additional methods.
174
+ sig { returns(T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol]) }
175
+ attr_accessor :enabled
176
+
177
+ # Whether Whop's platform default payment method enablement settings are included
178
+ # in this configuration. The full list of default payment methods can be found in
179
+ # the documentation at docs.whop.com/payments.
180
+ sig { returns(T::Boolean) }
181
+ attr_accessor :include_platform_defaults
182
+
183
+ # The explicit payment method configuration for the session, if any. This
184
+ # currently only works in 'setup' mode. Use the plan's
185
+ # payment_method_configuration for payment method.
186
+ sig do
187
+ params(
188
+ disabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol],
189
+ enabled: T::Array[WhopSDK::PaymentMethodTypes::OrSymbol],
190
+ include_platform_defaults: T::Boolean
191
+ ).returns(T.attached_class)
192
+ end
193
+ def self.new(
194
+ # An array of payment method identifiers that are explicitly disabled. Only
195
+ # applies if the include_platform_defaults is true.
196
+ disabled:,
197
+ # An array of payment method identifiers that are explicitly enabled. This means
198
+ # these payment methods will be shown on checkout. Example use case is to only
199
+ # enable a specific payment method like cashapp, or extending the platform
200
+ # defaults with additional methods.
201
+ enabled:,
202
+ # Whether Whop's platform default payment method enablement settings are included
203
+ # in this configuration. The full list of default payment methods can be found in
204
+ # the documentation at docs.whop.com/payments.
205
+ include_platform_defaults:
206
+ )
207
+ end
208
+
209
+ sig do
210
+ override.returns(
211
+ {
212
+ disabled: T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol],
213
+ enabled: T::Array[WhopSDK::PaymentMethodTypes::TaggedSymbol],
214
+ include_platform_defaults: T::Boolean
215
+ }
216
+ )
217
+ end
218
+ def to_hash
219
+ end
220
+ end
221
+
102
222
  class Plan < WhopSDK::Internal::Type::BaseModel
103
223
  OrHash =
104
224
  T.type_alias do
@@ -0,0 +1,20 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # The different modes a checkout can be set to.
6
+ module CheckoutModes
7
+ extend WhopSDK::Internal::Type::Enum
8
+
9
+ TaggedSymbol = T.type_alias { T.all(Symbol, WhopSDK::CheckoutModes) }
10
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
11
+
12
+ PAYMENT = T.let(:payment, WhopSDK::CheckoutModes::TaggedSymbol)
13
+ SETUP = T.let(:setup, WhopSDK::CheckoutModes::TaggedSymbol)
14
+
15
+ sig { override.returns(T::Array[WhopSDK::CheckoutModes::TaggedSymbol]) }
16
+ def self.values
17
+ end
18
+ end
19
+ end
20
+ end
@@ -19,6 +19,10 @@ module WhopSDK
19
19
  sig { returns(T::Array[WhopSDK::Course::Chapter]) }
20
20
  attr_accessor :chapters
21
21
 
22
+ # The URL of the course's cover image, which is shown in course preview cards
23
+ sig { returns(T.nilable(String)) }
24
+ attr_accessor :cover_image
25
+
22
26
  # The timestamp of when the course was created
23
27
  sig { returns(Time) }
24
28
  attr_accessor :created_at
@@ -73,6 +77,7 @@ module WhopSDK
73
77
  id: String,
74
78
  certificate_after_completion_enabled: T.nilable(T::Boolean),
75
79
  chapters: T::Array[WhopSDK::Course::Chapter::OrHash],
80
+ cover_image: T.nilable(String),
76
81
  created_at: Time,
77
82
  description: T.nilable(String),
78
83
  language: WhopSDK::Languages::OrSymbol,
@@ -93,6 +98,8 @@ module WhopSDK
93
98
  certificate_after_completion_enabled:,
94
99
  # The chapters in this course
95
100
  chapters:,
101
+ # The URL of the course's cover image, which is shown in course preview cards
102
+ cover_image:,
96
103
  # The timestamp of when the course was created
97
104
  created_at:,
98
105
  # A short description of the course
@@ -125,6 +132,7 @@ module WhopSDK
125
132
  id: String,
126
133
  certificate_after_completion_enabled: T.nilable(T::Boolean),
127
134
  chapters: T::Array[WhopSDK::Course::Chapter],
135
+ cover_image: T.nilable(String),
128
136
  created_at: Time,
129
137
  description: T.nilable(String),
130
138
  language: WhopSDK::Languages::TaggedSymbol,
@@ -19,6 +19,10 @@ module WhopSDK
19
19
  sig { returns(T.nilable(String)) }
20
20
  attr_accessor :content
21
21
 
22
+ # The timestamp of when the lesson was created
23
+ sig { returns(Time) }
24
+ attr_accessor :created_at
25
+
22
26
  # Number of days from course start until the lesson is unlocked
23
27
  sig { returns(T.nilable(Integer)) }
24
28
  attr_accessor :days_from_course_start_until_unlock
@@ -69,6 +73,7 @@ module WhopSDK
69
73
  params(
70
74
  id: String,
71
75
  content: T.nilable(String),
76
+ created_at: Time,
72
77
  days_from_course_start_until_unlock: T.nilable(Integer),
73
78
  embed_id: T.nilable(String),
74
79
  embed_type: T.nilable(WhopSDK::EmbedType::OrSymbol),
@@ -87,6 +92,8 @@ module WhopSDK
87
92
  id:,
88
93
  # The content of the lesson
89
94
  content:,
95
+ # The timestamp of when the lesson was created
96
+ created_at:,
90
97
  # Number of days from course start until the lesson is unlocked
91
98
  days_from_course_start_until_unlock:,
92
99
  # ID for the embed (YouTube video ID or Loom share ID)
@@ -112,6 +119,7 @@ module WhopSDK
112
119
  {
113
120
  id: String,
114
121
  content: T.nilable(String),
122
+ created_at: Time,
115
123
  days_from_course_start_until_unlock: T.nilable(Integer),
116
124
  embed_id: T.nilable(String),
117
125
  embed_type: T.nilable(WhopSDK::EmbedType::TaggedSymbol),
@@ -0,0 +1,30 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class CourseLessonMarkAsCompletedParams < 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(
12
+ WhopSDK::CourseLessonMarkAsCompletedParams,
13
+ WhopSDK::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ sig do
18
+ params(request_options: WhopSDK::RequestOptions::OrHash).returns(
19
+ T.attached_class
20
+ )
21
+ end
22
+ def self.new(request_options: {})
23
+ end
24
+
25
+ sig { override.returns({ request_options: WhopSDK::RequestOptions }) }
26
+ def to_hash
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,8 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ CourseLessonMarkAsCompletedResponse =
6
+ T.let(T::Boolean, WhopSDK::Internal::Type::Converter)
7
+ end
8
+ end
@@ -0,0 +1,27 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class CourseLessonStartParams < 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::CourseLessonStartParams, WhopSDK::Internal::AnyHash)
12
+ end
13
+
14
+ sig do
15
+ params(request_options: WhopSDK::RequestOptions::OrHash).returns(
16
+ T.attached_class
17
+ )
18
+ end
19
+ def self.new(request_options: {})
20
+ end
21
+
22
+ sig { override.returns({ request_options: WhopSDK::RequestOptions }) }
23
+ def to_hash
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,8 @@
1
+ # typed: strong
2
+
3
+ module WhopSDK
4
+ module Models
5
+ CourseLessonStartResponse =
6
+ T.let(T::Boolean, WhopSDK::Internal::Type::Converter)
7
+ end
8
+ end