whop_sdk 0.0.2 → 0.0.3

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 (263) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/README.md +1 -1
  4. data/lib/whop_sdk/client.rb +20 -0
  5. data/lib/whop_sdk/internal/transport/pooled_net_requester.rb +30 -24
  6. data/lib/whop_sdk/models/assessment_question_types.rb +18 -0
  7. data/lib/whop_sdk/models/billing_reasons.rb +20 -0
  8. data/lib/whop_sdk/models/card_brands.rb +30 -0
  9. data/lib/whop_sdk/models/checkout_configuration.rb +10 -7
  10. data/lib/whop_sdk/models/checkout_configuration_create_params.rb +140 -3
  11. data/lib/whop_sdk/models/checkout_configuration_list_response.rb +10 -7
  12. data/lib/whop_sdk/models/course.rb +230 -0
  13. data/lib/whop_sdk/models/course_chapter.rb +72 -0
  14. data/lib/whop_sdk/models/course_chapter_create_params.rb +30 -0
  15. data/lib/whop_sdk/models/course_chapter_delete_params.rb +14 -0
  16. data/lib/whop_sdk/models/course_chapter_delete_response.rb +8 -0
  17. data/lib/whop_sdk/models/course_chapter_list_params.rb +54 -0
  18. data/lib/whop_sdk/models/course_chapter_list_response.rb +35 -0
  19. data/lib/whop_sdk/models/course_chapter_retrieve_params.rb +14 -0
  20. data/lib/whop_sdk/models/course_chapter_update_params.rb +22 -0
  21. data/lib/whop_sdk/models/course_create_params.rb +82 -0
  22. data/lib/whop_sdk/models/course_delete_params.rb +14 -0
  23. data/lib/whop_sdk/models/course_delete_response.rb +8 -0
  24. data/lib/whop_sdk/models/course_lesson_create_params.rb +54 -0
  25. data/lib/whop_sdk/models/course_lesson_delete_params.rb +14 -0
  26. data/lib/whop_sdk/models/course_lesson_delete_response.rb +8 -0
  27. data/lib/whop_sdk/models/course_lesson_list_params.rb +62 -0
  28. data/lib/whop_sdk/models/course_lesson_list_response.rb +71 -0
  29. data/lib/whop_sdk/models/course_lesson_retrieve_params.rb +14 -0
  30. data/lib/whop_sdk/models/course_lesson_update_params.rb +278 -0
  31. data/lib/whop_sdk/models/course_list_params.rb +62 -0
  32. data/lib/whop_sdk/models/course_list_response.rb +148 -0
  33. data/lib/whop_sdk/models/course_retrieve_params.rb +14 -0
  34. data/lib/whop_sdk/models/course_update_params.rb +197 -0
  35. data/lib/whop_sdk/models/experience_duplicate_params.rb +22 -0
  36. data/lib/whop_sdk/models/forum_post.rb +17 -1
  37. data/lib/whop_sdk/models/forum_post_list_response.rb +17 -1
  38. data/lib/whop_sdk/models/forum_post_update_params.rb +80 -0
  39. data/lib/whop_sdk/models/invoice.rb +6 -2
  40. data/lib/whop_sdk/models/invoice_list_item.rb +6 -2
  41. data/lib/whop_sdk/models/languages.rb +36 -0
  42. data/lib/whop_sdk/models/ledger_account_retrieve_response.rb +9 -0
  43. data/lib/whop_sdk/models/lesson.rb +365 -0
  44. data/lib/whop_sdk/models/lesson_types.rb +20 -0
  45. data/lib/whop_sdk/models/lesson_visibilities.rb +17 -0
  46. data/lib/whop_sdk/models/member_list_params.rb +9 -1
  47. data/lib/whop_sdk/models/membership.rb +31 -1
  48. data/lib/whop_sdk/models/membership_list_params.rb +16 -8
  49. data/lib/whop_sdk/models/membership_list_response.rb +31 -1
  50. data/lib/whop_sdk/models/message_update_params.rb +68 -0
  51. data/lib/whop_sdk/models/payment.rb +24 -21
  52. data/lib/whop_sdk/models/payment_list_params.rb +3 -18
  53. data/lib/whop_sdk/models/payment_list_response.rb +24 -21
  54. data/lib/whop_sdk/models/payment_method_types.rb +98 -0
  55. data/lib/whop_sdk/models/plan.rb +25 -1
  56. data/lib/whop_sdk/models/plan_create_params.rb +37 -3
  57. data/lib/whop_sdk/models/plan_list_response.rb +25 -1
  58. data/lib/whop_sdk/models/plan_update_params.rb +35 -1
  59. data/lib/whop_sdk/models/product.rb +11 -1
  60. data/lib/whop_sdk/models/product_create_params.rb +1 -45
  61. data/lib/whop_sdk/models/product_list_item.rb +14 -1
  62. data/lib/whop_sdk/models/product_update_params.rb +30 -1
  63. data/lib/whop_sdk/models/promo_code.rb +211 -0
  64. data/lib/whop_sdk/models/promo_code_create_params.rb +140 -0
  65. data/lib/whop_sdk/models/promo_code_delete_params.rb +14 -0
  66. data/lib/whop_sdk/models/promo_code_delete_response.rb +8 -0
  67. data/lib/whop_sdk/models/promo_code_list_params.rb +78 -0
  68. data/lib/whop_sdk/models/promo_code_list_response.rb +181 -0
  69. data/lib/whop_sdk/models/promo_code_retrieve_params.rb +14 -0
  70. data/lib/whop_sdk/models/promo_code_status.rb +17 -0
  71. data/lib/whop_sdk/models/promo_duration.rb +17 -0
  72. data/lib/whop_sdk/models/review_list_params.rb +70 -0
  73. data/lib/whop_sdk/models/review_list_response.rb +183 -0
  74. data/lib/whop_sdk/models/review_retrieve_params.rb +14 -0
  75. data/lib/whop_sdk/models/review_retrieve_response.rb +251 -0
  76. data/lib/whop_sdk/models/review_status.rb +17 -0
  77. data/lib/whop_sdk/models.rb +76 -0
  78. data/lib/whop_sdk/resources/checkout_configurations.rb +2 -0
  79. data/lib/whop_sdk/resources/course_chapters.rb +151 -0
  80. data/lib/whop_sdk/resources/course_lessons.rb +178 -0
  81. data/lib/whop_sdk/resources/courses.rb +178 -0
  82. data/lib/whop_sdk/resources/experiences.rb +33 -0
  83. data/lib/whop_sdk/resources/forum_posts.rb +33 -0
  84. data/lib/whop_sdk/resources/members.rb +3 -1
  85. data/lib/whop_sdk/resources/memberships.rb +6 -4
  86. data/lib/whop_sdk/resources/messages.rb +28 -0
  87. data/lib/whop_sdk/resources/payments.rb +1 -1
  88. data/lib/whop_sdk/resources/plans.rb +19 -3
  89. data/lib/whop_sdk/resources/products.rb +4 -6
  90. data/lib/whop_sdk/resources/promo_codes.rb +161 -0
  91. data/lib/whop_sdk/resources/reviews.rb +68 -0
  92. data/lib/whop_sdk/version.rb +1 -1
  93. data/lib/whop_sdk.rb +53 -0
  94. data/rbi/whop_sdk/client.rbi +15 -0
  95. data/rbi/whop_sdk/models/assessment_question_types.rbi +31 -0
  96. data/rbi/whop_sdk/models/billing_reasons.rbi +27 -0
  97. data/rbi/whop_sdk/models/card_brands.rbi +35 -0
  98. data/rbi/whop_sdk/models/checkout_configuration.rbi +4 -2
  99. data/rbi/whop_sdk/models/checkout_configuration_create_params.rbi +183 -2
  100. data/rbi/whop_sdk/models/checkout_configuration_list_response.rbi +4 -2
  101. data/rbi/whop_sdk/models/course.rbi +313 -0
  102. data/rbi/whop_sdk/models/course_chapter.rbi +101 -0
  103. data/rbi/whop_sdk/models/course_chapter_create_params.rbi +51 -0
  104. data/rbi/whop_sdk/models/course_chapter_delete_params.rbi +27 -0
  105. data/rbi/whop_sdk/models/course_chapter_delete_response.rbi +8 -0
  106. data/rbi/whop_sdk/models/course_chapter_list_params.rbi +75 -0
  107. data/rbi/whop_sdk/models/course_chapter_list_response.rbi +47 -0
  108. data/rbi/whop_sdk/models/course_chapter_retrieve_params.rbi +30 -0
  109. data/rbi/whop_sdk/models/course_chapter_update_params.rbi +40 -0
  110. data/rbi/whop_sdk/models/course_create_params.rbi +131 -0
  111. data/rbi/whop_sdk/models/course_delete_params.rbi +27 -0
  112. data/rbi/whop_sdk/models/course_delete_response.rbi +7 -0
  113. data/rbi/whop_sdk/models/course_lesson_create_params.rbi +75 -0
  114. data/rbi/whop_sdk/models/course_lesson_delete_params.rbi +27 -0
  115. data/rbi/whop_sdk/models/course_lesson_delete_response.rbi +8 -0
  116. data/rbi/whop_sdk/models/course_lesson_list_params.rbi +83 -0
  117. data/rbi/whop_sdk/models/course_lesson_list_response.rbi +91 -0
  118. data/rbi/whop_sdk/models/course_lesson_retrieve_params.rbi +27 -0
  119. data/rbi/whop_sdk/models/course_lesson_update_params.rbi +465 -0
  120. data/rbi/whop_sdk/models/course_list_params.rbi +83 -0
  121. data/rbi/whop_sdk/models/course_list_response.rbi +198 -0
  122. data/rbi/whop_sdk/models/course_retrieve_params.rbi +27 -0
  123. data/rbi/whop_sdk/models/course_update_params.rbi +293 -0
  124. data/rbi/whop_sdk/models/experience_duplicate_params.rbi +40 -0
  125. data/rbi/whop_sdk/models/forum_post.rbi +16 -0
  126. data/rbi/whop_sdk/models/forum_post_list_response.rbi +16 -0
  127. data/rbi/whop_sdk/models/forum_post_update_params.rbi +124 -0
  128. data/rbi/whop_sdk/models/invoice.rbi +4 -2
  129. data/rbi/whop_sdk/models/invoice_list_item.rbi +4 -2
  130. data/rbi/whop_sdk/models/languages.rbi +40 -0
  131. data/rbi/whop_sdk/models/ledger_account_retrieve_response.rbi +45 -0
  132. data/rbi/whop_sdk/models/lesson.rbi +517 -0
  133. data/rbi/whop_sdk/models/lesson_types.rbi +25 -0
  134. data/rbi/whop_sdk/models/lesson_visibilities.rbi +23 -0
  135. data/rbi/whop_sdk/models/member_list_params.rbi +8 -0
  136. data/rbi/whop_sdk/models/membership.rbi +40 -0
  137. data/rbi/whop_sdk/models/membership_list_params.rbi +16 -8
  138. data/rbi/whop_sdk/models/membership_list_response.rbi +47 -0
  139. data/rbi/whop_sdk/models/message_update_params.rbi +114 -0
  140. data/rbi/whop_sdk/models/payment.rbi +32 -25
  141. data/rbi/whop_sdk/models/payment_list_params.rbi +3 -63
  142. data/rbi/whop_sdk/models/payment_list_response.rbi +32 -25
  143. data/rbi/whop_sdk/models/payment_method_types.rbi +116 -0
  144. data/rbi/whop_sdk/models/plan.rbi +24 -0
  145. data/rbi/whop_sdk/models/plan_create_params.rbi +38 -2
  146. data/rbi/whop_sdk/models/plan_list_response.rbi +24 -0
  147. data/rbi/whop_sdk/models/plan_update_params.rbi +36 -0
  148. data/rbi/whop_sdk/models/product.rbi +12 -0
  149. data/rbi/whop_sdk/models/product_create_params.rbi +0 -74
  150. data/rbi/whop_sdk/models/product_list_item.rbi +12 -0
  151. data/rbi/whop_sdk/models/product_update_params.rbi +59 -0
  152. data/rbi/whop_sdk/models/promo_code.rbi +248 -0
  153. data/rbi/whop_sdk/models/promo_code_create_params.rbi +161 -0
  154. data/rbi/whop_sdk/models/promo_code_delete_params.rbi +27 -0
  155. data/rbi/whop_sdk/models/promo_code_delete_response.rbi +8 -0
  156. data/rbi/whop_sdk/models/promo_code_list_params.rbi +99 -0
  157. data/rbi/whop_sdk/models/promo_code_list_response.rbi +222 -0
  158. data/rbi/whop_sdk/models/promo_code_retrieve_params.rbi +27 -0
  159. data/rbi/whop_sdk/models/promo_code_status.rbi +21 -0
  160. data/rbi/whop_sdk/models/promo_duration.rbi +21 -0
  161. data/rbi/whop_sdk/models/review_list_params.rbi +91 -0
  162. data/rbi/whop_sdk/models/review_list_response.rbi +243 -0
  163. data/rbi/whop_sdk/models/review_retrieve_params.rbi +27 -0
  164. data/rbi/whop_sdk/models/review_retrieve_response.rbi +354 -0
  165. data/rbi/whop_sdk/models/review_status.rbi +21 -0
  166. data/rbi/whop_sdk/models.rbi +76 -0
  167. data/rbi/whop_sdk/resources/checkout_configurations.rbi +2 -0
  168. data/rbi/whop_sdk/resources/course_chapters.rbi +115 -0
  169. data/rbi/whop_sdk/resources/course_lessons.rbi +163 -0
  170. data/rbi/whop_sdk/resources/courses.rbi +152 -0
  171. data/rbi/whop_sdk/resources/experiences.rbi +25 -0
  172. data/rbi/whop_sdk/resources/forum_posts.rbi +29 -0
  173. data/rbi/whop_sdk/resources/members.rbi +3 -0
  174. data/rbi/whop_sdk/resources/memberships.rbi +6 -3
  175. data/rbi/whop_sdk/resources/messages.rbi +25 -0
  176. data/rbi/whop_sdk/resources/payments.rbi +1 -3
  177. data/rbi/whop_sdk/resources/plans.rbi +29 -1
  178. data/rbi/whop_sdk/resources/products.rbi +4 -7
  179. data/rbi/whop_sdk/resources/promo_codes.rbi +147 -0
  180. data/rbi/whop_sdk/resources/reviews.rbi +56 -0
  181. data/sig/whop_sdk/client.rbs +10 -0
  182. data/sig/whop_sdk/models/assessment_question_types.rbs +17 -0
  183. data/sig/whop_sdk/models/billing_reasons.rbs +24 -0
  184. data/sig/whop_sdk/models/card_brands.rbs +44 -0
  185. data/sig/whop_sdk/models/checkout_configuration_create_params.rbs +87 -0
  186. data/sig/whop_sdk/models/course.rbs +171 -0
  187. data/sig/whop_sdk/models/course_chapter.rbs +49 -0
  188. data/sig/whop_sdk/models/course_chapter_create_params.rbs +28 -0
  189. data/sig/whop_sdk/models/course_chapter_delete_params.rbs +15 -0
  190. data/sig/whop_sdk/models/course_chapter_delete_response.rbs +5 -0
  191. data/sig/whop_sdk/models/course_chapter_list_params.rbs +46 -0
  192. data/sig/whop_sdk/models/course_chapter_list_response.rbs +18 -0
  193. data/sig/whop_sdk/models/course_chapter_retrieve_params.rbs +15 -0
  194. data/sig/whop_sdk/models/course_chapter_update_params.rbs +23 -0
  195. data/sig/whop_sdk/models/course_create_params.rbs +58 -0
  196. data/sig/whop_sdk/models/course_delete_params.rbs +15 -0
  197. data/sig/whop_sdk/models/course_delete_response.rbs +5 -0
  198. data/sig/whop_sdk/models/course_lesson_create_params.rbs +46 -0
  199. data/sig/whop_sdk/models/course_lesson_delete_params.rbs +15 -0
  200. data/sig/whop_sdk/models/course_lesson_delete_response.rbs +5 -0
  201. data/sig/whop_sdk/models/course_lesson_list_params.rbs +51 -0
  202. data/sig/whop_sdk/models/course_lesson_list_response.rbs +50 -0
  203. data/sig/whop_sdk/models/course_lesson_retrieve_params.rbs +15 -0
  204. data/sig/whop_sdk/models/course_lesson_update_params.rbs +162 -0
  205. data/sig/whop_sdk/models/course_list_params.rbs +51 -0
  206. data/sig/whop_sdk/models/course_list_response.rbs +102 -0
  207. data/sig/whop_sdk/models/course_retrieve_params.rbs +15 -0
  208. data/sig/whop_sdk/models/course_update_params.rbs +137 -0
  209. data/sig/whop_sdk/models/experience_duplicate_params.rbs +23 -0
  210. data/sig/whop_sdk/models/forum_post.rbs +10 -0
  211. data/sig/whop_sdk/models/forum_post_list_response.rbs +10 -0
  212. data/sig/whop_sdk/models/forum_post_update_params.rbs +53 -0
  213. data/sig/whop_sdk/models/languages.rbs +56 -0
  214. data/sig/whop_sdk/models/ledger_account_retrieve_response.rbs +20 -1
  215. data/sig/whop_sdk/models/lesson.rbs +248 -0
  216. data/sig/whop_sdk/models/lesson_types.rbs +19 -0
  217. data/sig/whop_sdk/models/lesson_visibilities.rbs +14 -0
  218. data/sig/whop_sdk/models/member_list_params.rbs +6 -1
  219. data/sig/whop_sdk/models/membership.rbs +17 -0
  220. data/sig/whop_sdk/models/membership_list_params.rbs +11 -6
  221. data/sig/whop_sdk/models/membership_list_response.rbs +17 -0
  222. data/sig/whop_sdk/models/message_update_params.rbs +48 -0
  223. data/sig/whop_sdk/models/payment.rbs +12 -12
  224. data/sig/whop_sdk/models/payment_list_params.rbs +4 -25
  225. data/sig/whop_sdk/models/payment_list_response.rbs +12 -12
  226. data/sig/whop_sdk/models/payment_method_types.rbs +180 -0
  227. data/sig/whop_sdk/models/plan.rbs +15 -0
  228. data/sig/whop_sdk/models/plan_create_params.rbs +20 -0
  229. data/sig/whop_sdk/models/plan_list_response.rbs +15 -0
  230. data/sig/whop_sdk/models/plan_update_params.rbs +20 -0
  231. data/sig/whop_sdk/models/product.rbs +5 -0
  232. data/sig/whop_sdk/models/product_create_params.rbs +0 -22
  233. data/sig/whop_sdk/models/product_list_item.rbs +5 -0
  234. data/sig/whop_sdk/models/product_update_params.rbs +17 -0
  235. data/sig/whop_sdk/models/promo_code.rbs +134 -0
  236. data/sig/whop_sdk/models/promo_code_create_params.rbs +96 -0
  237. data/sig/whop_sdk/models/promo_code_delete_params.rbs +15 -0
  238. data/sig/whop_sdk/models/promo_code_delete_response.rbs +5 -0
  239. data/sig/whop_sdk/models/promo_code_list_params.rbs +61 -0
  240. data/sig/whop_sdk/models/promo_code_list_response.rbs +117 -0
  241. data/sig/whop_sdk/models/promo_code_retrieve_params.rbs +15 -0
  242. data/sig/whop_sdk/models/promo_code_status.rbs +15 -0
  243. data/sig/whop_sdk/models/promo_duration.rbs +15 -0
  244. data/sig/whop_sdk/models/review_list_params.rbs +56 -0
  245. data/sig/whop_sdk/models/review_list_response.rbs +116 -0
  246. data/sig/whop_sdk/models/review_retrieve_params.rbs +15 -0
  247. data/sig/whop_sdk/models/review_retrieve_response.rbs +152 -0
  248. data/sig/whop_sdk/models/review_status.rbs +15 -0
  249. data/sig/whop_sdk/models.rbs +76 -0
  250. data/sig/whop_sdk/resources/course_chapters.rbs +35 -0
  251. data/sig/whop_sdk/resources/course_lessons.rbs +47 -0
  252. data/sig/whop_sdk/resources/courses.rbs +47 -0
  253. data/sig/whop_sdk/resources/experiences.rbs +6 -0
  254. data/sig/whop_sdk/resources/forum_posts.rbs +9 -0
  255. data/sig/whop_sdk/resources/members.rbs +1 -0
  256. data/sig/whop_sdk/resources/memberships.rbs +2 -1
  257. data/sig/whop_sdk/resources/messages.rbs +8 -0
  258. data/sig/whop_sdk/resources/payments.rbs +1 -1
  259. data/sig/whop_sdk/resources/plans.rbs +8 -0
  260. data/sig/whop_sdk/resources/products.rbs +1 -2
  261. data/sig/whop_sdk/resources/promo_codes.rbs +45 -0
  262. data/sig/whop_sdk/resources/reviews.rbs +23 -0
  263. metadata +189 -2
