whop_sdk 0.0.5 → 0.0.6
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/README.md +4 -7
- data/lib/whop_sdk/client.rb +17 -6
- data/lib/whop_sdk/models/company.rb +1 -0
- data/lib/whop_sdk/models/dispute.rb +672 -0
- data/lib/whop_sdk/models/dispute_created_webhook_event.rb +48 -0
- data/lib/whop_sdk/models/dispute_list_params.rb +62 -0
- data/lib/whop_sdk/models/dispute_list_response.rb +187 -0
- data/lib/whop_sdk/models/dispute_retrieve_params.rb +14 -0
- data/lib/whop_sdk/models/dispute_statuses.rb +23 -0
- data/lib/whop_sdk/models/dispute_submit_evidence_params.rb +14 -0
- data/lib/whop_sdk/models/dispute_update_evidence_params.rb +342 -0
- data/lib/whop_sdk/models/dispute_updated_webhook_event.rb +48 -0
- data/lib/whop_sdk/models/notification_create_params.rb +88 -0
- data/lib/whop_sdk/models/notification_create_response.rb +19 -0
- data/lib/whop_sdk/models/unwrap_webhook_event.rb +5 -1
- data/lib/whop_sdk/models.rb +18 -0
- data/lib/whop_sdk/resources/disputes.rb +182 -0
- data/lib/whop_sdk/resources/notifications.rb +53 -0
- data/lib/whop_sdk/resources/webhooks.rb +1 -1
- data/lib/whop_sdk/version.rb +1 -1
- data/lib/whop_sdk.rb +13 -0
- data/rbi/whop_sdk/client.rbi +11 -2
- data/rbi/whop_sdk/models/company.rbi +2 -0
- data/rbi/whop_sdk/models/dispute.rbi +938 -0
- data/rbi/whop_sdk/models/dispute_created_webhook_event.rbi +72 -0
- data/rbi/whop_sdk/models/dispute_list_params.rbi +83 -0
- data/rbi/whop_sdk/models/dispute_list_response.rbi +287 -0
- data/rbi/whop_sdk/models/dispute_retrieve_params.rbi +27 -0
- data/rbi/whop_sdk/models/dispute_statuses.rbi +32 -0
- data/rbi/whop_sdk/models/dispute_submit_evidence_params.rbi +30 -0
- data/rbi/whop_sdk/models/dispute_update_evidence_params.rbi +566 -0
- data/rbi/whop_sdk/models/dispute_updated_webhook_event.rbi +72 -0
- data/rbi/whop_sdk/models/notification_create_params.rbi +113 -0
- data/rbi/whop_sdk/models/notification_create_response.rbi +31 -0
- data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +3 -1
- data/rbi/whop_sdk/models.rbi +18 -0
- data/rbi/whop_sdk/resources/disputes.rbi +194 -0
- data/rbi/whop_sdk/resources/notifications.rbi +54 -0
- data/rbi/whop_sdk/resources/webhooks.rbi +3 -1
- data/sig/whop_sdk/client.rbs +5 -1
- data/sig/whop_sdk/models/company.rbs +2 -0
- data/sig/whop_sdk/models/dispute.rbs +437 -0
- data/sig/whop_sdk/models/dispute_created_webhook_event.rbs +40 -0
- data/sig/whop_sdk/models/dispute_list_params.rbs +51 -0
- data/sig/whop_sdk/models/dispute_list_response.rbs +124 -0
- data/sig/whop_sdk/models/dispute_retrieve_params.rbs +15 -0
- data/sig/whop_sdk/models/dispute_statuses.rbs +30 -0
- data/sig/whop_sdk/models/dispute_submit_evidence_params.rbs +15 -0
- data/sig/whop_sdk/models/dispute_update_evidence_params.rbs +215 -0
- data/sig/whop_sdk/models/dispute_updated_webhook_event.rbs +40 -0
- data/sig/whop_sdk/models/notification_create_params.rbs +61 -0
- data/sig/whop_sdk/models/notification_create_response.rbs +13 -0
- data/sig/whop_sdk/models/unwrap_webhook_event.rbs +2 -0
- data/sig/whop_sdk/models.rbs +18 -0
- data/sig/whop_sdk/resources/disputes.rbs +46 -0
- data/sig/whop_sdk/resources/notifications.rbs +19 -0
- data/sig/whop_sdk/resources/webhooks.rbs +3 -1
- metadata +41 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 732d86cb6f20a898b79b19dc92e2404632edcf05d822e0e1b7b922647b61e932
|
|
4
|
+
data.tar.gz: c056debc5fdb1000cd5262befd3fced0a578b45ad0ac8010e11b6ea9cd9cad14
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b2763f3095b8e970464194a4eb59e86b69e8459a0efca643db385d1cc0ae01fd0c78cf0f6587be07a27320e4bd4040a4c0249fc11a7661c58396a9e273f10ddc
|
|
7
|
+
data.tar.gz: d79ef16946f2a1e1fe950af483e8c4beceb50eb026ebf872ef1662bfcdb72b03d6051cb3a89e84ec17de393ea352ee77e799447945a3759fd2429aef6389ed89
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.0.6 (2025-11-10)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.0.5...v0.0.6](https://github.com/whopio/whopsdk-ruby/compare/v0.0.5...v0.0.6)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([40bd47a](https://github.com/whopio/whopsdk-ruby/commit/40bd47ab707c869f865202b879d2818a1365c785))
|
|
10
|
+
* **api:** manual updates ([59f44e4](https://github.com/whopio/whopsdk-ruby/commit/59f44e454e7c1727a1d8566b316f7e61e98ce00b))
|
|
11
|
+
* **api:** manual updates ([f4dcf3a](https://github.com/whopio/whopsdk-ruby/commit/f4dcf3a5be316eaa0452b4786c7c986c75a3d8b2))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **api:** allow optional app id in constructor ([#4](https://github.com/whopio/whopsdk-ruby/issues/4)) ([7e6bd87](https://github.com/whopio/whopsdk-ruby/commit/7e6bd873a73acb9f76c24a51945f94fb0eb65d13))
|
|
17
|
+
|
|
3
18
|
## 0.0.5 (2025-11-08)
|
|
4
19
|
|
|
5
20
|
Full Changelog: [v0.0.4...v0.0.5](https://github.com/whopio/whopsdk-ruby/compare/v0.0.4...v0.0.5)
|
data/README.md
CHANGED
|
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
17
17
|
<!-- x-release-please-start-version -->
|
|
18
18
|
|
|
19
19
|
```ruby
|
|
20
|
-
gem "whop_sdk", "~> 0.0.
|
|
20
|
+
gem "whop_sdk", "~> 0.0.6"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
<!-- x-release-please-end -->
|
|
@@ -29,8 +29,7 @@ require "bundler/setup"
|
|
|
29
29
|
require "whop_sdk"
|
|
30
30
|
|
|
31
31
|
whop = WhopSDK::Client.new(
|
|
32
|
-
api_key: ENV["WHOP_API_KEY"]
|
|
33
|
-
app_id: "app_xxxxxxxxxxxxxx"
|
|
32
|
+
api_key: ENV["WHOP_API_KEY"] # This is the default and can be omitted
|
|
34
33
|
)
|
|
35
34
|
|
|
36
35
|
page = whop.payments.list(company_id: "biz_xxxxxxxxxxxxxx")
|
|
@@ -111,8 +110,7 @@ You can use the `max_retries` option to configure or disable this:
|
|
|
111
110
|
```ruby
|
|
112
111
|
# Configure the default for all requests:
|
|
113
112
|
whop = WhopSDK::Client.new(
|
|
114
|
-
max_retries: 0
|
|
115
|
-
app_id: "app_xxxxxxxxxxxxxx"
|
|
113
|
+
max_retries: 0 # default is 2
|
|
116
114
|
)
|
|
117
115
|
|
|
118
116
|
# Or, configure per-request:
|
|
@@ -126,8 +124,7 @@ By default, requests will time out after 60 seconds. You can use the timeout opt
|
|
|
126
124
|
```ruby
|
|
127
125
|
# Configure the default for all requests:
|
|
128
126
|
whop = WhopSDK::Client.new(
|
|
129
|
-
timeout: nil
|
|
130
|
-
app_id: "app_xxxxxxxxxxxxxx"
|
|
127
|
+
timeout: nil # default is 60
|
|
131
128
|
)
|
|
132
129
|
|
|
133
130
|
# Or, configure per-request:
|
data/lib/whop_sdk/client.rb
CHANGED
|
@@ -19,7 +19,9 @@ module WhopSDK
|
|
|
19
19
|
# @return [String]
|
|
20
20
|
attr_reader :api_key
|
|
21
21
|
|
|
22
|
-
#
|
|
22
|
+
# When using the SDK in app mode pass this parameter to allow verifying user
|
|
23
|
+
# tokens
|
|
24
|
+
# @return [String, nil]
|
|
23
25
|
attr_reader :app_id
|
|
24
26
|
|
|
25
27
|
# @return [WhopSDK::Resources::Apps]
|
|
@@ -118,6 +120,12 @@ module WhopSDK
|
|
|
118
120
|
# @return [WhopSDK::Resources::AccessTokens]
|
|
119
121
|
attr_reader :access_tokens
|
|
120
122
|
|
|
123
|
+
# @return [WhopSDK::Resources::Notifications]
|
|
124
|
+
attr_reader :notifications
|
|
125
|
+
|
|
126
|
+
# @return [WhopSDK::Resources::Disputes]
|
|
127
|
+
attr_reader :disputes
|
|
128
|
+
|
|
121
129
|
# @api private
|
|
122
130
|
#
|
|
123
131
|
# @return [Hash{String=>String}]
|
|
@@ -132,7 +140,8 @@ module WhopSDK
|
|
|
132
140
|
# @param api_key [String, nil] The app API key from an app from the /dashboard/developer page Defaults to
|
|
133
141
|
# `ENV["WHOP_API_KEY"]`
|
|
134
142
|
#
|
|
135
|
-
# @param app_id [String, nil]
|
|
143
|
+
# @param app_id [String, nil] When using the SDK in app mode pass this parameter to allow verifying user
|
|
144
|
+
# tokens Defaults to `ENV["WHOP_APP_ID"]`
|
|
136
145
|
#
|
|
137
146
|
# @param base_url [String, nil] Override the default base URL for the API, e.g.,
|
|
138
147
|
# `"https://api.example.com/v2/"`. Defaults to `ENV["WHOP_BASE_URL"]`
|
|
@@ -155,15 +164,12 @@ module WhopSDK
|
|
|
155
164
|
)
|
|
156
165
|
base_url ||= "https://api.whop.com/api/v1"
|
|
157
166
|
|
|
158
|
-
if app_id.nil?
|
|
159
|
-
raise ArgumentError.new("app_id is required, and can be set via environ: \"WHOP_APP_ID\"")
|
|
160
|
-
end
|
|
161
167
|
if api_key.nil?
|
|
162
168
|
raise ArgumentError.new("api_key is required, and can be set via environ: \"WHOP_API_KEY\"")
|
|
163
169
|
end
|
|
164
170
|
|
|
165
171
|
headers = {
|
|
166
|
-
"x-whop-app-id" => (@app_id = app_id
|
|
172
|
+
"x-whop-app-id" => (@app_id = app_id&.to_s)
|
|
167
173
|
}
|
|
168
174
|
|
|
169
175
|
@api_key = api_key.to_s
|
|
@@ -209,6 +215,8 @@ module WhopSDK
|
|
|
209
215
|
@reviews = WhopSDK::Resources::Reviews.new(client: self)
|
|
210
216
|
@course_students = WhopSDK::Resources::CourseStudents.new(client: self)
|
|
211
217
|
@access_tokens = WhopSDK::Resources::AccessTokens.new(client: self)
|
|
218
|
+
@notifications = WhopSDK::Resources::Notifications.new(client: self)
|
|
219
|
+
@disputes = WhopSDK::Resources::Disputes.new(client: self)
|
|
212
220
|
end
|
|
213
221
|
|
|
214
222
|
# Verifies a Whop user token
|
|
@@ -221,6 +229,9 @@ module WhopSDK
|
|
|
221
229
|
# @raise [StandardError] If verification fails
|
|
222
230
|
def verify_user_token!(token_or_headers, **opts)
|
|
223
231
|
opts[:app_id] ||= app_id
|
|
232
|
+
unless opts[:app_id]
|
|
233
|
+
raise StandardError, "You must set app_id in the Whop client if you want to verify user tokens"
|
|
234
|
+
end
|
|
224
235
|
Helpers::VerifyUserToken.verify_user_token!(token_or_headers, **opts)
|
|
225
236
|
end
|
|
226
237
|
|