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
@@ -0,0 +1,307 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::Payments#create
6
+ class PaymentCreateParams < WhopSDK::Internal::Type::BaseModel
7
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
8
+ include WhopSDK::Internal::Type::RequestParameters
9
+
10
+ # @!attribute company_id
11
+ # The ID of the company to create the payment for.
12
+ #
13
+ # @return [String]
14
+ required :company_id, String
15
+
16
+ # @!attribute member_id
17
+ # The ID of the member to create the payment for.
18
+ #
19
+ # @return [String]
20
+ required :member_id, String
21
+
22
+ # @!attribute payment_token_id
23
+ # The ID of the payment token to use for the payment. It must be connected to the
24
+ # Member being charged.
25
+ #
26
+ # @return [String]
27
+ required :payment_token_id, String
28
+
29
+ # @!attribute plan
30
+ # Pass this object to create a new plan for this payment
31
+ #
32
+ # @return [WhopSDK::Models::PaymentCreateParams::Plan]
33
+ required :plan, -> { WhopSDK::PaymentCreateParams::Plan }
34
+
35
+ # @!attribute plan_id
36
+ # An ID of an existing plan to use for the payment.
37
+ #
38
+ # @return [String]
39
+ required :plan_id, String
40
+
41
+ # @!method initialize(company_id:, member_id:, payment_token_id:, plan:, plan_id:, request_options: {})
42
+ # Some parameter documentations has been truncated, see
43
+ # {WhopSDK::Models::PaymentCreateParams} for more details.
44
+ #
45
+ # @param company_id [String] The ID of the company to create the payment for.
46
+ #
47
+ # @param member_id [String] The ID of the member to create the payment for.
48
+ #
49
+ # @param payment_token_id [String] The ID of the payment token to use for the payment. It must be connected to the
50
+ #
51
+ # @param plan [WhopSDK::Models::PaymentCreateParams::Plan] Pass this object to create a new plan for this payment
52
+ #
53
+ # @param plan_id [String] An ID of an existing plan to use for the payment.
54
+ #
55
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
56
+
57
+ class Plan < WhopSDK::Internal::Type::BaseModel
58
+ # @!attribute currency
59
+ # The respective currency identifier for the plan.
60
+ #
61
+ # @return [Symbol, WhopSDK::Models::Currency]
62
+ required :currency, enum: -> { WhopSDK::Currency }
63
+
64
+ # @!attribute billing_period
65
+ # The interval at which the plan charges (renewal plans).
66
+ #
67
+ # @return [Integer, nil]
68
+ optional :billing_period, Integer, nil?: true
69
+
70
+ # @!attribute description
71
+ # The description of the plan.
72
+ #
73
+ # @return [String, nil]
74
+ optional :description, String, nil?: true
75
+
76
+ # @!attribute expiration_days
77
+ # The interval at which the plan charges (expiration plans).
78
+ #
79
+ # @return [Integer, nil]
80
+ optional :expiration_days, Integer, nil?: true
81
+
82
+ # @!attribute force_create_new_plan
83
+ # Whether to force the creation of a new plan even if one with the same attributes
84
+ # already exists.
85
+ #
86
+ # @return [Boolean, nil]
87
+ optional :force_create_new_plan, WhopSDK::Internal::Type::Boolean, nil?: true
88
+
89
+ # @!attribute initial_price
90
+ # An additional amount charged upon first purchase.
91
+ #
92
+ # @return [Float, nil]
93
+ optional :initial_price, Float, nil?: true
94
+
95
+ # @!attribute internal_notes
96
+ # A personal description or notes section for the business.
97
+ #
98
+ # @return [String, nil]
99
+ optional :internal_notes, String, nil?: true
100
+
101
+ # @!attribute plan_type
102
+ # The type of plan that can be attached to a product
103
+ #
104
+ # @return [Symbol, WhopSDK::Models::PlanType, nil]
105
+ optional :plan_type, enum: -> { WhopSDK::PlanType }, nil?: true
106
+
107
+ # @!attribute product
108
+ # Pass this object to create a new product for this plan. We will use the product
109
+ # external identifier to find or create an existing product.
110
+ #
111
+ # @return [WhopSDK::Models::PaymentCreateParams::Plan::Product, nil]
112
+ optional :product, -> { WhopSDK::PaymentCreateParams::Plan::Product }, nil?: true
113
+
114
+ # @!attribute product_id
115
+ # The product the plan is related to. Either this or product is required.
116
+ #
117
+ # @return [String, nil]
118
+ optional :product_id, String, nil?: true
119
+
120
+ # @!attribute renewal_price
121
+ # The amount the customer is charged every billing period.
122
+ #
123
+ # @return [Float, nil]
124
+ optional :renewal_price, Float, nil?: true
125
+
126
+ # @!attribute title
127
+ # The title of the plan. This will be visible on the product page to customers.
128
+ #
129
+ # @return [String, nil]
130
+ optional :title, String, nil?: true
131
+
132
+ # @!attribute trial_period_days
133
+ # The number of free trial days added before a renewal plan.
134
+ #
135
+ # @return [Integer, nil]
136
+ optional :trial_period_days, Integer, nil?: true
137
+
138
+ # @!attribute visibility
139
+ # Visibility of a resource
140
+ #
141
+ # @return [Symbol, WhopSDK::Models::Visibility, nil]
142
+ optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true
143
+
144
+ # @!method initialize(currency:, billing_period: nil, description: nil, expiration_days: nil, force_create_new_plan: nil, initial_price: nil, internal_notes: nil, plan_type: nil, product: nil, product_id: nil, renewal_price: nil, title: nil, trial_period_days: nil, visibility: nil)
145
+ # Some parameter documentations has been truncated, see
146
+ # {WhopSDK::Models::PaymentCreateParams::Plan} for more details.
147
+ #
148
+ # Pass this object to create a new plan for this payment
149
+ #
150
+ # @param currency [Symbol, WhopSDK::Models::Currency] The respective currency identifier for the plan.
151
+ #
152
+ # @param billing_period [Integer, nil] The interval at which the plan charges (renewal plans).
153
+ #
154
+ # @param description [String, nil] The description of the plan.
155
+ #
156
+ # @param expiration_days [Integer, nil] The interval at which the plan charges (expiration plans).
157
+ #
158
+ # @param force_create_new_plan [Boolean, nil] Whether to force the creation of a new plan even if one with the same attributes
159
+ #
160
+ # @param initial_price [Float, nil] An additional amount charged upon first purchase.
161
+ #
162
+ # @param internal_notes [String, nil] A personal description or notes section for the business.
163
+ #
164
+ # @param plan_type [Symbol, WhopSDK::Models::PlanType, nil] The type of plan that can be attached to a product
165
+ #
166
+ # @param product [WhopSDK::Models::PaymentCreateParams::Plan::Product, nil] Pass this object to create a new product for this plan. We will use the product
167
+ #
168
+ # @param product_id [String, nil] The product the plan is related to. Either this or product is required.
169
+ #
170
+ # @param renewal_price [Float, nil] The amount the customer is charged every billing period.
171
+ #
172
+ # @param title [String, nil] The title of the plan. This will be visible on the product page to customers.
173
+ #
174
+ # @param trial_period_days [Integer, nil] The number of free trial days added before a renewal plan.
175
+ #
176
+ # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource
177
+
178
+ # @see WhopSDK::Models::PaymentCreateParams::Plan#product
179
+ class Product < WhopSDK::Internal::Type::BaseModel
180
+ # @!attribute external_identifier
181
+ # A unique ID used to find or create a product. When provided during creation, we
182
+ # will look for an existing product with this external identifier — if found, it
183
+ # will be updated; otherwise, a new product will be created.
184
+ #
185
+ # @return [String]
186
+ required :external_identifier, String
187
+
188
+ # @!attribute title
189
+ # The title of the product.
190
+ #
191
+ # @return [String]
192
+ required :title, String
193
+
194
+ # @!attribute business_type
195
+ # The different business types a company can be.
196
+ #
197
+ # @return [Symbol, WhopSDK::Models::BusinessTypes, nil]
198
+ optional :business_type, enum: -> { WhopSDK::BusinessTypes }, nil?: true
199
+
200
+ # @!attribute collect_shipping_address
201
+ # Whether or not to collect shipping information at checkout from the customer.
202
+ #
203
+ # @return [Boolean, nil]
204
+ optional :collect_shipping_address, WhopSDK::Internal::Type::Boolean, nil?: true
205
+
206
+ # @!attribute custom_statement_descriptor
207
+ # The custom statement descriptor for the product i.e. WHOP\*SPORTS, must be
208
+ # between 5 and 22 characters, contain at least one letter, and not contain any of
209
+ # the following characters: <, >, \, ', "
210
+ #
211
+ # @return [String, nil]
212
+ optional :custom_statement_descriptor, String, nil?: true
213
+
214
+ # @!attribute description
215
+ # A written description of the product.
216
+ #
217
+ # @return [String, nil]
218
+ optional :description, String, nil?: true
219
+
220
+ # @!attribute global_affiliate_percentage
221
+ # The percentage of the revenue that goes to the global affiliate program.
222
+ #
223
+ # @return [Float, nil]
224
+ optional :global_affiliate_percentage, Float, nil?: true
225
+
226
+ # @!attribute global_affiliate_status
227
+ # The different statuses of the global affiliate program for a product.
228
+ #
229
+ # @return [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil]
230
+ optional :global_affiliate_status, enum: -> { WhopSDK::GlobalAffiliateStatus }, nil?: true
231
+
232
+ # @!attribute headline
233
+ # The headline of the product.
234
+ #
235
+ # @return [String, nil]
236
+ optional :headline, String, nil?: true
237
+
238
+ # @!attribute industry_type
239
+ # The different industry types a company can be in.
240
+ #
241
+ # @return [Symbol, WhopSDK::Models::IndustryTypes, nil]
242
+ optional :industry_type, enum: -> { WhopSDK::IndustryTypes }, nil?: true
243
+
244
+ # @!attribute product_tax_code_id
245
+ # The ID of the product tax code to apply to this product.
246
+ #
247
+ # @return [String, nil]
248
+ optional :product_tax_code_id, String, nil?: true
249
+
250
+ # @!attribute redirect_purchase_url
251
+ # The URL to redirect the customer to after a purchase.
252
+ #
253
+ # @return [String, nil]
254
+ optional :redirect_purchase_url, String, nil?: true
255
+
256
+ # @!attribute route
257
+ # The route of the product.
258
+ #
259
+ # @return [String, nil]
260
+ optional :route, String, nil?: true
261
+
262
+ # @!attribute visibility
263
+ # Visibility of a resource
264
+ #
265
+ # @return [Symbol, WhopSDK::Models::Visibility, nil]
266
+ optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true
267
+
268
+ # @!method initialize(external_identifier:, title:, business_type: nil, collect_shipping_address: nil, custom_statement_descriptor: nil, description: nil, global_affiliate_percentage: nil, global_affiliate_status: nil, headline: nil, industry_type: nil, product_tax_code_id: nil, redirect_purchase_url: nil, route: nil, visibility: nil)
269
+ # Some parameter documentations has been truncated, see
270
+ # {WhopSDK::Models::PaymentCreateParams::Plan::Product} for more details.
271
+ #
272
+ # Pass this object to create a new product for this plan. We will use the product
273
+ # external identifier to find or create an existing product.
274
+ #
275
+ # @param external_identifier [String] A unique ID used to find or create a product. When provided during creation, we
276
+ #
277
+ # @param title [String] The title of the product.
278
+ #
279
+ # @param business_type [Symbol, WhopSDK::Models::BusinessTypes, nil] The different business types a company can be.
280
+ #
281
+ # @param collect_shipping_address [Boolean, nil] Whether or not to collect shipping information at checkout from the customer.
282
+ #
283
+ # @param custom_statement_descriptor [String, nil] The custom statement descriptor for the product i.e. WHOP\*SPORTS, must be
284
+ # betwee
285
+ #
286
+ # @param description [String, nil] A written description of the product.
287
+ #
288
+ # @param global_affiliate_percentage [Float, nil] The percentage of the revenue that goes to the global affiliate program.
289
+ #
290
+ # @param global_affiliate_status [Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil] The different statuses of the global affiliate program for a product.
291
+ #
292
+ # @param headline [String, nil] The headline of the product.
293
+ #
294
+ # @param industry_type [Symbol, WhopSDK::Models::IndustryTypes, nil] The different industry types a company can be in.
295
+ #
296
+ # @param product_tax_code_id [String, nil] The ID of the product tax code to apply to this product.
297
+ #
298
+ # @param redirect_purchase_url [String, nil] The URL to redirect the customer to after a purchase.
299
+ #
300
+ # @param route [String, nil] The route of the product.
301
+ #
302
+ # @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource
303
+ end
304
+ end
305
+ end
306
+ end
307
+ end
@@ -113,6 +113,12 @@ module WhopSDK
113
113
  # @return [Symbol, WhopSDK::Models::PaymentMethodTypes, nil]