@@ -28,16 +28,16 @@ module WhopSDK
28
28
  required :billing_address, -> { WhopSDK::Payment::BillingAddress }, nil?: true
29
29
 
30
30
  # @!attribute billing_reason
31
- # The billing reason
31
+ # The reason why a specific payment was billed
32
32
  #
33
- # @return [String, nil]
34
- required :billing_reason, String, nil?: true
33
+ # @return [Symbol, WhopSDK::Models::BillingReasons, nil]
34
+ required :billing_reason, enum: -> { WhopSDK::BillingReasons }, nil?: true
35
35
 
36
36
  # @!attribute card_brand
37
- # The type of card used as the payment method.
37
+ # Possible card brands that a payment token can have
38
38
  #
39
- # @return [String, nil]
40
- required :card_brand, String, nil?: true
39
+ # @return [Symbol, WhopSDK::Models::CardBrands, nil]
40
+ required :card_brand, enum: -> { WhopSDK::CardBrands }, nil?: true
41
41
 
42
42
  # @!attribute card_last4
43
43
  # The last 4 digits of the card used to make the payment.
@@ -100,11 +100,10 @@ module WhopSDK
100
100
  required :paid_at, Time, nil?: true
101
101
 
102
102
  # @!attribute payment_method_type
103
- # Returns the type of payment method used for the payment, if available. Ex.
104
- # klarna, affirm, card, cashapp
103
+ # The different types of payment methods that can be used.
105
104
  #
