whop_sdk 0.0.9 → 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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +1 -1
- data/lib/whop_sdk/client.rb +8 -0
- data/lib/whop_sdk/models/app_build_create_params.rb +9 -1
- data/lib/whop_sdk/models/payment.rb +90 -1
- data/lib/whop_sdk/models/payment_create_params.rb +307 -0
- data/lib/whop_sdk/models/payment_list_response.rb +90 -1
- data/lib/whop_sdk/models/payment_token_list_params.rb +78 -0
- data/lib/whop_sdk/models/payment_token_list_response.rb +86 -0
- data/lib/whop_sdk/models/payment_token_retrieve_params.rb +22 -0
- data/lib/whop_sdk/models/payment_token_retrieve_response.rb +86 -0
- data/lib/whop_sdk/models/setup_intent.rb +253 -0
- data/lib/whop_sdk/models/setup_intent_canceled_webhook_event.rb +52 -0
- data/lib/whop_sdk/models/setup_intent_list_params.rb +78 -0
- data/lib/whop_sdk/models/setup_intent_list_response.rb +255 -0
- data/lib/whop_sdk/models/setup_intent_requires_action_webhook_event.rb +52 -0
- data/lib/whop_sdk/models/setup_intent_retrieve_params.rb +14 -0
- data/lib/whop_sdk/models/setup_intent_status.rb +18 -0
- data/lib/whop_sdk/models/setup_intent_succeeded_webhook_event.rb +52 -0
- data/lib/whop_sdk/models/unwrap_webhook_event.rb +7 -1
- data/lib/whop_sdk/models.rb +20 -0
- data/lib/whop_sdk/resources/app_builds.rb +3 -1
- data/lib/whop_sdk/resources/payment_tokens.rb +83 -0
- data/lib/whop_sdk/resources/payments.rb +48 -0
- data/lib/whop_sdk/resources/setup_intents.rb +83 -0
- data/lib/whop_sdk/resources/webhooks.rb +1 -1
- data/lib/whop_sdk/version.rb +1 -1
- data/lib/whop_sdk.rb +15 -0
- data/rbi/whop_sdk/client.rbi +6 -0
- data/rbi/whop_sdk/models/app_build_create_params.rbi +8 -0
- data/rbi/whop_sdk/models/payment.rbi +142 -0
- data/rbi/whop_sdk/models/payment_create_params.rbi +384 -0
- data/rbi/whop_sdk/models/payment_list_response.rbi +167 -0
- data/rbi/whop_sdk/models/payment_token_list_params.rbi +99 -0
- data/rbi/whop_sdk/models/payment_token_list_response.rbi +139 -0
- data/rbi/whop_sdk/models/payment_token_retrieve_params.rbi +40 -0
- data/rbi/whop_sdk/models/payment_token_retrieve_response.rbi +144 -0
- data/rbi/whop_sdk/models/setup_intent.rbi +412 -0
- data/rbi/whop_sdk/models/setup_intent_canceled_webhook_event.rbi +77 -0
- data/rbi/whop_sdk/models/setup_intent_list_params.rbi +99 -0
- data/rbi/whop_sdk/models/setup_intent_list_response.rbi +492 -0
- data/rbi/whop_sdk/models/setup_intent_requires_action_webhook_event.rbi +77 -0
- data/rbi/whop_sdk/models/setup_intent_retrieve_params.rbi +27 -0
- data/rbi/whop_sdk/models/setup_intent_status.rbi +25 -0
- data/rbi/whop_sdk/models/setup_intent_succeeded_webhook_event.rbi +77 -0
- data/rbi/whop_sdk/models/unwrap_webhook_event.rbi +3 -0
- data/rbi/whop_sdk/models.rbi +23 -0
- data/rbi/whop_sdk/resources/app_builds.rbi +3 -0
- data/rbi/whop_sdk/resources/payment_tokens.rbi +76 -0
- data/rbi/whop_sdk/resources/payments.rbi +42 -0
- data/rbi/whop_sdk/resources/setup_intents.rbi +77 -0
- data/rbi/whop_sdk/resources/webhooks.rbi +3 -0
- data/sig/whop_sdk/client.rbs +4 -0
- data/sig/whop_sdk/models/app_build_create_params.rbs +5 -0
- data/sig/whop_sdk/models/payment.rbs +69 -0
- data/sig/whop_sdk/models/payment_create_params.rbs +210 -0
- data/sig/whop_sdk/models/payment_list_response.rbs +69 -0
- data/sig/whop_sdk/models/payment_token_list_params.rbs +61 -0
- data/sig/whop_sdk/models/payment_token_list_response.rbs +67 -0
- data/sig/whop_sdk/models/payment_token_retrieve_params.rbs +23 -0
- data/sig/whop_sdk/models/payment_token_retrieve_response.rbs +67 -0
- data/sig/whop_sdk/models/setup_intent.rbs +189 -0
- data/sig/whop_sdk/models/setup_intent_canceled_webhook_event.rbs +40 -0
- data/sig/whop_sdk/models/setup_intent_list_params.rbs +61 -0
- data/sig/whop_sdk/models/setup_intent_list_response.rbs +193 -0
- data/sig/whop_sdk/models/setup_intent_requires_action_webhook_event.rbs +40 -0
- data/sig/whop_sdk/models/setup_intent_retrieve_params.rbs +15 -0
- data/sig/whop_sdk/models/setup_intent_status.rbs +17 -0
- data/sig/whop_sdk/models/setup_intent_succeeded_webhook_event.rbs +40 -0
- data/sig/whop_sdk/models/unwrap_webhook_event.rbs +3 -0
- data/sig/whop_sdk/models.rbs +20 -0
- data/sig/whop_sdk/resources/app_builds.rbs +1 -0
- data/sig/whop_sdk/resources/payment_tokens.rbs +25 -0
- data/sig/whop_sdk/resources/payments.rbs +9 -0
- data/sig/whop_sdk/resources/setup_intents.rbs +24 -0
- data/sig/whop_sdk/resources/webhooks.rbs +3 -0
- metadata +47 -2
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::SetupIntents#list
|
|
6
|
+
class SetupIntentListResponse < WhopSDK::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# The setup intent ID
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute checkout_configuration
|
|
14
|
+
# The checkout configuration associated with the setup intent
|
|
15
|
+
#
|
|
16
|
+
# @return [WhopSDK::Models::SetupIntentListResponse::CheckoutConfiguration, nil]
|
|
17
|
+
required :checkout_configuration,
|
|
18
|
+
-> { WhopSDK::Models::SetupIntentListResponse::CheckoutConfiguration },
|
|
19
|
+
nil?: true
|
|
20
|
+
|
|
21
|
+
# @!attribute company
|
|
22
|
+
# The company of the setup intent
|
|
23
|
+
#
|
|
24
|
+
# @return [WhopSDK::Models::SetupIntentListResponse::Company, nil]
|
|
25
|
+
required :company, -> { WhopSDK::Models::SetupIntentListResponse::Company }, nil?: true
|
|
26
|
+
|
|
27
|
+
# @!attribute created_at
|
|
28
|
+
# The datetime the payment was created
|
|
29
|
+
#
|
|
30
|
+
# @return [Time]
|
|
31
|
+
required :created_at, Time
|
|
32
|
+
|
|
33
|
+
# @!attribute error_message
|
|
34
|
+
# The error message, if any.
|
|
35
|
+
#
|
|
36
|
+
# @return [String, nil]
|
|
37
|
+
required :error_message, String, nil?: true
|
|
38
|
+
|
|
39
|
+
# @!attribute member
|
|
40
|
+
# The member connected to the setup intent
|
|
41
|
+
#
|
|
42
|
+
# @return [WhopSDK::Models::SetupIntentListResponse::Member, nil]
|
|
43
|
+
required :member, -> { WhopSDK::Models::SetupIntentListResponse::Member }, nil?: true
|
|
44
|
+
|
|
45
|
+
# @!attribute metadata
|
|
46
|
+
# The metadata associated with the setup intent
|
|
47
|
+
#
|
|
48
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
49
|
+
required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true
|
|
50
|
+
|
|
51
|
+
# @!attribute payment_token
|
|
52
|
+
# The payment token created during the setup, if available.
|
|
53
|
+
#
|
|
54
|
+
# @return [WhopSDK::Models::SetupIntentListResponse::PaymentToken, nil]
|
|
55
|
+
required :payment_token, -> { WhopSDK::Models::SetupIntentListResponse::PaymentToken }, nil?: true
|
|
56
|
+
|
|
57
|
+
# @!attribute status
|
|
58
|
+
# The status of the setup intent
|
|
59
|
+
#
|
|
60
|
+
# @return [Symbol, WhopSDK::Models::SetupIntentStatus]
|
|
61
|
+
required :status, enum: -> { WhopSDK::SetupIntentStatus }
|
|
62
|
+
|
|
63
|
+
# @!method initialize(id:, checkout_configuration:, company:, created_at:, error_message:, member:, metadata:, payment_token:, status:)
|
|
64
|
+
# An object representing a setup intent, which is a flow for allowing a customer
|
|
65
|
+
# to add a payment method to their account without making a purchase.
|
|
66
|
+
#
|
|
67
|
+
# @param id [String] The setup intent ID
|
|
68
|
+
#
|
|
69
|
+
# @param checkout_configuration [WhopSDK::Models::SetupIntentListResponse::CheckoutConfiguration, nil] The checkout configuration associated with the setup intent
|
|
70
|
+
#
|
|
71
|
+
# @param company [WhopSDK::Models::SetupIntentListResponse::Company, nil] The company of the setup intent
|
|
72
|
+
#
|
|
73
|
+
# @param created_at [Time] The datetime the payment was created
|
|
74
|
+
#
|
|
75
|
+
# @param error_message [String, nil] The error message, if any.
|
|
76
|
+
#
|
|
77
|
+
# @param member [WhopSDK::Models::SetupIntentListResponse::Member, nil] The member connected to the setup intent
|
|
78
|
+
#
|
|
79
|
+
# @param metadata [Hash{Symbol=>Object}, nil] The metadata associated with the setup intent
|
|
80
|
+
#
|
|
81
|
+
# @param payment_token [WhopSDK::Models::SetupIntentListResponse::PaymentToken, nil] The payment token created during the setup, if available.
|
|
82
|
+
#
|
|
83
|
+
# @param status [Symbol, WhopSDK::Models::SetupIntentStatus] The status of the setup intent
|
|
84
|
+
|
|
85
|
+
# @see WhopSDK::Models::SetupIntentListResponse#checkout_configuration
|
|
86
|
+
class CheckoutConfiguration < WhopSDK::Internal::Type::BaseModel
|
|
87
|
+
# @!attribute id
|
|
88
|
+
# The ID of the checkout configuration
|
|
89
|
+
#
|
|
90
|
+
# @return [String]
|
|
91
|
+
required :id, String
|
|
92
|
+
|
|
93
|
+
# @!method initialize(id:)
|
|
94
|
+
# The checkout configuration associated with the setup intent
|
|
95
|
+
#
|
|
96
|
+
# @param id [String] The ID of the checkout configuration
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# @see WhopSDK::Models::SetupIntentListResponse#company
|
|
100
|
+
class Company < WhopSDK::Internal::Type::BaseModel
|
|
101
|
+
# @!attribute id
|
|
102
|
+
# The ID (tag) of the company.
|
|
103
|
+
#
|
|
104
|
+
# @return [String]
|
|
105
|
+
required :id, String
|
|
106
|
+
|
|
107
|
+
# @!method initialize(id:)
|
|
108
|
+
# The company of the setup intent
|
|
109
|
+
#
|
|
110
|
+
# @param id [String] The ID (tag) of the company.
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# @see WhopSDK::Models::SetupIntentListResponse#member
|
|
114
|
+
class Member < WhopSDK::Internal::Type::BaseModel
|
|
115
|
+
# @!attribute id
|
|
116
|
+
# The ID of the member
|
|
117
|
+
#
|
|
118
|
+
# @return [String]
|
|
119
|
+
required :id, String
|
|
120
|
+
|
|
121
|
+
# @!attribute user
|
|
122
|
+
# The user for this member, if any.
|
|
123
|
+
#
|
|
124
|
+
# @return [WhopSDK::Models::SetupIntentListResponse::Member::User, nil]
|
|
125
|
+
required :user, -> { WhopSDK::Models::SetupIntentListResponse::Member::User }, nil?: true
|
|
126
|
+
|
|
127
|
+
# @!method initialize(id:, user:)
|
|
128
|
+
# The member connected to the setup intent
|
|
129
|
+
#
|
|
130
|
+
# @param id [String] The ID of the member
|
|
131
|
+
#
|
|
132
|
+
# @param user [WhopSDK::Models::SetupIntentListResponse::Member::User, nil] The user for this member, if any.
|
|
133
|
+
|
|
134
|
+
# @see WhopSDK::Models::SetupIntentListResponse::Member#user
|
|
135
|
+
class User < WhopSDK::Internal::Type::BaseModel
|
|
136
|
+
# @!attribute id
|
|
137
|
+
# The internal ID of the user account.
|
|
138
|
+
#
|
|
139
|
+
# @return [String]
|
|
140
|
+
required :id, String
|
|
141
|
+
|
|
142
|
+
# @!attribute email
|
|
143
|
+
# The digital mailing address of the user.
|
|
144
|
+
#
|
|
145
|
+
# @return [String, nil]
|
|
146
|
+
required :email, String, nil?: true
|
|
147
|
+
|
|
148
|
+
# @!attribute name
|
|
149
|
+
# The user's full name.
|
|
150
|
+
#
|
|
151
|
+
# @return [String, nil]
|
|
152
|
+
required :name, String, nil?: true
|
|
153
|
+
|
|
154
|
+
# @!attribute username
|
|
155
|
+
# The whop username.
|
|
156
|
+
#
|
|
157
|
+
# @return [String]
|
|
158
|
+
required :username, String
|
|
159
|
+
|
|
160
|
+
# @!method initialize(id:, email:, name:, username:)
|
|
161
|
+
# The user for this member, if any.
|
|
162
|
+
#
|
|
163
|
+
# @param id [String] The internal ID of the user account.
|
|
164
|
+
#
|
|
165
|
+
# @param email [String, nil] The digital mailing address of the user.
|
|
166
|
+
#
|
|
167
|
+
# @param name [String, nil] The user's full name.
|
|
168
|
+
#
|
|
169
|
+
# @param username [String] The whop username.
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# @see WhopSDK::Models::SetupIntentListResponse#payment_token
|
|
174
|
+
class PaymentToken < WhopSDK::Internal::Type::BaseModel
|
|
175
|
+
# @!attribute id
|
|
176
|
+
# The ID of the payment token
|
|
177
|
+
#
|
|
178
|
+
# @return [String]
|
|
179
|
+
required :id, String
|
|
180
|
+
|
|
181
|
+
# @!attribute card
|
|
182
|
+
# The card data associated with the payment token, if its a debit or credit card
|
|
183
|
+
# token.
|
|
184
|
+
#
|
|
185
|
+
# @return [WhopSDK::Models::SetupIntentListResponse::PaymentToken::Card, nil]
|
|
186
|
+
required :card, -> { WhopSDK::Models::SetupIntentListResponse::PaymentToken::Card }, nil?: true
|
|
187
|
+
|
|
188
|
+
# @!attribute created_at
|
|
189
|
+
# The date and time the payment token was created
|
|
190
|
+
#
|
|
191
|
+
# @return [Time]
|
|
192
|
+
required :created_at, Time
|
|
193
|
+
|
|
194
|
+
# @!attribute payment_method_type
|
|
195
|
+
# The payment method type of the payment token
|
|
196
|
+
#
|
|
197
|
+
# @return [Symbol, WhopSDK::Models::PaymentMethodTypes]
|
|
198
|
+
required :payment_method_type, enum: -> { WhopSDK::PaymentMethodTypes }
|
|
199
|
+
|
|
200
|
+
# @!method initialize(id:, card:, created_at:, payment_method_type:)
|
|
201
|
+
# Some parameter documentations has been truncated, see
|
|
202
|
+
# {WhopSDK::Models::SetupIntentListResponse::PaymentToken} for more details.
|
|
203
|
+
#
|
|
204
|
+
# The payment token created during the setup, if available.
|
|
205
|
+
#
|
|
206
|
+
# @param id [String] The ID of the payment token
|
|
207
|
+
#
|
|
208
|
+
# @param card [WhopSDK::Models::SetupIntentListResponse::PaymentToken::Card, nil] The card data associated with the payment token, if its a debit or credit card t
|
|
209
|
+
#
|
|
210
|
+
# @param created_at [Time] The date and time the payment token was created
|
|
211
|
+
#
|
|
212
|
+
# @param payment_method_type [Symbol, WhopSDK::Models::PaymentMethodTypes] The payment method type of the payment token
|
|
213
|
+
|
|
214
|
+
# @see WhopSDK::Models::SetupIntentListResponse::PaymentToken#card
|
|
215
|
+
class Card < WhopSDK::Internal::Type::BaseModel
|
|
216
|
+
# @!attribute brand
|
|
217
|
+
# Possible card brands that a payment token can have
|
|
218
|
+
#
|
|
219
|
+
# @return [Symbol, WhopSDK::Models::CardBrands, nil]
|
|
220
|
+
required :brand, enum: -> { WhopSDK::CardBrands }, nil?: true
|
|
221
|
+
|
|
222
|
+
# @!attribute exp_month
|
|
223
|
+
# Card expiration month, like 03 for March.
|
|
224
|
+
#
|
|
225
|
+
# @return [Integer, nil]
|
|
226
|
+
required :exp_month, Integer, nil?: true
|
|
227
|
+
|
|
228
|
+
# @!attribute exp_year
|
|
229
|
+
# Card expiration year, like 27 for 2027.
|
|
230
|
+
#
|
|
231
|
+
# @return [Integer, nil]
|
|
232
|
+
required :exp_year, Integer, nil?: true
|
|
233
|
+
|
|
234
|
+
# @!attribute last4
|
|
235
|
+
# Last four digits of the card.
|
|
236
|
+
#
|
|
237
|
+
# @return [String, nil]
|
|
238
|
+
required :last4, String, nil?: true
|
|
239
|
+
|
|
240
|
+
# @!method initialize(brand:, exp_month:, exp_year:, last4:)
|
|
241
|
+
# The card data associated with the payment token, if its a debit or credit card
|
|
242
|
+
# token.
|
|
243
|
+
#
|
|
244
|
+
# @param brand [Symbol, WhopSDK::Models::CardBrands, nil] Possible card brands that a payment token can have
|
|
245
|
+
#
|
|
246
|
+
# @param exp_month [Integer, nil] Card expiration month, like 03 for March.
|
|
247
|
+
#
|
|
248
|
+
# @param exp_year [Integer, nil] Card expiration year, like 27 for 2027.
|
|
249
|
+
#
|
|
250
|
+
# @param last4 [String, nil] Last four digits of the card.
|
|
251
|
+
end
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
end
|
|
255
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
class SetupIntentRequiresActionWebhookEvent < 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 setup intent, which is a flow for allowing a customer
|
|
20
|
+
# to add a payment method to their account without making a purchase.
|
|
21
|
+
#
|
|
22
|
+
# @return [WhopSDK::Models::SetupIntent]
|
|
23
|
+
required :data, -> { WhopSDK::SetupIntent }
|
|
24
|
+
|
|
25
|
+
# @!attribute timestamp
|
|
26
|
+
# The timestamp in ISO 8601 format that the webhook was sent at on the server
|
|
27
|
+
#
|
|
28
|
+
# @return [Time]
|
|
29
|
+
required :timestamp, Time
|
|
30
|
+
|
|
31
|
+
# @!attribute type
|
|
32
|
+
# The webhook event type
|
|
33
|
+
#
|
|
34
|
+
# @return [Symbol, :"setup_intent.requires_action"]
|
|
35
|
+
required :type, const: :"setup_intent.requires_action"
|
|
36
|
+
|
|
37
|
+
# @!method initialize(id:, data:, timestamp:, api_version: :v1, type: :"setup_intent.requires_action")
|
|
38
|
+
# Some parameter documentations has been truncated, see
|
|
39
|
+
# {WhopSDK::Models::SetupIntentRequiresActionWebhookEvent} for more details.
|
|
40
|
+
#
|
|
41
|
+
# @param id [String] A unique ID for every single webhook request
|
|
42
|
+
#
|
|
43
|
+
# @param data [WhopSDK::Models::SetupIntent] An object representing a setup intent, which is a flow for allowing a customer t
|
|
44
|
+
#
|
|
45
|
+
# @param timestamp [Time] The timestamp in ISO 8601 format that the webhook was sent at on the server
|
|
46
|
+
#
|
|
47
|
+
# @param api_version [Symbol, :v1] The API version for this webhook
|
|
48
|
+
#
|
|
49
|
+
# @param type [Symbol, :"setup_intent.requires_action"] The webhook event type
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see WhopSDK::Resources::SetupIntents#retrieve
|
|
6
|
+
class SetupIntentRetrieveParams < 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
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
# The status of the setup intent.
|
|
6
|
+
module SetupIntentStatus
|
|
7
|
+
extend WhopSDK::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
PROCESSING = :processing
|
|
10
|
+
SUCCEEDED = :succeeded
|
|
11
|
+
CANCELED = :canceled
|
|
12
|
+
REQUIRES_ACTION = :requires_action
|
|
13
|
+
|
|
14
|
+
# @!method self.values
|
|
15
|
+
# @return [Array<Symbol>]
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Models
|
|
5
|
+
class SetupIntentSucceededWebhookEvent < 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 setup intent, which is a flow for allowing a customer
|
|
20
|
+
# to add a payment method to their account without making a purchase.
|
|
21
|
+
#
|
|
22
|
+
# @return [WhopSDK::Models::SetupIntent]
|
|
23
|
+
required :data, -> { WhopSDK::SetupIntent }
|
|
24
|
+
|
|
25
|
+
# @!attribute timestamp
|
|
26
|
+
# The timestamp in ISO 8601 format that the webhook was sent at on the server
|
|
27
|
+
#
|
|
28
|
+
# @return [Time]
|
|
29
|
+
required :timestamp, Time
|
|
30
|
+
|
|
31
|
+
# @!attribute type
|
|
32
|
+
# The webhook event type
|
|
33
|
+
#
|
|
34
|
+
# @return [Symbol, :"setup_intent.succeeded"]
|
|
35
|
+
required :type, const: :"setup_intent.succeeded"
|
|
36
|
+
|
|
37
|
+
# @!method initialize(id:, data:, timestamp:, api_version: :v1, type: :"setup_intent.succeeded")
|
|
38
|
+
# Some parameter documentations has been truncated, see
|
|
39
|
+
# {WhopSDK::Models::SetupIntentSucceededWebhookEvent} for more details.
|
|
40
|
+
#
|
|
41
|
+
# @param id [String] A unique ID for every single webhook request
|
|
42
|
+
#
|
|
43
|
+
# @param data [WhopSDK::Models::SetupIntent] An object representing a setup intent, which is a flow for allowing a customer t
|
|
44
|
+
#
|
|
45
|
+
# @param timestamp [Time] The timestamp in ISO 8601 format that the webhook was sent at on the server
|
|
46
|
+
#
|
|
47
|
+
# @param api_version [Symbol, :v1] The API version for this webhook
|
|
48
|
+
#
|
|
49
|
+
# @param type [Symbol, :"setup_intent.succeeded"] The webhook event type
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -25,6 +25,12 @@ module WhopSDK
|
|
|
25
25
|
|
|
26
26
|
variant -> { WhopSDK::EntryDeletedWebhookEvent }
|
|
27
27
|
|
|
28
|
+
variant -> { WhopSDK::SetupIntentRequiresActionWebhookEvent }
|
|
29
|
+
|
|
30
|
+
variant -> { WhopSDK::SetupIntentSucceededWebhookEvent }
|
|
31
|
+
|
|
32
|
+
variant -> { WhopSDK::SetupIntentCanceledWebhookEvent }
|
|
33
|
+
|
|
28
34
|
variant -> { WhopSDK::CourseLessonInteractionCompletedWebhookEvent }
|
|
29
35
|
|
|
30
36
|
variant -> { WhopSDK::PaymentSucceededWebhookEvent }
|
|
@@ -42,7 +48,7 @@ module WhopSDK
|
|
|
42
48
|
variant -> { WhopSDK::RefundUpdatedWebhookEvent }
|
|
43
49
|
|
|
44
50
|
# @!method self.variants
|
|
45
|
-
# @return [Array(WhopSDK::Models::InvoiceCreatedWebhookEvent, WhopSDK::Models::InvoicePaidWebhookEvent, WhopSDK::Models::InvoicePastDueWebhookEvent, WhopSDK::Models::InvoiceVoidedWebhookEvent, WhopSDK::Models::MembershipActivatedWebhookEvent, WhopSDK::Models::MembershipDeactivatedWebhookEvent, WhopSDK::Models::EntryCreatedWebhookEvent, WhopSDK::Models::EntryApprovedWebhookEvent, WhopSDK::Models::EntryDeniedWebhookEvent, WhopSDK::Models::EntryDeletedWebhookEvent, WhopSDK::Models::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::Models::PaymentSucceededWebhookEvent, WhopSDK::Models::PaymentFailedWebhookEvent, WhopSDK::Models::PaymentPendingWebhookEvent, WhopSDK::Models::DisputeCreatedWebhookEvent, WhopSDK::Models::DisputeUpdatedWebhookEvent, WhopSDK::Models::RefundCreatedWebhookEvent, WhopSDK::Models::RefundUpdatedWebhookEvent)]
|
|
51
|
+
# @return [Array(WhopSDK::Models::InvoiceCreatedWebhookEvent, WhopSDK::Models::InvoicePaidWebhookEvent, WhopSDK::Models::InvoicePastDueWebhookEvent, WhopSDK::Models::InvoiceVoidedWebhookEvent, WhopSDK::Models::MembershipActivatedWebhookEvent, WhopSDK::Models::MembershipDeactivatedWebhookEvent, WhopSDK::Models::EntryCreatedWebhookEvent, WhopSDK::Models::EntryApprovedWebhookEvent, WhopSDK::Models::EntryDeniedWebhookEvent, WhopSDK::Models::EntryDeletedWebhookEvent, WhopSDK::Models::SetupIntentRequiresActionWebhookEvent, WhopSDK::Models::SetupIntentSucceededWebhookEvent, WhopSDK::Models::SetupIntentCanceledWebhookEvent, WhopSDK::Models::CourseLessonInteractionCompletedWebhookEvent, WhopSDK::Models::PaymentSucceededWebhookEvent, WhopSDK::Models::PaymentFailedWebhookEvent, WhopSDK::Models::PaymentPendingWebhookEvent, WhopSDK::Models::DisputeCreatedWebhookEvent, WhopSDK::Models::DisputeUpdatedWebhookEvent, WhopSDK::Models::RefundCreatedWebhookEvent, WhopSDK::Models::RefundUpdatedWebhookEvent)]
|
|
46
52
|
end
|
|
47
53
|
end
|
|
48
54
|
end
|
data/lib/whop_sdk/models.rb
CHANGED
|
@@ -344,6 +344,8 @@ module WhopSDK
|
|
|
344
344
|
|
|
345
345
|
Payment = WhopSDK::Models::Payment
|
|
346
346
|
|
|
347
|
+
PaymentCreateParams = WhopSDK::Models::PaymentCreateParams
|
|
348
|
+
|
|
347
349
|
PaymentFailedWebhookEvent = WhopSDK::Models::PaymentFailedWebhookEvent
|
|
348
350
|
|
|
349
351
|
PaymentListParams = WhopSDK::Models::PaymentListParams
|
|
@@ -362,6 +364,10 @@ module WhopSDK
|
|
|
362
364
|
|
|
363
365
|
PaymentSucceededWebhookEvent = WhopSDK::Models::PaymentSucceededWebhookEvent
|
|
364
366
|
|
|
367
|
+
PaymentTokenListParams = WhopSDK::Models::PaymentTokenListParams
|
|
368
|
+
|
|
369
|
+
PaymentTokenRetrieveParams = WhopSDK::Models::PaymentTokenRetrieveParams
|
|
370
|
+
|
|
365
371
|
PaymentVoidParams = WhopSDK::Models::PaymentVoidParams
|
|
366
372
|
|
|
367
373
|
Plan = WhopSDK::Models::Plan
|
|
@@ -440,6 +446,20 @@ module WhopSDK
|
|
|
440
446
|
|
|
441
447
|
ReviewStatus = WhopSDK::Models::ReviewStatus
|
|
442
448
|
|
|
449
|
+
SetupIntent = WhopSDK::Models::SetupIntent
|
|
450
|
+
|
|
451
|
+
SetupIntentCanceledWebhookEvent = WhopSDK::Models::SetupIntentCanceledWebhookEvent
|
|
452
|
+
|
|
453
|
+
SetupIntentListParams = WhopSDK::Models::SetupIntentListParams
|
|
454
|
+
|
|
455
|
+
SetupIntentRequiresActionWebhookEvent = WhopSDK::Models::SetupIntentRequiresActionWebhookEvent
|
|
456
|
+
|
|
457
|
+
SetupIntentRetrieveParams = WhopSDK::Models::SetupIntentRetrieveParams
|
|
458
|
+
|
|
459
|
+
SetupIntentStatus = WhopSDK::Models::SetupIntentStatus
|
|
460
|
+
|
|
461
|
+
SetupIntentSucceededWebhookEvent = WhopSDK::Models::SetupIntentSucceededWebhookEvent
|
|
462
|
+
|
|
443
463
|
Shipment = WhopSDK::Models::Shipment
|
|
444
464
|
|
|
445
465
|
ShipmentCarrier = WhopSDK::Models::ShipmentCarrier
|
|
@@ -12,7 +12,7 @@ module WhopSDK
|
|
|
12
12
|
#
|
|
13
13
|
# - `developer:manage_builds`
|
|
14
14
|
#
|
|
15
|
-
# @overload create(attachment:, checksum:, platform:, app_id: nil, supported_app_view_types: nil, request_options: {})
|
|
15
|
+
# @overload create(attachment:, checksum:, platform:, ai_prompt_id: nil, app_id: nil, supported_app_view_types: nil, request_options: {})
|
|
16
16
|
#
|
|
17
17
|
# @param attachment [WhopSDK::Models::AppBuildCreateParams::Attachment::AttachmentInputWithDirectUploadID, WhopSDK::Models::AppBuildCreateParams::Attachment::AttachmentInputWithID] Attachment input for the app build file. This should be an upload in .zip format
|
|
18
18
|
#
|
|
@@ -20,6 +20,8 @@ module WhopSDK
|
|
|
20
20
|
#
|
|
21
21
|
# @param platform [Symbol, WhopSDK::Models::AppBuildPlatforms] The platform of the app build (ios, android, web)
|
|
22
22
|
#
|
|
23
|
+
# @param ai_prompt_id [String, nil] The id of the ai prompt that created this build
|
|
24
|
+
#
|
|
23
25
|
# @param app_id [String, nil] The ID of the app to create a build for. By default the current app from the api
|
|
24
26
|
#
|
|
25
27
|
# @param supported_app_view_types [Array<Symbol, WhopSDK::Models::AppViewType>, nil] Supported app view types for the app build. A build can specify multiple view ty
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Resources
|
|
5
|
+
class PaymentTokens
|
|
6
|
+
# Retrieves a PaymentToken by ID
|
|
7
|
+
#
|
|
8
|
+
# Required permissions:
|
|
9
|
+
#
|
|
10
|
+
# - `member:payment_methods:read`
|
|
11
|
+
#
|
|
12
|
+
# @overload retrieve(id, member_id:, request_options: {})
|
|
13
|
+
#
|
|
14
|
+
# @param id [String] The ID of the PaymentToken
|
|
15
|
+
#
|
|
16
|
+
# @param member_id [String] The ID of the Member associated with the PaymentToken
|
|
17
|
+
#
|
|
18
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
19
|
+
#
|
|
20
|
+
# @return [WhopSDK::Models::PaymentTokenRetrieveResponse]
|
|
21
|
+
#
|
|
22
|
+
# @see WhopSDK::Models::PaymentTokenRetrieveParams
|
|
23
|
+
def retrieve(id, params)
|
|
24
|
+
parsed, options = WhopSDK::PaymentTokenRetrieveParams.dump_request(params)
|
|
25
|
+
@client.request(
|
|
26
|
+
method: :get,
|
|
27
|
+
path: ["payment_tokens/%1$s", id],
|
|
28
|
+
query: parsed,
|
|
29
|
+
model: WhopSDK::Models::PaymentTokenRetrieveResponse,
|
|
30
|
+
options: options
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Lists PaymentTokens
|
|
35
|
+
#
|
|
36
|
+
# Required permissions:
|
|
37
|
+
#
|
|
38
|
+
# - `member:payment_methods:read`
|
|
39
|
+
#
|
|
40
|
+
# @overload list(member_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {})
|
|
41
|
+
#
|
|
42
|
+
# @param member_id [String] The ID of the Member to list payment tokens for
|
|
43
|
+
#
|
|
44
|
+
# @param after [String, nil] Returns the elements in the list that come after the specified cursor.
|
|
45
|
+
#
|
|
46
|
+
# @param before [String, nil] Returns the elements in the list that come before the specified cursor.
|
|
47
|
+
#
|
|
48
|
+
# @param created_after [Time, nil] The minimum creation date to filter by
|
|
49
|
+
#
|
|
50
|
+
# @param created_before [Time, nil] The maximum creation date to filter by
|
|
51
|
+
#
|
|
52
|
+
# @param direction [Symbol, WhopSDK::Models::Direction, nil] The direction of the sort.
|
|
53
|
+
#
|
|
54
|
+
# @param first [Integer, nil] Returns the first _n_ elements from the list.
|
|
55
|
+
#
|
|
56
|
+
# @param last [Integer, nil] Returns the last _n_ elements from the list.
|
|
57
|
+
#
|
|
58
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
59
|
+
#
|
|
60
|
+
# @return [WhopSDK::Internal::CursorPage<WhopSDK::Models::PaymentTokenListResponse>]
|
|
61
|
+
#
|
|
62
|
+
# @see WhopSDK::Models::PaymentTokenListParams
|
|
63
|
+
def list(params)
|
|
64
|
+
parsed, options = WhopSDK::PaymentTokenListParams.dump_request(params)
|
|
65
|
+
@client.request(
|
|
66
|
+
method: :get,
|
|
67
|
+
path: "payment_tokens",
|
|
68
|
+
query: parsed,
|
|
69
|
+
page: WhopSDK::Internal::CursorPage,
|
|
70
|
+
model: WhopSDK::Models::PaymentTokenListResponse,
|
|
71
|
+
options: options
|
|
72
|
+
)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# @api private
|
|
76
|
+
#
|
|
77
|
+
# @param client [WhopSDK::Client]
|
|
78
|
+
def initialize(client:)
|
|
79
|
+
@client = client
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -3,6 +3,54 @@
|
|
|
3
3
|
module WhopSDK
|
|
4
4
|
module Resources
|
|
5
5
|
class Payments
|
|
6
|
+
# Some parameter documentations has been truncated, see
|
|
7
|
+
# {WhopSDK::Models::PaymentCreateParams} for more details.
|
|
8
|
+
#
|
|
9
|
+
# Creates a payment. This endpoint will respond with a payment object immediately,
|
|
10
|
+
# but the payment is processed asynchronously in the background. Use webhooks to
|
|
11
|
+
# be notified when the payment succeeds or fails.
|
|
12
|
+
#
|
|
13
|
+
# Required permissions:
|
|
14
|
+
#
|
|
15
|
+
# - `payment:charge`
|
|
16
|
+
# - `plan:create`
|
|
17
|
+
# - `access_pass:create`
|
|
18
|
+
# - `access_pass:update`
|
|
19
|
+
# - `plan:basic:read`
|
|
20
|
+
# - `access_pass:basic:read`
|
|
21
|
+
# - `member:email:read`
|
|
22
|
+
# - `member:basic:read`
|
|
23
|
+
# - `member:phone:read`
|
|
24
|
+
# - `promo_code:basic:read`
|
|
25
|
+
#
|
|
26
|
+
# @overload create(company_id:, member_id:, payment_token_id:, plan:, plan_id:, request_options: {})
|
|
27
|
+
#
|
|
28
|
+
# @param company_id [String] The ID of the company to create the payment for.
|
|
29
|
+
#
|
|
30
|
+
# @param member_id [String] The ID of the member to create the payment for.
|
|
31
|
+
#
|
|
32
|
+
# @param payment_token_id [String] The ID of the payment token to use for the payment. It must be connected to the
|
|
33
|
+
#
|
|
34
|
+
# @param plan [WhopSDK::Models::PaymentCreateParams::Plan] Pass this object to create a new plan for this payment
|
|
35
|
+
#
|
|
36
|
+
# @param plan_id [String] An ID of an existing plan to use for the payment.
|
|
37
|
+
#
|
|
38
|
+
# @param request_options [WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
39
|
+
#
|
|
40
|
+
# @return [WhopSDK::Models::Payment]
|
|
41
|
+
#
|
|
42
|
+
# @see WhopSDK::Models::PaymentCreateParams
|
|
43
|
+
def create(params)
|
|
44
|
+
parsed, options = WhopSDK::PaymentCreateParams.dump_request(params)
|
|
45
|
+
@client.request(
|
|
46
|
+
method: :post,
|
|
47
|
+
path: "payments",
|
|
48
|
+
body: parsed,
|
|
49
|
+
model: WhopSDK::Payment,
|
|
50
|
+
options: options
|
|
51
|
+
)
|
|
52
|
+
end
|
|
53
|
+
|
|
6
54
|
# Retrieves a payment by ID
|
|
7
55
|
#
|
|
8
56
|
# Required permissions:
|