114
114
  required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }, nil?: true
115
115
 
116
+ # @!attribute payment_token
117
+ # The payment token used for the payment, if available.
118
+ #
119
+ # @return [WhopSDK::Models::PaymentListResponse::PaymentToken, nil]
120
+ required :payment_token, -> { WhopSDK::Models::PaymentListResponse::PaymentToken }, nil?: true
121
+
116
122
  # @!attribute plan
117
123
  # The plan attached to this payment.
118
124
  #
@@ -201,7 +207,7 @@ module WhopSDK
201
207
  # @return [Boolean]
202
208
  required :voidable, WhopSDK::Internal::Type::Boolean
203
209
 
204
- # @!method initialize(id:, amount_after_fees:, auto_refunded:, billing_address:, billing_reason:, card_brand:, card_last4:, company:, created_at:, currency:, dispute_alerted_at:, failure_message:, last_payment_attempt:, member:, membership:, metadata:, paid_at:, payment_method_type:, plan:, product:, promo_code:, refundable:, refunded_amount:, refunded_at:, retryable:, status:, substatus:, subtotal:, total:, usd_total:, user:, voidable:)
210
+ # @!method initialize(id:, amount_after_fees:, auto_refunded:, billing_address:, billing_reason:, card_brand:, card_last4:, company:, created_at:, currency:, dispute_alerted_at:, failure_message:, last_payment_attempt:, member:, membership:, metadata:, paid_at:, payment_method_type:, payment_token:, plan:, product:, promo_code:, refundable:, refunded_amount:, refunded_at:, retryable:, status:, substatus:, subtotal:, total:, usd_total:, user:, voidable:)
205
211
  # Some parameter documentations has been truncated, see