106
- # @return [String, nil]
107
- required :payment_method_type, String, nil?: true
105
+ # @return [Symbol, WhopSDK::Models::PaymentMethodTypes, nil]
106
+ required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }, nil?: true
108
107
 
109
108
  # @!attribute plan
110
109
  # The plan attached to this payment.
@@ -125,7 +124,8 @@ module WhopSDK
125
124
  required :promo_code, -> { WhopSDK::Payment::PromoCode }, nil?: true
126
125
 
127
126
  # @!attribute refundable
128
- # Whether the payment can be refunded.
127
+ # True only for payments that are `paid`, have not been fully refunded, and were
128
+ # processed by a payment processor that allows refunds.
129
129
  #
130
130
  # @return [Boolean]
131
131
  required :refundable, WhopSDK::Internal::Type::Boolean
@@ -143,7 +143,9 @@ module WhopSDK
143
143
  required :refunded_at, Time, nil?: true
144
144
 
145
145
  # @!attribute retryable
146
- # Whether the payment can be retried.
146
+ # True when the payment status is `open` and its membership is in one of the
147
+ # retry-eligible states (`active`, `trialing`, `completed`, or `past_due`);
148
+ # otherwise false. Used to decide if Whop can attempt the charge again.
147
149
  #
148
150
  # @return [Boolean]
