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
@@ -0,0 +1,354 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ class RefundCreatedWebhookEvent < WhopSDK::Internal::Type::BaseModel
6
+ # @!attribute id
7
+ # A unique ID for every single webhook request
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute api_version
13
+ # The API version for this webhook
14
+ #
15
+ # @return [Symbol, :v1]
16
+ required :api_version, const: :v1
17
+
18
+ # @!attribute data
19
+ # An object representing a refund made on a payment.
20
+ #
21
+ # @return [WhopSDK::Models::RefundCreatedWebhookEvent::Data]
22
+ required :data, -> { WhopSDK::RefundCreatedWebhookEvent::Data }
23
+
24
+ # @!attribute timestamp
25
+ # The timestamp in ISO 8601 format that the webhook was sent at on the server
26
+ #
27
+ # @return [Time]
28
+ required :timestamp, Time
29
+
30
+ # @!attribute type
31
+ # The webhook event type
32
+ #
33
+ # @return [Symbol, :"refund.created"]
34
+ required :type, const: :"refund.created"
35
+
36
+ # @!method initialize(id:, data:, timestamp:, api_version: :v1, type: :"refund.created")
37
+ # @param id [String] A unique ID for every single webhook request
38
+ #
39
+ # @param data [WhopSDK::Models::RefundCreatedWebhookEvent::Data] An object representing a refund made on a payment.
40
+ #
41
+ # @param timestamp [Time] The timestamp in ISO 8601 format that the webhook was sent at on the server
42
+ #
43
+ # @param api_version [Symbol, :v1] The API version for this webhook
44
+ #
45
+ # @param type [Symbol, :"refund.created"] The webhook event type
46
+
47
+ # @see WhopSDK::Models::RefundCreatedWebhookEvent#data
48
+ class Data < WhopSDK::Internal::Type::BaseModel
49
+ # @!attribute id
50
+ # The ID of the refund.
51
+ #
52
+ # @return [String]
53
+ required :id, String
54
+
55
+ # @!attribute amount
56
+ # The amount of the refund.
57
+ #
58
+ # @return [Float]
59
+ required :amount, Float
60
+
61
+ # @!attribute created_at
62
+ # The time the refund was created.
63
+ #
64
+ # @return [Time]
65
+ required :created_at, Time
66
+
67
+ # @!attribute currency
68
+ # The currency of the refund.
69
+ #
70
+ # @return [Symbol, WhopSDK::Models::Currency]
71
+ required :currency, enum: -> { WhopSDK::Currency }
72
+
73
+ # @!attribute payment
74
+ # The payment associated with the refund.
75
+ #
76
+ # @return [WhopSDK::Models::RefundCreatedWebhookEvent::Data::Payment, nil]
77
+ required :payment, -> { WhopSDK::RefundCreatedWebhookEvent::Data::Payment }, nil?: true
78
+
79
+ # @!attribute provider
80
+ # The provider of the refund.
81
+ #
82
+ # @return [Symbol, WhopSDK::Models::PaymentProvider]
83
+ required :provider, enum: -> { WhopSDK::PaymentProvider }
84
+
85
+ # @!attribute provider_created_at
86
+ # The time the refund was created by the provider.
87
+ #
88
+ # @return [Time, nil]
89
+ required :provider_created_at, Time, nil?: true
90
+
91
+ # @!attribute reference_status
92
+ # The status of the refund reference.
93
+ #
94
+ # @return [Symbol, WhopSDK::Models::RefundReferenceStatus, nil]
95
+ required :reference_status, enum: -> { WhopSDK::RefundReferenceStatus }, nil?: true
96
+
97
+ # @!attribute reference_type
98
+ # The type of refund reference that was made available by the payment provider.
99
+ #
100
+ # @return [Symbol, WhopSDK::Models::RefundReferenceType, nil]
101
+ required :reference_type, enum: -> { WhopSDK::RefundReferenceType }, nil?: true
102
+
103
+ # @!attribute reference_value
104
+ # The value of the reference.
105
+ #
106
+ # @return [String, nil]
107
+ required :reference_value, String, nil?: true
108
+
109
+ # @!attribute status
110
+ # The status of the refund.
111
+ #
112
+ # @return [Symbol, WhopSDK::Models::RefundStatus]
113
+ required :status, enum: -> { WhopSDK::RefundStatus }
114
+
115
+ # @!method initialize(id:, amount:, created_at:, currency:, payment:, provider:, provider_created_at:, reference_status:, reference_type:, reference_value:, status:)
116
+ # An object representing a refund made on a payment.
117
+ #
118
+ # @param id [String] The ID of the refund.
119
+ #
120
+ # @param amount [Float] The amount of the refund.
121
+ #
122
+ # @param created_at [Time] The time the refund was created.
123
+ #
124
+ # @param currency [Symbol, WhopSDK::Models::Currency] The currency of the refund.
125
+ #
126
+ # @param payment [WhopSDK::Models::RefundCreatedWebhookEvent::Data::Payment, nil] The payment associated with the refund.
127
+ #
128
+ # @param provider [Symbol, WhopSDK::Models::PaymentProvider] The provider of the refund.
129
+ #
130
+ # @param provider_created_at [Time, nil] The time the refund was created by the provider.
131
+ #
132
+ # @param reference_status [Symbol, WhopSDK::Models::RefundReferenceStatus, nil] The status of the refund reference.
133
+ #
134
+ # @param reference_type [Symbol, WhopSDK::Models::RefundReferenceType, nil] The type of refund reference that was made available by the payment provider.
135
+ #
136
+ # @param reference_value [String, nil] The value of the reference.
137
+ #
138
+ # @param status [Symbol, WhopSDK::Models::RefundStatus] The status of the refund.
139
+
140
+ # @see WhopSDK::Models::RefundCreatedWebhookEvent::Data#payment
141
+ class Payment < WhopSDK::Internal::Type::BaseModel
142
+ # @!attribute id
143
+ # The payment ID
144
+ #
145
+ # @return [String]
146
+ required :id, String
147
+
148
+ # @!attribute billing_reason
149
+ # The reason why a specific payment was billed
150
+ #
151
+ # @return [Symbol, WhopSDK::Models::BillingReasons, nil]
152
+ required :billing_reason, enum: -> { WhopSDK::BillingReasons }, nil?: true
153
+
154
+ # @!attribute card_brand
155
+ # Possible card brands that a payment token can have
156
+ #
157
+ # @return [Symbol, WhopSDK::Models::CardBrands, nil]
158
+ required :card_brand, enum: -> { WhopSDK::CardBrands }, nil?: true
159
+
160
+ # @!attribute card_last4
161
+ # The last 4 digits of the card used to make the payment.
162
+ #
163
+ # @return [String, nil]
164
+ required :card_last4, String, nil?: true
165
+
166
+ # @!attribute created_at
167
+ # The datetime the payment was created
168
+ #
169
+ # @return [Time]
170
+ required :created_at, Time
171
+
172
+ # @!attribute currency
173
+ # The available currencies on the platform
174
+ #
175
+ # @return [Symbol, WhopSDK::Models::Currency, nil]
176
+ required :currency, enum: -> { WhopSDK::Currency }, nil?: true
177
+
178
+ # @!attribute dispute_alerted_at
179
+ # When an alert came in that this transaction will be disputed
180
+ #
181
+ # @return [Time, nil]
182
+ required :dispute_alerted_at, Time, nil?: true
183
+
184
+ # @!attribute member
185
+ # The member attached to this payment.
186
+ #
187
+ # @return [WhopSDK::Models::RefundCreatedWebhookEvent::Data::Payment::Member, nil]
188
+ required :member, -> { WhopSDK::RefundCreatedWebhookEvent::Data::Payment::Member }, nil?: true
189
+
190
+ # @!attribute membership
191
+ # The membership attached to this payment.
192
+ #
193
+ # @return [WhopSDK::Models::RefundCreatedWebhookEvent::Data::Payment::Membership, nil]
194
+ required :membership,
195
+ -> {
196
+ WhopSDK::RefundCreatedWebhookEvent::Data::Payment::Membership
197
+ },
198
+ nil?: true
199
+
200
+ # @!attribute paid_at
201
+ # The datetime the payment was paid
202
+ #
203
+ # @return [Time, nil]
204
+ required :paid_at, Time, nil?: true
205
+
206
+ # @!attribute payment_method_type
207
+ # The different types of payment methods that can be used.
208
+ #
209
+ # @return [Symbol, WhopSDK::Models::PaymentMethodTypes, nil]
210
+ required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }, nil?: true
211
+
212
+ # @!attribute subtotal
213
+ # The subtotal to show to the creator (excluding buyer fees).
214
+ #
215
+ # @return [Float, nil]
216
+ required :subtotal, Float, nil?: true
217
+
218
+ # @!attribute total
219
+ # The total to show to the creator (excluding buyer fees).
220
+ #
221
+ # @return [Float, nil]
222
+ required :total, Float, nil?: true
223
+
224
+ # @!attribute usd_total
225
+ # The total in USD to show to the creator (excluding buyer fees).
226
+ #
227
+ # @return [Float, nil]
228
+ required :usd_total, Float, nil?: true
229
+
230
+ # @!attribute user
231
+ # The user that made this payment.
232
+ #
233
+ # @return [WhopSDK::Models::RefundCreatedWebhookEvent::Data::Payment::User, nil]
234
+ required :user, -> { WhopSDK::RefundCreatedWebhookEvent::Data::Payment::User }, nil?: true
235
+
236
+ # @!method initialize(id:, billing_reason:, card_brand:, card_last4:, created_at:, currency:, dispute_alerted_at:, member:, membership:, paid_at:, payment_method_type:, subtotal:, total:, usd_total:, user:)
237
+ # The payment associated with the refund.
238
+ #
239
+ # @param id [String] The payment ID
240
+ #
241
+ # @param billing_reason [Symbol, WhopSDK::Models::BillingReasons, nil] The reason why a specific payment was billed
242
+ #
243
+ # @param card_brand [Symbol, WhopSDK::Models::CardBrands, nil] Possible card brands that a payment token can have
244
+ #
245
+ # @param card_last4 [String, nil] The last 4 digits of the card used to make the payment.
246
+ #
247
+ # @param created_at [Time] The datetime the payment was created
248
+ #
249
+ # @param currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform
250
+ #
251
+ # @param dispute_alerted_at [Time, nil] When an alert came in that this transaction will be disputed
252
+ #
253
+ # @param member [WhopSDK::Models::RefundCreatedWebhookEvent::Data::Payment::Member, nil] The member attached to this payment.
254
+ #
255
+ # @param membership [WhopSDK::Models::RefundCreatedWebhookEvent::Data::Payment::Membership, nil] The membership attached to this payment.
256
+ #
257
+ # @param paid_at [Time, nil] The datetime the payment was paid
258
+ #
259
+ # @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes, nil] The different types of payment methods that can be used.
260
+ #
261
+ # @param subtotal [Float, nil] The subtotal to show to the creator (excluding buyer fees).
262
+ #
263
+ # @param total [Float, nil] The total to show to the creator (excluding buyer fees).
264
+ #
265
+ # @param usd_total [Float, nil] The total in USD to show to the creator (excluding buyer fees).
266
+ #
267
+ # @param user [WhopSDK::Models::RefundCreatedWebhookEvent::Data::Payment::User, nil] The user that made this payment.
268
+
269
+ # @see WhopSDK::Models::RefundCreatedWebhookEvent::Data::Payment#member
270
+ class Member < WhopSDK::Internal::Type::BaseModel
271
+ # @!attribute id
272
+ # The ID of the member
273
+ #
274
+ # @return [String]
275
+ required :id, String
276
+
277
+ # @!attribute phone
278
+ # The phone number for the member, if available.
279
+ #
280
+ # @return [String, nil]
281
+ required :phone, String, nil?: true
282
+
283
+ # @!method initialize(id:, phone:)
284
+ # The member attached to this payment.
285
+ #
286
+ # @param id [String] The ID of the member
287
+ #
288
+ # @param phone [String, nil] The phone number for the member, if available.
289
+ end
290
+
291
+ # @see WhopSDK::Models::RefundCreatedWebhookEvent::Data::Payment#membership
292
+ class Membership < WhopSDK::Internal::Type::BaseModel
293
+ # @!attribute id
294
+ # The internal ID of the membership.
295
+ #
296
+ # @return [String]
297
+ required :id, String
298
+
299
+ # @!attribute status
300
+ # The state of the membership.
301
+ #
302
+ # @return [Symbol, WhopSDK::Models::MembershipStatus]
303
+ required :status, enum: -> { WhopSDK::MembershipStatus }
304
+
305
+ # @!method initialize(id:, status:)
306
+ # The membership attached to this payment.
307
+ #
308
+ # @param id [String] The internal ID of the membership.
309
+ #
310
+ # @param status [Symbol, WhopSDK::Models::MembershipStatus] The state of the membership.
311
+ end
312
+
313
+ # @see WhopSDK::Models::RefundCreatedWebhookEvent::Data::Payment#user
314
+ class User < WhopSDK::Internal::Type::BaseModel
315
+ # @!attribute id
316
+ # The internal ID of the user.
317
+ #
318
+ # @return [String]
319
+ required :id, String
320
+
321
+ # @!attribute email
322
+ # The email of the user
323
+ #
324
+ # @return [String, nil]
325
+ required :email, String, nil?: true
326
+
327
+ # @!attribute name
328
+ # The name of the user from their Whop account.
329
+ #
330
+ # @return [String, nil]
331
+ required :name, String, nil?: true
332
+
333
+ # @!attribute username
334
+ # The username of the user from their Whop account.
335
+ #
336
+ # @return [String]
337
+ required :username, String
338
+
339
+ # @!method initialize(id:, email:, name:, username:)
340
+ # The user that made this payment.
341
+ #
342
+ # @param id [String] The internal ID of the user.
343
+ #
344
+ # @param email [String, nil] The email of the user
345
+ #
346
+ # @param name [String, nil] The name of the user from their Whop account.
347
+ #
348
+ # @param username [String] The username of the user from their Whop account.
349
+ end
350
+ end
351
+ end
352
+ end
353
+ end
354
+ end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::Refunds#list
6
+ class RefundListParams < WhopSDK::Internal::Type::BaseModel
7
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
8
+ include WhopSDK::Internal::Type::RequestParameters
9
+
10
+ # @!attribute payment_id
11
+ # The ID of the payment to list refunds for
12
+ #
13
+ # @return [String]
14
+ required :payment_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 direction
29
+ # The direction of the sort.
30
+ #
31
+ # @return [Symbol, WhopSDK::Models::Direction, nil]
32
+ optional :direction, enum: -> { WhopSDK::Direction }, nil?: true
33
+
34
+ # @!attribute first
35
+ # Returns the first _n_ elements from the list.
36
+ #
37
+ # @return [Integer, nil]
38
+ optional :first, Integer, nil?: true
39
+
40
+ # @!attribute last
41
+ # Returns the last _n_ elements from the list.
42
+ #
43
+ # @return [Integer, nil]
44
+ optional :last, Integer, nil?: true
45
+
46
+ # @!method initialize(payment_id:, after: nil, before: nil, direction: nil, first: nil, last: nil, request_options: {})
47
+ # @param payment_id [String] The ID of the payment to list refunds for
48
+ #
49
+ # @param after [String, nil] Returns the elements in the list that come after the specified cursor.
50
+ #
51
+ # @param before [String, nil] Returns the elements in the list that come before the specified cursor.
52
+ #
53
+ # @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort.
54
+ #
55
+ # @param first [Integer, nil] Returns the first _n_ elements from the list.
56
+ #
57
+ # @param last [Integer, nil] Returns the last _n_ elements from the list.
58
+ #
59
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,113 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::Refunds#list
6
+ class RefundListResponse < WhopSDK::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # The ID of the refund.
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute amount
14
+ # The amount of the refund.
15
+ #
16
+ # @return [Float]
17
+ required :amount, Float
18
+
19
+ # @!attribute created_at
20
+ # The time the refund was created.
21
+ #
22
+ # @return [Time]
23
+ required :created_at, Time
24
+
25
+ # @!attribute currency
26
+ # The currency of the refund.
27
+ #
28
+ # @return [Symbol, WhopSDK::Models::Currency]
29
+ required :currency, enum: -> { WhopSDK::Currency }
30
+
31
+ # @!attribute payment
32
+ # The payment associated with the refund.
33
+ #
34
+ # @return [WhopSDK::Models::RefundListResponse::Payment, nil]
35
+ required :payment, -> { WhopSDK::Models::RefundListResponse::Payment }, nil?: true
36
+
37
+ # @!attribute provider
38
+ # The provider of the refund.
39
+ #
40
+ # @return [Symbol, WhopSDK::Models::PaymentProvider]
41
+ required :provider, enum: -> { WhopSDK::PaymentProvider }
42
+
43
+ # @!attribute provider_created_at
44
+ # The time the refund was created by the provider.
45
+ #
46
+ # @return [Time, nil]
47
+ required :provider_created_at, Time, nil?: true
48
+
49
+ # @!attribute reference_status
50
+ # The status of the refund reference.
51
+ #
52
+ # @return [Symbol, WhopSDK::Models::RefundReferenceStatus, nil]
53
+ required :reference_status, enum: -> { WhopSDK::RefundReferenceStatus }, nil?: true
54
+
55
+ # @!attribute reference_type
56
+ # The type of refund reference that was made available by the payment provider.
57
+ #
58
+ # @return [Symbol, WhopSDK::Models::RefundReferenceType, nil]
59
+ required :reference_type, enum: -> { WhopSDK::RefundReferenceType }, nil?: true
60
+
61
+ # @!attribute reference_value
62
+ # The value of the reference.
63
+ #
64
+ # @return [String, nil]
65
+ required :reference_value, String, nil?: true
66
+
67
+ # @!attribute status
68
+ # The status of the refund.
69
+ #
70
+ # @return [Symbol, WhopSDK::Models::RefundStatus]
71
+ required :status, enum: -> { WhopSDK::RefundStatus }
72
+
73
+ # @!method initialize(id:, amount:, created_at:, currency:, payment:, provider:, provider_created_at:, reference_status:, reference_type:, reference_value:, status:)
74
+ # An object representing a refund made on a payment.
75
+ #
76
+ # @param id [String] The ID of the refund.
77
+ #
78
+ # @param amount [Float] The amount of the refund.
79
+ #
80
+ # @param created_at [Time] The time the refund was created.
81
+ #
82
+ # @param currency [Symbol, WhopSDK::Models::Currency] The currency of the refund.
83
+ #
84
+ # @param payment [WhopSDK::Models::RefundListResponse::Payment, nil] The payment associated with the refund.
85
+ #
86
+ # @param provider [Symbol, WhopSDK::Models::PaymentProvider] The provider of the refund.
87
+ #
88
+ # @param provider_created_at [Time, nil] The time the refund was created by the provider.
89
+ #
90
+ # @param reference_status [Symbol, WhopSDK::Models::RefundReferenceStatus, nil] The status of the refund reference.
91
+ #
92
+ # @param reference_type [Symbol, WhopSDK::Models::RefundReferenceType, nil] The type of refund reference that was made available by the payment provider.
93
+ #
94
+ # @param reference_value [String, nil] The value of the reference.
95
+ #
96
+ # @param status [Symbol, WhopSDK::Models::RefundStatus] The status of the refund.
97
+
98
+ # @see WhopSDK::Models::RefundListResponse#payment
99
+ class Payment < WhopSDK::Internal::Type::BaseModel
100
+ # @!attribute id
101
+ # The payment ID
102
+ #
103
+ # @return [String]
104
+ required :id, String
105
+
106
+ # @!method initialize(id:)
107
+ # The payment associated with the refund.
108
+ #
109
+ # @param id [String] The payment ID
110
+ end
111
+ end
112
+ end
113
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # The status of the refund reference.
6
+ module RefundReferenceStatus
7
+ extend WhopSDK::Internal::Type::Enum
8
+
9
+ AVAILABLE = :available
10
+ PENDING = :pending
11
+ UNAVAILABLE = :unavailable
12
+
13
+ # @!method self.values
14
+ # @return [Array<Symbol>]
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # The type of refund reference that was made available by the payment provider.
6
+ module RefundReferenceType
7
+ extend WhopSDK::Internal::Type::Enum
8
+
9
+ ACQUIRER_REFERENCE_NUMBER = :acquirer_reference_number
10
+ RETRIEVAL_REFERENCE_NUMBER = :retrieval_reference_number
11
+ SYSTEM_TRACE_AUDIT_NUMBER = :system_trace_audit_number
12
+
13
+ # @!method self.values
14
+ # @return [Array<Symbol>]
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module WhopSDK
4
+ module Models
5
+ # @see WhopSDK::Resources::Refunds#retrieve
6
+ class RefundRetrieveParams < WhopSDK::Internal::Type::BaseModel
7
+ extend WhopSDK::Internal::Type::RequestParameters::Converter
8
+ include WhopSDK::Internal::Type::RequestParameters
9
+
10
+ # @!method initialize(request_options: {})
11
+ # @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}]
12
+ end
13
+ end
14
+ end