206
212
  # {WhopSDK::Models::PaymentListResponse} for more details.
207
213
  #
@@ -243,6 +249,8 @@ module WhopSDK
243
249
  #
244
250
  # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes, nil] The different types of payment methods that can be used.
245
251
  #
252
+ # @param payment_token [WhopSDK::Models::PaymentListResponse::PaymentToken, nil] The payment token used for the payment, if available.
253
+ #
246
254
  # @param plan [WhopSDK::Models::PaymentListResponse::Plan, nil] The plan attached to this payment.
247
255
  #
248
256
  # @param product [WhopSDK::Models::PaymentListResponse::Product, nil] The product this payment was made for
@@ -407,6 +415,87 @@ module WhopSDK
407
415
  # @param status [Symbol, WhopSDK::Models::MembershipStatus] The state of the membership.
408
416
  end
409
417
 
418
+ # @see WhopSDK::Models::PaymentListResponse#payment_token
419
+ class PaymentToken < WhopSDK::Internal::Type::BaseModel
420
+ # @!attribute id
421
+ # The ID of the payment token
422
+ #
423
+ # @return [String]
424
+ required :id, String
425
+
426
+ # @!attribute card
427
+ # The card data associated with the payment token, if its a debit or credit card
428
+ # token.
429
+ #
430
+ # @return [WhopSDK::Models::PaymentListResponse::PaymentToken::Card, nil]
431
+ required :card, -> { WhopSDK::Models::PaymentListResponse::PaymentToken::Card }, nil?: true
432
+
433
+ # @!attribute created_at
434
+ # The date and time the payment token was created
435
+ #
436
+ # @return [Time]
437
+ required :created_at, Time
438
+
439
+ # @!attribute payment_method_type
440
+ # The payment method type of the payment token
441
+ #
442
+ # @return [Symbol, WhopSDK::Models::PaymentMethodTypes]
443
+ required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }
444
+
445
+ # @!method initialize(id:, card:, created_at:, payment_method_type:)
446
+ # Some parameter documentations has been truncated, see
447
+ # {WhopSDK::Models::PaymentListResponse::PaymentToken} for more details.
448
+ #
449
+ # The payment token used for the payment, if available.
450
+ #
451
+ # @param id [String] The ID of the payment token
452
+ #
453
+ # @param card [WhopSDK::Models::PaymentListResponse::PaymentToken::Card, nil] The card data associated with the payment token, if its a debit or credit card t
454
+ #
455
+ # @param created_at [Time] The date and time the payment token was created
456
+ #
457
+ # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The payment method type of the payment token
458
+
459
+ # @see WhopSDK::Models::PaymentListResponse::PaymentToken#card
460
+ class Card < WhopSDK::Internal::Type::BaseModel
461
+ # @!attribute brand
462
+ # Possible card brands that a payment token can have
463
+ #
464
+ # @return [Symbol, WhopSDK::Models::CardBrands, nil]
465
+ required :brand, enum: -> { WhopSDK::CardBrands }, nil?: true
466
+
467
+ # @!attribute exp_month
468
+ # Card expiration month, like 03 for March.
469
+ #
470
+ # @return [Integer, nil]
471
+ required :exp_month, Integer, nil?: true
472
+
473
+ # @!attribute exp_year
474
+ # Card expiration year, like 27 for 2027.
475
+ #
476
+ # @return [Integer, nil]
477
+ required :exp_year, Integer, nil?: true
478
+
479
+ # @!attribute last4
480
+ # Last four digits of the card.
481
+ #
482
+ # @return [String, nil]
483
+ required :last4, String, nil?: true
484
+
485
+ # @!method initialize(brand:, exp_month:, exp_year:, last4:)
486
+ # The card data associated with the payment token, if its a debit or credit card
487
+ # token.
488
+ #
489
+ # @param brand [Symbol, WhopSDK::Models::CardBrands, nil] Possible card brands that a payment token can have
490
+ #
491
+ # @param exp_month [Integer, nil] Card expiration month, like 03 for March.
492
+ #
493
+ # @param exp_year [Integer, nil] Card expiration year, like 27 for 2027.
494
+ #
495
+ # @param last4 [String, nil] Last four digits of the card.
496
+ end
497
+ end
498
+
410
499
  # @see WhopSDK::Models::PaymentListResponse#plan