149
151
  required :retryable, WhopSDK::Internal::Type::Boolean
@@ -185,7 +187,8 @@ module WhopSDK
185
187
  required :user, -> { WhopSDK::Payment::User }, nil?: true
186
188
 
187
189
  # @!attribute voidable
188
- # Whether the payment can be voided.
190
+ # True when the payment is tied to a membership in `past_due`, the payment status
191
+ # is `open`, and the processor allows voiding payments; otherwise false.
189
192
  #
190
193
  # @return [Boolean]
191
194
  required :voidable, WhopSDK::Internal::Type::Boolean
@@ -204,9 +207,9 @@ module WhopSDK
204
207
  #
205
208
  # @param billing_address [WhopSDK::Models::Payment::BillingAddress, nil] The address of the user who made the payment.
206
209
  #
207
- # @param billing_reason [String, nil] The billing reason
210
+ # @param billing_reason [Symbol, WhopSDK::Models::BillingReasons, nil] The reason why a specific payment was billed
208
211
  #
209
- # @param card_brand [String, nil] The type of card used as the payment method.
212
+ # @param card_brand [Symbol, WhopSDK::Models::CardBrands, nil] Possible card brands that a payment token can have
210
213
  #
211
214
  # @param card_last4 [String, nil] The last 4 digits of the card used to make the payment.
212
215
  #
@@ -228,7 +231,7 @@ module WhopSDK
228
231
  #
229
232
  # @param paid_at [Time, nil] The datetime the payment was paid
230
233
  #
231
- # @param payment_method_type [String, nil] Returns the type of payment method used for the payment, if available. Ex. klarn
234
+ # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes, nil] The different types of payment methods that can be used.
232
235
  #
233
236
  # @param plan [WhopSDK::Models::Payment::Plan, nil] The plan attached to this payment.
234
237
  #
@@ -236,13 +239,13 @@ module WhopSDK
236
239
  #
237
240
  # @param promo_code [WhopSDK::Models::Payment::PromoCode, nil] The promo code used for this payment.
238
241
  #
239
- # @param refundable [Boolean] Whether the payment can be refunded.
242
+ # @param refundable [Boolean] True only for payments that are `paid`, have not been fully refunded, and were p
240
243
  #
241
244
  # @param refunded_amount [Float, nil] The payment refund amount(if applicable).
242
245
  #
243
246
  # @param refunded_at [Time, nil] When the payment was refunded (if applicable).
244
247
  #
245
- # @param retryable [Boolean] Whether the payment can be retried.
248
+ # @param retryable [Boolean] True when the payment status is `open` and its membership is in one of the retry
246
249
  #
247
250
  # @param status [Symbol, WhopSDK::Models::ReceiptStatus, nil] The status of a receipt
248
251
  #
@@ -256,7 +259,7 @@ module WhopSDK
256
259
  #
257
260
  # @param user [WhopSDK::Models::Payment::User, nil] The user that made this payment.
258
261
  #
259
- # @param voidable [Boolean] Whether the payment can be voided.
262
+ # @param voidable [Boolean] True when the payment is tied to a membership in `past_due`, the payment status
260
263
 
261
264
  # @see WhopSDK::Models::Payment#billing_address
262
265
  class BillingAddress < WhopSDK::Internal::Type::BaseModel
@@ -465,7 +468,7 @@ module WhopSDK
465
468
  required :code, String, nil?: true
466
469
 
467
470
  # @!attribute number_of_intervals
468
- # The number of billing cycles the promo is applied for.
471
+ # The number of months the promo is applied for.
469
472
  #
470
473
  # @return [Integer, nil]
471
474
  required :number_of_intervals, Integer, nil?: true
@@ -487,7 +490,7 @@ module WhopSDK
487
490
  #
488
491
  # @param code [String, nil] The specific code used to apply the promo at checkout.
489
492
  #
490
- # @param number_of_intervals [Integer, nil] The number of billing cycles the promo is applied for.
493
+ # @param number_of_intervals [Integer, nil] The number of months the promo is applied for.
491
494
  #
492
495
  # @param promo_type [Symbol, WhopSDK::Models::PromoType] The type (% or flat amount) of the promo.
493
496
  end
@@ -28,9 +28,9 @@ module WhopSDK
28
28
  # @!attribute billing_reasons
29
29
  # The billing reason for the payment
30
30
  #
31
- # @return [Array<Symbol, WhopSDK::Models::PaymentListParams::BillingReason>, nil]
31
+ # @return [Array<Symbol, WhopSDK::Models::BillingReasons>, nil]
32
32
  optional :billing_reasons,
33
- -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::PaymentListParams::BillingReason] },
33
+ -> { WhopSDK::Internal::Type::ArrayOf[enum: WhopSDK::BillingReasons] },
34
34
  nil?: true
35
35
 
36
36
  # @!attribute created_after
@@ -114,7 +114,7 @@ module WhopSDK
114
114
  #
115
115
  # @param before [String, nil] Returns the elements in the list that come before the specified cursor.
116
116
  #
117
- # @param billing_reasons [Array<Symbol, WhopSDK::Models::PaymentListParams::BillingReason>, nil] The billing reason for the payment
117
+ # @param billing_reasons [Array<Symbol, WhopSDK::Models::BillingReasons>, nil] The billing reason for the payment
118
118
  #
119
119
  # @param created_after [Time, nil] The minimum creation date to filter by
120
120
  #
@@ -142,21 +142,6 @@ module WhopSDK
142
142
  #
143
143
  # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
144
144
 
145
- # The reason why a specific payment was billed
146
- module BillingReason
147
- extend WhopSDK::Internal::Type::Enum
148
-
149
- SUBSCRIPTION_CREATE = :subscription_create
150
- SUBSCRIPTION_CYCLE = :subscription_cycle
151
- SUBSCRIPTION_UPDATE = :subscription_update
152
- ONE_TIME = :one_time
153
- MANUAL = :manual
154
- SUBSCRIPTION = :subscription
155
-
156
- # @!method self.values
157
- # @return [Array<Symbol>]
158
- end
159
-
160
145
  # The order to sort the results by.
161
146
  module Order
162
147
  extend WhopSDK::Internal::Type::Enum
@@ -29,16 +29,16 @@ module WhopSDK
29
29
  required :billing_address, -> { WhopSDK::Models::PaymentListResponse::BillingAddress }, nil?: true
30
30
 
31
31
  # @!attribute billing_reason
32
- # The billing reason
32
+ # The reason why a specific payment was billed
33
33
  #
34
- # @return [String, nil]
35
- required :billing_reason, String, nil?: true
34
+ # @return [Symbol, WhopSDK::Models::BillingReasons, nil]
35
+ required :billing_reason, enum: -> { WhopSDK::BillingReasons }, nil?: true
36
36
 
37
37
  # @!attribute card_brand
38
- # The type of card used as the payment method.
38
+ # Possible card brands that a payment token can have
39
39
  #
40
- # @return [String, nil]
41
- required :card_brand, String, nil?: true
40
+ # @return [Symbol, WhopSDK::Models::CardBrands, nil]
41
+ required :card_brand, enum: -> { WhopSDK::CardBrands }, nil?: true
42
42
 
43
43
  # @!attribute card_last4
44
44
  # The last 4 digits of the card used to make the payment.
@@ -101,11 +101,10 @@ module WhopSDK
101
101
  required :paid_at, Time, nil?: true
102
102
 
103
103
  # @!attribute payment_method_type
104
- # Returns the type of payment method used for the payment, if available. Ex.
105
- # klarna, affirm, card, cashapp
104
+ # The different types of payment methods that can be used.
106
105
  #
107
- # @return [String, nil]
108
- required :payment_method_type, String, nil?: true
106
+ # @return [Symbol, WhopSDK::Models::PaymentMethodTypes, nil]
107
+ required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }, nil?: true
109
108
 
110
109
  # @!attribute plan
111
110
  # The plan attached to this payment.
@@ -126,7 +125,8 @@ module WhopSDK
126
125
  required :promo_code, -> { WhopSDK::Models::PaymentListResponse::PromoCode }, nil?: true
127
126
 
128
127
  # @!attribute refundable
129
- # Whether the payment can be refunded.
128
+ # True only for payments that are `paid`, have not been fully refunded, and were
129
+ # processed by a payment processor that allows refunds.
130
130
  #
131
131
  # @return [Boolean]
132
132
  required :refundable, WhopSDK::Internal::Type::Boolean
@@ -144,7 +144,9 @@ module WhopSDK
144
144
  required :refunded_at, Time, nil?: true
145
145
 
146
146
  # @!attribute retryable
147
- # Whether the payment can be retried.
147
+ # True when the payment status is `open` and its membership is in one of the
148
+ # retry-eligible states (`active`, `trialing`, `completed`, or `past_due`);
149
+ # otherwise false. Used to decide if Whop can attempt the charge again.
148
150
  #
149
151
  # @return [Boolean]
150
152
  required :retryable, WhopSDK::Internal::Type::Boolean
@@ -186,7 +188,8 @@ module WhopSDK
186
188
  required :user, -> { WhopSDK::Models::PaymentListResponse::User }, nil?: true
187
189
 
188
190
  # @!attribute voidable
189
- # Whether the payment can be voided.
191
+ # True when the payment is tied to a membership in `past_due`, the payment status
192
+ # is `open`, and the processor allows voiding payments; otherwise false.
190
193
  #
191
194
  # @return [Boolean]
192
195
  required :voidable, WhopSDK::Internal::Type::Boolean
@@ -205,9 +208,9 @@ module WhopSDK
205
208
  #
206
209
  # @param billing_address [WhopSDK::Models::PaymentListResponse::BillingAddress, nil] The address of the user who made the payment.
207
210
  #
208
- # @param billing_reason [String, nil] The billing reason
211
+ # @param billing_reason [Symbol, WhopSDK::Models::BillingReasons, nil] The reason why a specific payment was billed
209
212
  #
210
- # @param card_brand [String, nil] The type of card used as the payment method.
213
+ # @param card_brand [Symbol, WhopSDK::Models::CardBrands, nil] Possible card brands that a payment token can have
211
214
  #
212
215
  # @param card_last4 [String, nil] The last 4 digits of the card used to make the payment.
213
216
  #
@@ -229,7 +232,7 @@ module WhopSDK
229
232
  #