411
500
  class Plan < WhopSDK::Internal::Type::BaseModel
412
501
  # @!attribute id
@@ -90,6 +90,7 @@ module WhopSDK
90
90
  SPLITIT = :splitit
91
91
  PLATFORM_BALANCE = :platform_balance
92
92
  APPLE = :apple
93
+ VENMO = :venmo
93
94
  UNKNOWN = :unknown
94
95
 
95
96
  # @!method self.values
@@ -0,0 +1,78 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::PaymentTokens#list
6
+ class PaymentTokenListParams < WhopSDK::Internal::Type::BaseModel
7
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
8
+ include WhopSDK::Internal::Type::RequestParameters
9
+
10
+ # @!attribute member_id
11
+ # The ID of the Member to list payment tokens for
12
+ #
13
+ # @return [String]
14
+ required :member_id, String
15
+
16
+ # @!attribute after
17
+ # Returns the elements in the list that come after the specified cursor.
18
+ #
19
+ # @return [String, nil]
20
+ optional :after, String, nil?: true
21
+
22
+ # @!attribute before
23
+ # Returns the elements in the list that come before the specified cursor.
24
+ #
25
+ # @return [String, nil]
26
+ optional :before, String, nil?: true
27
+
28
+ # @!attribute created_after
29
+ # The minimum creation date to filter by
30
+ #
31
+ # @return [Time, nil]
32
+ optional :created_after, Time, nil?: true
33
+
34
+ # @!attribute created_before
35
+ # The maximum creation date to filter by
36
+ #
37
+ # @return [Time, nil]
38
+ optional :created_before, Time, nil?: true
39
+
40
+ # @!attribute direction
41
+ # The direction of the sort.
42
+ #
43
+ # @return [Symbol, WhopSDK::Models::Direction, nil]
44
+ optional :direction, enum: -> { WhopSDK::Direction }, nil?: true
45
+
46
+ # @!attribute first
47
+ # Returns the first _n_ elements from the list.
48
+ #
49
+ # @return [Integer, nil]
50
+ optional :first, Integer, nil?: true
51
+
52
+ # @!attribute last
53
+ # Returns the last _n_ elements from the list.
54
+ #
55
+ # @return [Integer, nil]
56
+ optional :last, Integer, nil?: true
57
+
58
+ # @!method initialize(member_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {})
59
+ # @param member_id [String] The ID of the Member to list payment tokens for
60
+ #
61
+ # @param after [String, nil] Returns the elements in the list that come after the specified cursor.
62
+ #
63
+ # @param before [String, nil] Returns the elements in the list that come before the specified cursor.
64
+ #
65
+ # @param created_after [Time, nil] The minimum creation date to filter by
66
+ #
67
+ # @param created_before [Time, nil] The maximum creation date to filter by
68
+ #
69
+ # @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort.
70
+ #
71
+ # @param first [Integer, nil] Returns the first _n_ elements from the list.
72
+ #
73
+ # @param last [Integer, nil] Returns the last _n_ elements from the list.
74
+ #
75
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,86 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::PaymentTokens#list
6
+ class PaymentTokenListResponse < WhopSDK::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # The ID of the payment token
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute card
14
+ # The card data associated with the payment token, if its a debit or credit card
15
+ # token.
16
+ #
17
+ # @return [WhopSDK::Models::PaymentTokenListResponse::Card, nil]
18
+ required :card, -> { WhopSDK::Models::PaymentTokenListResponse::Card }, nil?: true
19
+
20
+ # @!attribute created_at
21
+ # The date and time the payment token was created
22
+ #
23
+ # @return [Time]
24
+ required :created_at, Time
25
+
26
+ # @!attribute payment_method_type
27
+ # The payment method type of the payment token
28
+ #
29
+ # @return [Symbol, WhopSDK::Models::PaymentMethodTypes]
30
+ required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }
31
+
32
+ # @!method initialize(id:, card:, created_at:, payment_method_type:)
33
+ # Some parameter documentations has been truncated, see
34
+ # {WhopSDK::Models::PaymentTokenListResponse} for more details.
35
+ #
36
+ # A payment token used to process payments.
37
+ #
38
+ # @param id [String] The ID of the payment token
39
+ #
40
+ # @param card [WhopSDK::Models::PaymentTokenListResponse::Card, nil] The card data associated with the payment token, if its a debit or credit card t
41
+ #
42
+ # @param created_at [Time] The date and time the payment token was created
43
+ #
44
+ # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The payment method type of the payment token
45
+
46
+ # @see WhopSDK::Models::PaymentTokenListResponse#card
47
+ class Card < WhopSDK::Internal::Type::BaseModel
48
+ # @!attribute brand
49
+ # Possible card brands that a payment token can have
50
+ #
51
+ # @return [Symbol, WhopSDK::Models::CardBrands, nil]
52
+ required :brand, enum: -> { WhopSDK::CardBrands }, nil?: true
53
+
54
+ # @!attribute exp_month
55
+ # Card expiration month, like 03 for March.
56
+ #
57
+ # @return [Integer, nil]
58
+ required :exp_month, Integer, nil?: true
59
+
60
+ # @!attribute exp_year
61
+ # Card expiration year, like 27 for 2027.
62
+ #
63
+ # @return [Integer, nil]
64
+ required :exp_year, Integer, nil?: true
65
+
66
+ # @!attribute last4
67
+ # Last four digits of the card.
68
+ #
69
+ # @return [String, nil]
70
+ required :last4, String, nil?: true
71
+
72
+ # @!method initialize(brand:, exp_month:, exp_year:, last4:)
73
+ # The card data associated with the payment token, if its a debit or credit card
74
+ # token.
75
+ #
76
+ # @param brand [Symbol, WhopSDK::Models::CardBrands, nil] Possible card brands that a payment token can have
77
+ #
78
+ # @param exp_month [Integer, nil] Card expiration month, like 03 for March.
79
+ #
80
+ # @param exp_year [Integer, nil] Card expiration year, like 27 for 2027.
81
+ #
82
+ # @param last4 [String, nil] Last four digits of the card.
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::PaymentTokens#retrieve
6
+ class PaymentTokenRetrieveParams < WhopSDK::Internal::Type::BaseModel
7
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
8
+ include WhopSDK::Internal::Type::RequestParameters
9
+
10
+ # @!attribute member_id
11
+ # The ID of the Member associated with the PaymentToken
12
+ #
13
+ # @return [String]
14
+ required :member_id, String
15
+
16
+ # @!method initialize(member_id:, request_options: {})
17
+ # @param member_id [String] The ID of the Member associated with the PaymentToken
18
+ #
19
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
20
+ end
21
+ end
22
+ end