230
233
  # @param paid_at [Time, nil] The datetime the payment was paid
231
234
  #
232
- # @param payment_method_type [String, nil] Returns the type of payment method used for the payment, if available. Ex. klarn
235
+ # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes, nil] The different types of payment methods that can be used.
233
236
  #
234
237
  # @param plan [WhopSDK::Models::PaymentListResponse::Plan, nil] The plan attached to this payment.
235
238
  #
@@ -237,13 +240,13 @@ module WhopSDK
237
240
  #
238
241
  # @param promo_code [WhopSDK::Models::PaymentListResponse::PromoCode, nil] The promo code used for this payment.
239
242
  #
240
- # @param refundable [Boolean] Whether the payment can be refunded.
243
+ # @param refundable [Boolean] True only for payments that are `paid`, have not been fully refunded, and were p
241
244
  #
242
245
  # @param refunded_amount [Float, nil] The payment refund amount(if applicable).
243
246
  #
244
247
  # @param refunded_at [Time, nil] When the payment was refunded (if applicable).
245
248
  #
246
- # @param retryable [Boolean] Whether the payment can be retried.
249
+ # @param retryable [Boolean] True when the payment status is `open` and its membership is in one of the retry
247
250
  #
248
251
  # @param status [Symbol, WhopSDK::Models::ReceiptStatus, nil] The status of a receipt
249
252
  #
@@ -257,7 +260,7 @@ module WhopSDK
257
260
  #
258
261
  # @param user [WhopSDK::Models::PaymentListResponse::User, nil] The user that made this payment.
259
262
  #
260
- # @param voidable [Boolean] Whether the payment can be voided.
263
+ # @param voidable [Boolean] True when the payment is tied to a membership in `past_due`, the payment status
261
264
 
262
265
  # @see WhopSDK::Models::PaymentListResponse#billing_address
263
266
  class BillingAddress < WhopSDK::Internal::Type::BaseModel
@@ -466,7 +469,7 @@ module WhopSDK
466
469
  required :code, String, nil?: true
467
470
 
468
471
  # @!attribute number_of_intervals
469
- # The number of billing cycles the promo is applied for.
472
+ # The number of months the promo is applied for.
470
473
  #
471
474
  # @return [Integer, nil]
472
475
  required :number_of_intervals, Integer, nil?: true
@@ -488,7 +491,7 @@ module WhopSDK
488
491
  #
489
492
  # @param code [String, nil] The specific code used to apply the promo at checkout.
490
493
  #
491
- # @param number_of_intervals [Integer, nil] The number of billing cycles the promo is applied for.
494
+ # @param number_of_intervals [Integer, nil] The number of months the promo is applied for.
492
495
  #
493
496
  # @param promo_type [Symbol, WhopSDK::Models::PromoType] The type (% or flat amount) of the promo.
494
497
  end
@@ -0,0 +1,98 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # The different types of payment methods that can be used.
6
+ module PaymentMethodTypes
7
+ extend WhopSDK::Internal::Type::Enum
8
+
9
+ ACSS_DEBIT = :acss_debit
10
+ AFFIRM = :affirm
11
+ AFTERPAY_CLEARPAY = :afterpay_clearpay
12
+ ALIPAY = :alipay
13
+ ALMA = :alma
14
+ AMAZON_PAY = :amazon_pay
15
+ APPLE_PAY = :apple_pay
16
+ AU_BECS_DEBIT = :au_becs_debit
17
+ BACS_DEBIT = :bacs_debit
18
+ BANCONTACT = :bancontact
19
+ BILLIE = :billie
20
+ BLIK = :blik
21
+ BOLETO = :boleto
22
+ CARD = :card
23
+ CASHAPP = :cashapp
24
+ CRYPTO = :crypto
25
+ EPS = :eps
26
+ FPX = :fpx
27
+ GIROPAY = :giropay
28
+ GOOGLE_PAY = :google_pay
29
+ GRABPAY = :grabpay
30
+ IDEAL = :ideal
31
+ KAKAO_PAY = :kakao_pay
32
+ KLARNA = :klarna
33
+ KONBINI = :konbini
34
+ KR_CARD = :kr_card
35
+ LINK = :link
36
+ MOBILEPAY = :mobilepay
37
+ MULTIBANCO = :multibanco
38
+ NAVER_PAY = :naver_pay
39
+ NZ_BANK_ACCOUNT = :nz_bank_account
40
+ OXXO = :oxxo
41
+ P24 = :p24
42
+ PAY_BY_BANK = :pay_by_bank
43
+ PAYCO = :payco
44
+ PAYNOW = :paynow
45
+ PIX = :pix
46
+ PROMPTPAY = :promptpay
47
+ REVOLUT_PAY = :revolut_pay
48
+ SAMSUNG_PAY = :samsung_pay
49
+ SATISPAY = :satispay
50
+ SEPA_DEBIT = :sepa_debit
51
+ SOFORT = :sofort
52
+ SWISH = :swish
53
+ TWINT = :twint
54
+ US_BANK_ACCOUNT = :us_bank_account
55
+ WECHAT_PAY = :wechat_pay
56
+ ZIP = :zip
57
+ BIZUM = :bizum
58
+ CAPCHASE_PAY = :capchase_pay
59
+ KRIYA = :kriya
60
+ MONDU = :mondu
61
+ NG_WALLET = :ng_wallet
62
+ PAYPAY = :paypay
63
+ SEQURA = :sequra
64
+ SCALAPAY = :scalapay
65
+ VIPPS = :vipps
66
+ CUSTOM = :custom
67
+ CUSTOMER_BALANCE = :customer_balance
68
+ GOPAY = :gopay
69
+ MB_WAY = :mb_way
70
+ NG_BANK = :ng_bank
71
+ NG_BANK_TRANSFER = :ng_bank_transfer
72
+ NG_CARD = :ng_card
73
+ NG_MARKET = :ng_market
74
+ NG_USSD = :ng_ussd
75
+ PAYPAL = :paypal
76
+ PAYTO = :payto
77
+ QRIS = :qris
78
+ RECHNUNG = :rechnung
79
+ SOUTH_KOREA_MARKET = :south_korea_market
80
+ KR_MARKET = :kr_market
81
+ SHOPEEPAY = :shopeepay
82
+ UPI = :upi
83
+ SUNBIT = :sunbit
84
+ NETBANKING = :netbanking
85
+ ID_BANK_TRANSFER = :id_bank_transfer
86
+ DEMO_PAY = :demo_pay
87
+ SHOP_PAY = :shop_pay
88
+ APPLE = :apple
89
+ SEZZLE = :sezzle
90
+ COINBASE = :coinbase
91
+ SPLITIT = :splitit
92
+ UNKNOWN = :unknown
93
+
94
+ # @!method self.values
95
+ # @return [Array<Symbol>]
96
+ end
97
+ end
98
+ end
@@ -111,18 +111,36 @@ module WhopSDK
111
111
  # @return [Float]
112
112
  required :renewal_price, Float
113
113
 
114
+ # @!attribute stock
115
+ # The number of units available for purchase. Only displayed to authorized actors
116
+ #
117
+ # @return [Integer, nil]
118
+ required :stock, Integer, nil?: true
119
+
114
120
  # @!attribute tax_type
115
121
  # The tax type for the plan.
116
122
  #
117
123
  # @return [Symbol, WhopSDK::Models::TaxType]
118
124
  required :tax_type, enum: -> { WhopSDK::TaxType }
119
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
+ required :title, String, nil?: true
131
+
120
132
  # @!attribute trial_period_days
121
133
  # The number of free trial days added before a renewal plan.
122
134
  #
123
135
  # @return [Integer, nil]
124
136
  required :trial_period_days, Integer, nil?: true
125
137
 
138
+ # @!attribute unlimited_stock
139
+ # Limits/doesn't limit the number of units available for purchase.
140
+ #
141
+ # @return [Boolean]
142
+ required :unlimited_stock, WhopSDK::Internal::Type::Boolean
143
+
126
144
  # @!attribute updated_at
127
145
  # When the plan was last updated.
128
146
  #
@@ -135,7 +153,7 @@ module WhopSDK
135
153
  # @return [Symbol, WhopSDK::Models::Visibility]
136
154
  required :visibility, enum: -> { WhopSDK::Visibility }
137
155
 
138
- # @!method initialize(id:, billing_period:, collect_tax:, company:, created_at:, currency:, custom_fields:, description:, expiration_days:, initial_price:, internal_notes:, invoice:, member_count:, plan_type:, product:, purchase_url:, release_method:, renewal_price:, tax_type:, trial_period_days:, updated_at:, visibility:)
156
+ # @!method initialize(id:, billing_period:, collect_tax:, company:, created_at:, currency:, custom_fields:, description:, expiration_days:, initial_price:, internal_notes:, invoice:, member_count:, plan_type:, product:, purchase_url:, release_method:, renewal_price:, stock:, tax_type:, title:, trial_period_days:, unlimited_stock:, updated_at:, visibility:)
139
157
  # An object representing a (sanitized) plan of an access pass.
140
158
  #
141
159
  # @param id [String] The internal ID of the plan.
@@ -174,10 +192,16 @@ module WhopSDK
174
192
  #
175
193
  # @param renewal_price [Float] The price a person has to pay for a plan on the renewal purchase.
176
194
  #
195
+ # @param stock [Integer, nil] The number of units available for purchase. Only displayed to authorized actors
196
+ #
177
197
  # @param tax_type [Symbol, WhopSDK::Models::TaxType] The tax type for the plan.
178
198
  #
199
+ # @param title [String, nil] The title of the plan. This will be visible on the product page to customers.
200
+ #
179
201
  # @param trial_period_days [Integer, nil] The number of free trial days added before a renewal plan.
180
202
  #
203
+ # @param unlimited_stock [Boolean] Limits/doesn't limit the number of units available for purchase.
204
+ #
181
205
  # @param updated_at [Time] When the plan was last updated.
182
206
  #
183
207
  # @param visibility [Symbol, WhopSDK::Models::Visibility] Shows or hides the plan from public/business view.
@@ -20,7 +20,7 @@ module WhopSDK
20
20
  required :product_id, String
21
21
 
22
22
  # @!attribute billing_period
23
- # The interval at which the plan charges (renewal plans).
23
+ # The interval in days at which the plan charges (renewal plans).
24
24
  #
25
25
  # @return [Integer, nil]
26
26
  optional :billing_period, Integer, nil?: true
@@ -97,6 +97,26 @@ module WhopSDK
97
97
  # @return [Float, nil]
98
98
  optional :renewal_price, Float, nil?: true
99
99
 
100
+ # @!attribute stock
101
+ # The number of units available for purchase.
102
+ #
103
+ # @return [Integer, nil]
104
+ optional :stock, Integer, nil?: true
105
+
106
+ # @!attribute strike_through_initial_price
107
+ # The price to display with a strikethrough for the initial price. Provided as a
108
+ # number in dollars. Eg: 19.99 for $19.99
109
+ #
110
+ # @return [Float, nil]
111
+ optional :strike_through_initial_price, Float, nil?: true
112
+
113
+ # @!attribute strike_through_renewal_price
114
+ # The price to display with a strikethrough for the renewal price. Provided as a
115
+ # number in dollars. Eg: 19.99 for $19.99
116
+ #
117
+ # @return [Float, nil]
118
+ optional :strike_through_renewal_price, Float, nil?: true
119
+
100
120
  # @!attribute title
101
121
  # The title of the plan. This will be visible on the product page to customers.
102
122
  #
@@ -109,13 +129,19 @@ module WhopSDK
109
129
  # @return [Integer, nil]
110
130
  optional :trial_period_days, Integer, nil?: true
111
131
 
132
+ # @!attribute unlimited_stock
133
+ # Limits/doesn't limit the number of units available for purchase.
134
+ #
135
+ # @return [Boolean, nil]
136
+ optional :unlimited_stock, WhopSDK::Internal::Type::Boolean, nil?: true
137
+
112
138
  # @!attribute visibility
113
139
  # Visibility of a resource
114
140
  #
115
141
  # @return [Symbol, WhopSDK::Models::Visibility, nil]
116
142
  optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true
117
143
 
118
- # @!method initialize(company_id:, product_id:, billing_period: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, override_tax_type: nil, plan_type: nil, release_method: nil, renewal_price: nil, title: nil, trial_period_days: nil, visibility: nil, request_options: {})
144
+ # @!method initialize(company_id:, product_id:, billing_period: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, override_tax_type: nil, plan_type: nil, release_method: nil, renewal_price: nil, stock: nil, strike_through_initial_price: nil, strike_through_renewal_price: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil, request_options: {})
119
145
  # Some parameter documentations has been truncated, see
120
146
  # {WhopSDK::Models::PlanCreateParams} for more details.
121
147
  #
@@ -123,7 +149,7 @@ module WhopSDK
123
149
  #
124
150
  # @param product_id [String] The product the plan is related to.
125
151
  #
126
- # @param billing_period [Integer, nil] The interval at which the plan charges (renewal plans).
152
+ # @param billing_period [Integer, nil] The interval in days at which the plan charges (renewal plans).
127
153
  #
128
154
  # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform
129
155
  #
@@ -147,10 +173,18 @@ module WhopSDK
147
173
  #
148
174
  # @param renewal_price [Float, nil] The amount the customer is charged every billing period. Use only if a recurring
149
175
  #
176
+ # @param stock [Integer, nil] The number of units available for purchase.
177
+ #
178
+ # @param strike_through_initial_price [Float, nil] The price to display with a strikethrough for the initial price. Provided as a n
179
+ #
180
+ # @param strike_through_renewal_price [Float, nil] The price to display with a strikethrough for the renewal price. Provided as a n
181
+ #
150
182
  # @param title [String, nil] The title of the plan. This will be visible on the product page to customers.
151
183
  #
152
184
  # @param trial_period_days [Integer, nil] The number of free trial days added before a renewal plan.
153
185
  #
186
+ # @param unlimited_stock [Boolean, nil] Limits/doesn't limit the number of units available for purchase.
187
+ #
154
188
  # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource
155
189
  #
156
190
  # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
@@ -100,12 +100,30 @@ module WhopSDK
100
100
  # @return [Float]
101
101
  required :renewal_price, Float
102
102
 
103
+ # @!attribute stock
104
+ # The number of units available for purchase. Only displayed to authorized actors
105
+ #
106
+ # @return [Integer, nil]
107
+ required :stock, Integer, nil?: true
108
+
109
+ # @!attribute title
110
+ # The title of the plan. This will be visible on the product page to customers.
111
+ #
112
+ # @return [String, nil]
113
+ required :title, String, nil?: true
114
+
103
115
  # @!attribute trial_period_days
104
116
  # The number of free trial days added before a renewal plan.
105
117
  #
106
118
  # @return [Integer, nil]
107
119
  required :trial_period_days, Integer, nil?: true
108
120
 
121
+ # @!attribute unlimited_stock
122
+ # Limits/doesn't limit the number of units available for purchase.
123
+ #
124
+ # @return [Boolean]
125
+ required :unlimited_stock, WhopSDK::Internal::Type::Boolean
126
+
109
127
  # @!attribute updated_at
110
128
  # When the plan was last updated.
111
129
  #
@@ -118,7 +136,7 @@ module WhopSDK
118
136
  # @return [Symbol, WhopSDK::Models::Visibility]
119
137
  required :visibility, enum: -> { WhopSDK::Visibility }
120
138
 
121
- # @!method initialize(id:, billing_period:, company:, created_at:, currency:, description:, expiration_days:, initial_price:, internal_notes:, invoice:, member_count:, plan_type:, product:, purchase_url:, release_method:, renewal_price:, trial_period_days:, updated_at:, visibility:)
139
+ # @!method initialize(id:, billing_period:, company:, created_at:, currency:, description:, expiration_days:, initial_price:, internal_notes:, invoice:, member_count:, plan_type:, product:, purchase_url:, release_method:, renewal_price:, stock:, title:, trial_period_days:, unlimited_stock:, updated_at:, visibility:)
122
140
  # An object representing a (sanitized) plan of an access pass.
123
141
  #
124
142
  # @param id [String] The internal ID of the plan.
@@ -153,8 +171,14 @@ module WhopSDK
153
171
  #
154
172
  # @param renewal_price [Float] The price a person has to pay for a plan on the renewal purchase.
155
173
  #
174
+ # @param stock [Integer, nil] The number of units available for purchase. Only displayed to authorized actors
175
+ #
176
+ # @param title [String, nil] The title of the plan. This will be visible on the product page to customers.
177
+ #
156
178
  # @param trial_period_days [Integer, nil] The number of free trial days added before a renewal plan.
157
179
  #
180
+ # @param unlimited_stock [Boolean] Limits/doesn't limit the number of units available for purchase.
181
+ #
158
182
  # @param updated_at [Time] When the plan was last updated.
159
183
  #
160
184
  # @param visibility [Symbol, WhopSDK::Models::Visibility] Shows or hides the plan from public/business view.
@@ -76,6 +76,26 @@ module WhopSDK
76
76
  # @return [Float, nil]
77
77
  optional :renewal_price, Float, nil?: true
78
78
 
79
+ # @!attribute stock
80
+ # The number of units available for purchase.
81
+ #
82
+ # @return [Integer, nil]
83
+ optional :stock, Integer, nil?: true
84
+
85
+ # @!attribute strike_through_initial_price
86
+ # The price to display with a strikethrough for the initial price. Provided as a
87
+ # number in dollars. Eg: 19.99 for $19.99
88
+ #
89
+ # @return [Float, nil]
90
+ optional :strike_through_initial_price, Float, nil?: true
91
+
92
+ # @!attribute strike_through_renewal_price
93
+ # The price to display with a strikethrough for the renewal price. Provided as a
94
+ # number in dollars. Eg: 19.99 for $19.99
95
+ #
96
+ # @return [Float, nil]
97
+ optional :strike_through_renewal_price, Float, nil?: true
98
+
79
99
  # @!attribute title
80
100
  # The title of the plan. This will be visible on the product page to customers.
81
101
  #
@@ -88,13 +108,19 @@ module WhopSDK
88
108
  # @return [Integer, nil]
89
109
  optional :trial_period_days, Integer, nil?: true
90
110
 
111
+ # @!attribute unlimited_stock
112
+ # Limits/doesn't limit the number of units available for purchase.
113
+ #
114
+ # @return [Boolean, nil]
115
+ optional :unlimited_stock, WhopSDK::Internal::Type::Boolean, nil?: true
116
+
91
117
  # @!attribute visibility
92
118
  # Visibility of a resource
93
119
  #
94
120
  # @return [Symbol, WhopSDK::Models::Visibility, nil]
95
121
  optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true
96
122
 
97
- # @!method initialize(billing_period: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, offer_cancel_discount: nil, override_tax_type: nil, renewal_price: nil, title: nil, trial_period_days: nil, visibility: nil, request_options: {})
123
+ # @!method initialize(billing_period: nil, currency: nil, custom_fields: nil, description: nil, expiration_days: nil, image: nil, initial_price: nil, internal_notes: nil, offer_cancel_discount: nil, override_tax_type: nil, renewal_price: nil, stock: nil, strike_through_initial_price: nil, strike_through_renewal_price: nil, title: nil, trial_period_days: nil, unlimited_stock: nil, visibility: nil, request_options: {})
98
124
  # Some parameter documentations has been truncated, see
99
125
  # {WhopSDK::Models::PlanUpdateParams} for more details.
100
126
  #
@@ -120,10 +146,18 @@ module WhopSDK
120
146
  #
121
147
  # @param renewal_price [Float, nil] The amount the customer is charged every billing period.
122
148
  #
149
+ # @param stock [Integer, nil] The number of units available for purchase.
150
+ #
151
+ # @param strike_through_initial_price [Float, nil] The price to display with a strikethrough for the initial price. Provided as a n
152
+ #
153
+ # @param strike_through_renewal_price [Float, nil] The price to display with a strikethrough for the renewal price. Provided as a n
154
+ #
123
155
  # @param title [String, nil] The title of the plan. This will be visible on the product page to customers.
124
156
  #
125
157
  # @param trial_period_days [Integer, nil] The number of free trial days added before a renewal plan.
126
158
  #
159
+ # @param unlimited_stock [Boolean, nil] Limits/doesn't limit the number of units available for purchase.
160
+ #
127
161
  # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource
128
162
  #
129
163
  # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]