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
data/rbi/whop_sdk/models.rbi
CHANGED
|
@@ -316,6 +316,8 @@ module WhopSDK
|
|
|
316
316
|
|
|
317
317
|
Payment = WhopSDK::Models::Payment
|
|
318
318
|
|
|
319
|
+
PaymentCreateParams = WhopSDK::Models::PaymentCreateParams
|
|
320
|
+
|
|
319
321
|
PaymentFailedWebhookEvent = WhopSDK::Models::PaymentFailedWebhookEvent
|
|
320
322
|
|
|
321
323
|
PaymentListParams = WhopSDK::Models::PaymentListParams
|
|
@@ -334,6 +336,10 @@ module WhopSDK
|
|
|
334
336
|
|
|
335
337
|
PaymentSucceededWebhookEvent = WhopSDK::Models::PaymentSucceededWebhookEvent
|
|
336
338
|
|
|
339
|
+
PaymentTokenListParams = WhopSDK::Models::PaymentTokenListParams
|
|
340
|
+
|
|
341
|
+
PaymentTokenRetrieveParams = WhopSDK::Models::PaymentTokenRetrieveParams
|
|
342
|
+
|
|
337
343
|
PaymentVoidParams = WhopSDK::Models::PaymentVoidParams
|
|
338
344
|
|
|
339
345
|
Plan = WhopSDK::Models::Plan
|
|
@@ -412,6 +418,23 @@ module WhopSDK
|
|
|
412
418
|
|
|
413
419
|
ReviewStatus = WhopSDK::Models::ReviewStatus
|
|
414
420
|
|
|
421
|
+
SetupIntent = WhopSDK::Models::SetupIntent
|
|
422
|
+
|
|
423
|
+
SetupIntentCanceledWebhookEvent =
|
|
424
|
+
WhopSDK::Models::SetupIntentCanceledWebhookEvent
|
|
425
|
+
|
|
426
|
+
SetupIntentListParams = WhopSDK::Models::SetupIntentListParams
|
|
427
|
+
|
|
428
|
+
SetupIntentRequiresActionWebhookEvent =
|
|
429
|
+
WhopSDK::Models::SetupIntentRequiresActionWebhookEvent
|
|
430
|
+
|
|
431
|
+
SetupIntentRetrieveParams = WhopSDK::Models::SetupIntentRetrieveParams
|
|
432
|
+
|
|
433
|
+
SetupIntentStatus = WhopSDK::Models::SetupIntentStatus
|
|
434
|
+
|
|
435
|
+
SetupIntentSucceededWebhookEvent =
|
|
436
|
+
WhopSDK::Models::SetupIntentSucceededWebhookEvent
|
|
437
|
+
|
|
415
438
|
Shipment = WhopSDK::Models::Shipment
|
|
416
439
|
|
|
417
440
|
ShipmentCarrier = WhopSDK::Models::ShipmentCarrier
|
|
@@ -17,6 +17,7 @@ module WhopSDK
|
|
|
17
17
|
),
|
|
18
18
|
checksum: String,
|
|
19
19
|
platform: WhopSDK::AppBuildPlatforms::OrSymbol,
|
|
20
|
+
ai_prompt_id: T.nilable(String),
|
|
20
21
|
app_id: T.nilable(String),
|
|
21
22
|
supported_app_view_types:
|
|
22
23
|
T.nilable(T::Array[WhopSDK::AppViewType::OrSymbol]),
|
|
@@ -34,6 +35,8 @@ module WhopSDK
|
|
|
34
35
|
checksum:,
|
|
35
36
|
# The platform of the app build (ios, android, web)
|
|
36
37
|
platform:,
|
|
38
|
+
# The id of the ai prompt that created this build
|
|
39
|
+
ai_prompt_id: nil,
|
|
37
40
|
# The ID of the app to create a build for. By default the current app from the api
|
|
38
41
|
# key is used.
|
|
39
42
|
app_id: nil,
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# typed: strong
|
|
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
|
+
sig do
|
|
12
|
+
params(
|
|
13
|
+
id: String,
|
|
14
|
+
member_id: String,
|
|
15
|
+
request_options: WhopSDK::RequestOptions::OrHash
|
|
16
|
+
).returns(WhopSDK::Models::PaymentTokenRetrieveResponse)
|
|
17
|
+
end
|
|
18
|
+
def retrieve(
|
|
19
|
+
# The ID of the PaymentToken
|
|
20
|
+
id,
|
|
21
|
+
# The ID of the Member associated with the PaymentToken
|
|
22
|
+
member_id:,
|
|
23
|
+
request_options: {}
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Lists PaymentTokens
|
|
28
|
+
#
|
|
29
|
+
# Required permissions:
|
|
30
|
+
#
|
|
31
|
+
# - `member:payment_methods:read`
|
|
32
|
+
sig do
|
|
33
|
+
params(
|
|
34
|
+
member_id: String,
|
|
35
|
+
after: T.nilable(String),
|
|
36
|
+
before: T.nilable(String),
|
|
37
|
+
created_after: T.nilable(Time),
|
|
38
|
+
created_before: T.nilable(Time),
|
|
39
|
+
direction: T.nilable(WhopSDK::Direction::OrSymbol),
|
|
40
|
+
first: T.nilable(Integer),
|
|
41
|
+
last: T.nilable(Integer),
|
|
42
|
+
request_options: WhopSDK::RequestOptions::OrHash
|
|
43
|
+
).returns(
|
|
44
|
+
WhopSDK::Internal::CursorPage[
|
|
45
|
+
WhopSDK::Models::PaymentTokenListResponse
|
|
46
|
+
]
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
def list(
|
|
50
|
+
# The ID of the Member to list payment tokens for
|
|
51
|
+
member_id:,
|
|
52
|
+
# Returns the elements in the list that come after the specified cursor.
|
|
53
|
+
after: nil,
|
|
54
|
+
# Returns the elements in the list that come before the specified cursor.
|
|
55
|
+
before: nil,
|
|
56
|
+
# The minimum creation date to filter by
|
|
57
|
+
created_after: nil,
|
|
58
|
+
# The maximum creation date to filter by
|
|
59
|
+
created_before: nil,
|
|
60
|
+
# The direction of the sort.
|
|
61
|
+
direction: nil,
|
|
62
|
+
# Returns the first _n_ elements from the list.
|
|
63
|
+
first: nil,
|
|
64
|
+
# Returns the last _n_ elements from the list.
|
|
65
|
+
last: nil,
|
|
66
|
+
request_options: {}
|
|
67
|
+
)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# @api private
|
|
71
|
+
sig { params(client: WhopSDK::Client).returns(T.attached_class) }
|
|
72
|
+
def self.new(client:)
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
@@ -3,6 +3,48 @@
|
|
|
3
3
|
module WhopSDK
|
|
4
4
|
module Resources
|
|
5
5
|
class Payments
|
|
6
|
+
# Creates a payment. This endpoint will respond with a payment object immediately,
|
|
7
|
+
# but the payment is processed asynchronously in the background. Use webhooks to
|
|
8
|
+
# be notified when the payment succeeds or fails.
|
|
9
|
+
#
|
|
10
|
+
# Required permissions:
|
|
11
|
+
#
|
|
12
|
+
# - `payment:charge`
|
|
13
|
+
# - `plan:create`
|
|
14
|
+
# - `access_pass:create`
|
|
15
|
+
# - `access_pass:update`
|
|
16
|
+
# - `plan:basic:read`
|
|
17
|
+
# - `access_pass:basic:read`
|
|
18
|
+
# - `member:email:read`
|
|
19
|
+
# - `member:basic:read`
|
|
20
|
+
# - `member:phone:read`
|
|
21
|
+
# - `promo_code:basic:read`
|
|
22
|
+
sig do
|
|
23
|
+
params(
|
|
24
|
+
company_id: String,
|
|
25
|
+
member_id: String,
|
|
26
|
+
payment_token_id: String,
|
|
27
|
+
plan: WhopSDK::PaymentCreateParams::Plan::OrHash,
|
|
28
|
+
plan_id: String,
|
|
29
|
+
request_options: WhopSDK::RequestOptions::OrHash
|
|
30
|
+
).returns(WhopSDK::Payment)
|
|
31
|
+
end
|
|
32
|
+
def create(
|
|
33
|
+
# The ID of the company to create the payment for.
|
|
34
|
+
company_id:,
|
|
35
|
+
# The ID of the member to create the payment for.
|
|
36
|
+
member_id:,
|
|
37
|
+
# The ID of the payment token to use for the payment. It must be connected to the
|
|
38
|
+
# Member being charged.
|
|
39
|
+
payment_token_id:,
|
|
40
|
+
# Pass this object to create a new plan for this payment
|
|
41
|
+
plan:,
|
|
42
|
+
# An ID of an existing plan to use for the payment.
|
|
43
|
+
plan_id:,
|
|
44
|
+
request_options: {}
|
|
45
|
+
)
|
|
46
|
+
end
|
|
47
|
+
|
|
6
48
|
# Retrieves a payment by ID
|
|
7
49
|
#
|
|
8
50
|
# Required permissions:
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module WhopSDK
|
|
4
|
+
module Resources
|
|
5
|
+
class SetupIntents
|
|
6
|
+
# Retrieves a Setup Intent by ID
|
|
7
|
+
#
|
|
8
|
+
# Required permissions:
|
|
9
|
+
#
|
|
10
|
+
# - `payment:setup_intent:read`
|
|
11
|
+
# - `member:basic:read`
|
|
12
|
+
# - `member:email:read`
|
|
13
|
+
sig do
|
|
14
|
+
params(
|
|
15
|
+
id: String,
|
|
16
|
+
request_options: WhopSDK::RequestOptions::OrHash
|
|
17
|
+
).returns(WhopSDK::SetupIntent)
|
|
18
|
+
end
|
|
19
|
+
def retrieve(
|
|
20
|
+
# The ID of the Setup Intent
|
|
21
|
+
id,
|
|
22
|
+
request_options: {}
|
|
23
|
+
)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Lists Setup Intents
|
|
27
|
+
#
|
|
28
|
+
# Required permissions:
|
|
29
|
+
#
|
|
30
|
+
# - `payment:setup_intent:read`
|
|
31
|
+
# - `member:basic:read`
|
|
32
|
+
# - `member:email:read`
|
|
33
|
+
sig do
|
|
34
|
+
params(
|
|
35
|
+
company_id: String,
|
|
36
|
+
after: T.nilable(String),
|
|
37
|
+
before: T.nilable(String),
|
|
38
|
+
created_after: T.nilable(Time),
|
|
39
|
+
created_before: T.nilable(Time),
|
|
40
|
+
direction: T.nilable(WhopSDK::Direction::OrSymbol),
|
|
41
|
+
first: T.nilable(Integer),
|
|
42
|
+
last: T.nilable(Integer),
|
|
43
|
+
request_options: WhopSDK::RequestOptions::OrHash
|
|
44
|
+
).returns(
|
|
45
|
+
WhopSDK::Internal::CursorPage[
|
|
46
|
+
WhopSDK::Models::SetupIntentListResponse
|
|
47
|
+
]
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
def list(
|
|
51
|
+
# The ID of the company to list setup intents for
|
|
52
|
+
company_id:,
|
|
53
|
+
# Returns the elements in the list that come after the specified cursor.
|
|
54
|
+
after: nil,
|
|
55
|
+
# Returns the elements in the list that come before the specified cursor.
|
|
56
|
+
before: nil,
|
|
57
|
+
# The minimum creation date to filter by
|
|
58
|
+
created_after: nil,
|
|
59
|
+
# The maximum creation date to filter by
|
|
60
|
+
created_before: nil,
|
|
61
|
+
# The direction of the sort.
|
|
62
|
+
direction: nil,
|
|
63
|
+
# Returns the first _n_ elements from the list.
|
|
64
|
+
first: nil,
|
|
65
|
+
# Returns the last _n_ elements from the list.
|
|
66
|
+
last: nil,
|
|
67
|
+
request_options: {}
|
|
68
|
+
)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# @api private
|
|
72
|
+
sig { params(client: WhopSDK::Client).returns(T.attached_class) }
|
|
73
|
+
def self.new(client:)
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -16,6 +16,9 @@ module WhopSDK
|
|
|
16
16
|
WhopSDK::EntryApprovedWebhookEvent,
|
|
17
17
|
WhopSDK::EntryDeniedWebhookEvent,
|
|
18
18
|
WhopSDK::EntryDeletedWebhookEvent,
|
|
19
|
+
WhopSDK::SetupIntentRequiresActionWebhookEvent,
|
|
20
|
+
WhopSDK::SetupIntentSucceededWebhookEvent,
|
|
21
|
+
WhopSDK::SetupIntentCanceledWebhookEvent,
|
|
19
22
|
WhopSDK::CourseLessonInteractionCompletedWebhookEvent,
|
|
20
23
|
WhopSDK::PaymentSucceededWebhookEvent,
|
|
21
24
|
WhopSDK::PaymentFailedWebhookEvent,
|
data/sig/whop_sdk/client.rbs
CHANGED
|
@@ -86,6 +86,10 @@ module WhopSDK
|
|
|
86
86
|
|
|
87
87
|
attr_reader account_links: WhopSDK::Resources::AccountLinks
|
|
88
88
|
|
|
89
|
+
attr_reader setup_intents: WhopSDK::Resources::SetupIntents
|
|
90
|
+
|
|
91
|
+
attr_reader payment_tokens: WhopSDK::Resources::PaymentTokens
|
|
92
|
+
|
|
89
93
|
private def auth_headers: -> ::Hash[String, String]
|
|
90
94
|
|
|
91
95
|
def initialize: (
|
|
@@ -5,6 +5,7 @@ module WhopSDK
|
|
|
5
5
|
attachment: WhopSDK::Models::AppBuildCreateParams::attachment,
|
|
6
6
|
checksum: String,
|
|
7
7
|
platform: WhopSDK::Models::app_build_platforms,
|
|
8
|
+
ai_prompt_id: String?,
|
|
8
9
|
app_id: String?,
|
|
9
10
|
supported_app_view_types: ::Array[WhopSDK::Models::app_view_type]?
|
|
10
11
|
}
|
|
@@ -20,6 +21,8 @@ module WhopSDK
|
|
|
20
21
|
|
|
21
22
|
attr_accessor platform: WhopSDK::Models::app_build_platforms
|
|
22
23
|
|
|
24
|
+
attr_accessor ai_prompt_id: String?
|
|
25
|
+
|
|
23
26
|
attr_accessor app_id: String?
|
|
24
27
|
|
|
25
28
|
attr_accessor supported_app_view_types: ::Array[WhopSDK::Models::app_view_type]?
|
|
@@ -28,6 +31,7 @@ module WhopSDK
|
|
|
28
31
|
attachment: WhopSDK::Models::AppBuildCreateParams::attachment,
|
|
29
32
|
checksum: String,
|
|
30
33
|
platform: WhopSDK::Models::app_build_platforms,
|
|
34
|
+
?ai_prompt_id: String?,
|
|
31
35
|
?app_id: String?,
|
|
32
36
|
?supported_app_view_types: ::Array[WhopSDK::Models::app_view_type]?,
|
|
33
37
|
?request_options: WhopSDK::request_opts
|
|
@@ -37,6 +41,7 @@ module WhopSDK
|
|
|
37
41
|
attachment: WhopSDK::Models::AppBuildCreateParams::attachment,
|
|
38
42
|
checksum: String,
|
|
39
43
|
platform: WhopSDK::Models::app_build_platforms,
|
|
44
|
+
ai_prompt_id: String?,
|
|
40
45
|
app_id: String?,
|
|
41
46
|
supported_app_view_types: ::Array[WhopSDK::Models::app_view_type]?,
|
|
42
47
|
request_options: WhopSDK::RequestOptions
|
|
@@ -20,6 +20,7 @@ module WhopSDK
|
|
|
20
20
|
metadata: ::Hash[Symbol, top]?,
|
|
21
21
|
paid_at: Time?,
|
|
22
22
|
payment_method_type: WhopSDK::Models::payment_method_types?,
|
|
23
|
+
payment_token: WhopSDK::Payment::PaymentToken?,
|
|
23
24
|
plan: WhopSDK::Payment::Plan?,
|
|
24
25
|
product: WhopSDK::Payment::Product?,
|
|
25
26
|
promo_code: WhopSDK::Payment::PromoCode?,
|
|
@@ -73,6 +74,8 @@ module WhopSDK
|
|
|
73
74
|
|
|
74
75
|
attr_accessor payment_method_type: WhopSDK::Models::payment_method_types?
|
|
75
76
|
|
|
77
|
+
attr_accessor payment_token: WhopSDK::Payment::PaymentToken?
|
|
78
|
+
|
|
76
79
|
attr_accessor plan: WhopSDK::Payment::Plan?
|
|
77
80
|
|
|
78
81
|
attr_accessor product: WhopSDK::Payment::Product?
|
|
@@ -120,6 +123,7 @@ module WhopSDK
|
|
|
120
123
|
metadata: ::Hash[Symbol, top]?,
|
|
121
124
|
paid_at: Time?,
|
|
122
125
|
payment_method_type: WhopSDK::Models::payment_method_types?,
|
|
126
|
+
payment_token: WhopSDK::Payment::PaymentToken?,
|
|
123
127
|
plan: WhopSDK::Payment::Plan?,
|
|
124
128
|
product: WhopSDK::Payment::Product?,
|
|
125
129
|
promo_code: WhopSDK::Payment::PromoCode?,
|
|
@@ -155,6 +159,7 @@ module WhopSDK
|
|
|
155
159
|
metadata: ::Hash[Symbol, top]?,
|
|
156
160
|
paid_at: Time?,
|
|
157
161
|
payment_method_type: WhopSDK::Models::payment_method_types?,
|
|
162
|
+
payment_token: WhopSDK::Payment::PaymentToken?,
|
|
158
163
|
plan: WhopSDK::Payment::Plan?,
|
|
159
164
|
product: WhopSDK::Payment::Product?,
|
|
160
165
|
promo_code: WhopSDK::Payment::PromoCode?,
|
|
@@ -263,6 +268,70 @@ module WhopSDK
|
|
|
263
268
|
}
|
|
264
269
|
end
|
|
265
270
|
|
|
271
|
+
type payment_token =
|
|
272
|
+
{
|
|
273
|
+
id: String,
|
|
274
|
+
card: WhopSDK::Payment::PaymentToken::Card?,
|
|
275
|
+
created_at: Time,
|
|
276
|
+
payment_method_type: WhopSDK::Models::payment_method_types
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
class PaymentToken < WhopSDK::Internal::Type::BaseModel
|
|
280
|
+
attr_accessor id: String
|
|
281
|
+
|
|
282
|
+
attr_accessor card: WhopSDK::Payment::PaymentToken::Card?
|
|
283
|
+
|
|
284
|
+
attr_accessor created_at: Time
|
|
285
|
+
|
|
286
|
+
attr_accessor payment_method_type: WhopSDK::Models::payment_method_types
|
|
287
|
+
|
|
288
|
+
def initialize: (
|
|
289
|
+
id: String,
|
|
290
|
+
card: WhopSDK::Payment::PaymentToken::Card?,
|
|
291
|
+
created_at: Time,
|
|
292
|
+
payment_method_type: WhopSDK::Models::payment_method_types
|
|
293
|
+
) -> void
|
|
294
|
+
|
|
295
|
+
def to_hash: -> {
|
|
296
|
+
id: String,
|
|
297
|
+
card: WhopSDK::Payment::PaymentToken::Card?,
|
|
298
|
+
created_at: Time,
|
|
299
|
+
payment_method_type: WhopSDK::Models::payment_method_types
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
type card =
|
|
303
|
+
{
|
|
304
|
+
brand: WhopSDK::Models::card_brands?,
|
|
305
|
+
exp_month: Integer?,
|
|
306
|
+
exp_year: Integer?,
|
|
307
|
+
:last4 => String?
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
class Card < WhopSDK::Internal::Type::BaseModel
|
|
311
|
+
attr_accessor brand: WhopSDK::Models::card_brands?
|
|
312
|
+
|
|
313
|
+
attr_accessor exp_month: Integer?
|
|
314
|
+
|
|
315
|
+
attr_accessor exp_year: Integer?
|
|
316
|
+
|
|
317
|
+
attr_accessor last4: String?
|
|
318
|
+
|
|
319
|
+
def initialize: (
|
|
320
|
+
brand: WhopSDK::Models::card_brands?,
|
|
321
|
+
exp_month: Integer?,
|
|
322
|
+
exp_year: Integer?,
|
|
323
|
+
last4: String?
|
|
324
|
+
) -> void
|
|
325
|
+
|
|
326
|
+
def to_hash: -> {
|
|
327
|
+
brand: WhopSDK::Models::card_brands?,
|
|
328
|
+
exp_month: Integer?,
|
|
329
|
+
exp_year: Integer?,
|
|
330
|
+
:last4 => String?
|
|
331
|
+
}
|
|
332
|
+
end
|
|
333
|
+
end
|
|
334
|
+
|
|
266
335
|
type plan = { id: String }
|
|
267
336
|
|
|
268
337
|
class Plan < WhopSDK::Internal::Type::BaseModel
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
module WhopSDK
|
|
2
|
+
module Models
|
|
3
|
+
type payment_create_params =
|
|
4
|
+
{
|
|
5
|
+
company_id: String,
|
|
6
|
+
member_id: String,
|
|
7
|
+
payment_token_id: String,
|
|
8
|
+
plan: WhopSDK::PaymentCreateParams::Plan,
|
|
9
|
+
plan_id: String
|
|
10
|
+
}
|
|
11
|
+
& WhopSDK::Internal::Type::request_parameters
|
|
12
|
+
|
|
13
|
+
class PaymentCreateParams < WhopSDK::Internal::Type::BaseModel
|
|
14
|
+
extend WhopSDK::Internal::Type::RequestParameters::Converter
|
|
15
|
+
include WhopSDK::Internal::Type::RequestParameters
|
|
16
|
+
|
|
17
|
+
attr_accessor company_id: String
|
|
18
|
+
|
|
19
|
+
attr_accessor member_id: String
|
|
20
|
+
|
|
21
|
+
attr_accessor payment_token_id: String
|
|
22
|
+
|
|
23
|
+
attr_accessor plan: WhopSDK::PaymentCreateParams::Plan
|
|
24
|
+
|
|
25
|
+
attr_accessor plan_id: String
|
|
26
|
+
|
|
27
|
+
def initialize: (
|
|
28
|
+
company_id: String,
|
|
29
|
+
member_id: String,
|
|
30
|
+
payment_token_id: String,
|
|
31
|
+
plan: WhopSDK::PaymentCreateParams::Plan,
|
|
32
|
+
plan_id: String,
|
|
33
|
+
?request_options: WhopSDK::request_opts
|
|
34
|
+
) -> void
|
|
35
|
+
|
|
36
|
+
def to_hash: -> {
|
|
37
|
+
company_id: String,
|
|
38
|
+
member_id: String,
|
|
39
|
+
payment_token_id: String,
|
|
40
|
+
plan: WhopSDK::PaymentCreateParams::Plan,
|
|
41
|
+
plan_id: String,
|
|
42
|
+
request_options: WhopSDK::RequestOptions
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type plan =
|
|
46
|
+
{
|
|
47
|
+
currency: WhopSDK::Models::currency,
|
|
48
|
+
billing_period: Integer?,
|
|
49
|
+
description: String?,
|
|
50
|
+
expiration_days: Integer?,
|
|
51
|
+
force_create_new_plan: bool?,
|
|
52
|
+
initial_price: Float?,
|
|
53
|
+
internal_notes: String?,
|
|
54
|
+
plan_type: WhopSDK::Models::plan_type?,
|
|
55
|
+
product: WhopSDK::PaymentCreateParams::Plan::Product?,
|
|
56
|
+
product_id: String?,
|
|
57
|
+
renewal_price: Float?,
|
|
58
|
+
title: String?,
|
|
59
|
+
trial_period_days: Integer?,
|
|
60
|
+
visibility: WhopSDK::Models::visibility?
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
class Plan < WhopSDK::Internal::Type::BaseModel
|
|
64
|
+
attr_accessor currency: WhopSDK::Models::currency
|
|
65
|
+
|
|
66
|
+
attr_accessor billing_period: Integer?
|
|
67
|
+
|
|
68
|
+
attr_accessor description: String?
|
|
69
|
+
|
|
70
|
+
attr_accessor expiration_days: Integer?
|
|
71
|
+
|
|
72
|
+
attr_accessor force_create_new_plan: bool?
|
|
73
|
+
|
|
74
|
+
attr_accessor initial_price: Float?
|
|
75
|
+
|
|
76
|
+
attr_accessor internal_notes: String?
|
|
77
|
+
|
|
78
|
+
attr_accessor plan_type: WhopSDK::Models::plan_type?
|
|
79
|
+
|
|
80
|
+
attr_accessor product: WhopSDK::PaymentCreateParams::Plan::Product?
|
|
81
|
+
|
|
82
|
+
attr_accessor product_id: String?
|
|
83
|
+
|
|
84
|
+
attr_accessor renewal_price: Float?
|
|
85
|
+
|
|
86
|
+
attr_accessor title: String?
|
|
87
|
+
|
|
88
|
+
attr_accessor trial_period_days: Integer?
|
|
89
|
+
|
|
90
|
+
attr_accessor visibility: WhopSDK::Models::visibility?
|
|
91
|
+
|
|
92
|
+
def initialize: (
|
|
93
|
+
currency: WhopSDK::Models::currency,
|
|
94
|
+
?billing_period: Integer?,
|
|
95
|
+
?description: String?,
|
|
96
|
+
?expiration_days: Integer?,
|
|
97
|
+
?force_create_new_plan: bool?,
|
|
98
|
+
?initial_price: Float?,
|
|
99
|
+
?internal_notes: String?,
|
|
100
|
+
?plan_type: WhopSDK::Models::plan_type?,
|
|
101
|
+
?product: WhopSDK::PaymentCreateParams::Plan::Product?,
|
|
102
|
+
?product_id: String?,
|
|
103
|
+
?renewal_price: Float?,
|
|
104
|
+
?title: String?,
|
|
105
|
+
?trial_period_days: Integer?,
|
|
106
|
+
?visibility: WhopSDK::Models::visibility?
|
|
107
|
+
) -> void
|
|
108
|
+
|
|
109
|
+
def to_hash: -> {
|
|
110
|
+
currency: WhopSDK::Models::currency,
|
|
111
|
+
billing_period: Integer?,
|
|
112
|
+
description: String?,
|
|
113
|
+
expiration_days: Integer?,
|
|
114
|
+
force_create_new_plan: bool?,
|
|
115
|
+
initial_price: Float?,
|
|
116
|
+
internal_notes: String?,
|
|
117
|
+
plan_type: WhopSDK::Models::plan_type?,
|
|
118
|
+
product: WhopSDK::PaymentCreateParams::Plan::Product?,
|
|
119
|
+
product_id: String?,
|
|
120
|
+
renewal_price: Float?,
|
|
121
|
+
title: String?,
|
|
122
|
+
trial_period_days: Integer?,
|
|
123
|
+
visibility: WhopSDK::Models::visibility?
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
type product =
|
|
127
|
+
{
|
|
128
|
+
external_identifier: String,
|
|
129
|
+
title: String,
|
|
130
|
+
business_type: WhopSDK::Models::business_types?,
|
|
131
|
+
collect_shipping_address: bool?,
|
|
132
|
+
custom_statement_descriptor: String?,
|
|
133
|
+
description: String?,
|
|
134
|
+
global_affiliate_percentage: Float?,
|
|
135
|
+
global_affiliate_status: WhopSDK::Models::global_affiliate_status?,
|
|
136
|
+
headline: String?,
|
|
137
|
+
industry_type: WhopSDK::Models::industry_types?,
|
|
138
|
+
product_tax_code_id: String?,
|
|
139
|
+
redirect_purchase_url: String?,
|
|
140
|
+
route: String?,
|
|
141
|
+
visibility: WhopSDK::Models::visibility?
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
class Product < WhopSDK::Internal::Type::BaseModel
|
|
145
|
+
attr_accessor external_identifier: String
|
|
146
|
+
|
|
147
|
+
attr_accessor title: String
|
|
148
|
+
|
|
149
|
+
attr_accessor business_type: WhopSDK::Models::business_types?
|
|
150
|
+
|
|
151
|
+
attr_accessor collect_shipping_address: bool?
|
|
152
|
+
|
|
153
|
+
attr_accessor custom_statement_descriptor: String?
|
|
154
|
+
|
|
155
|
+
attr_accessor description: String?
|
|
156
|
+
|
|
157
|
+
attr_accessor global_affiliate_percentage: Float?
|
|
158
|
+
|
|
159
|
+
attr_accessor global_affiliate_status: WhopSDK::Models::global_affiliate_status?
|
|
160
|
+
|
|
161
|
+
attr_accessor headline: String?
|
|
162
|
+
|
|
163
|
+
attr_accessor industry_type: WhopSDK::Models::industry_types?
|
|
164
|
+
|
|
165
|
+
attr_accessor product_tax_code_id: String?
|
|
166
|
+
|
|
167
|
+
attr_accessor redirect_purchase_url: String?
|
|
168
|
+
|
|
169
|
+
attr_accessor route: String?
|
|
170
|
+
|
|
171
|
+
attr_accessor visibility: WhopSDK::Models::visibility?
|
|
172
|
+
|
|
173
|
+
def initialize: (
|
|
174
|
+
external_identifier: String,
|
|
175
|
+
title: String,
|
|
176
|
+
?business_type: WhopSDK::Models::business_types?,
|
|
177
|
+
?collect_shipping_address: bool?,
|
|
178
|
+
?custom_statement_descriptor: String?,
|
|
179
|
+
?description: String?,
|
|
180
|
+
?global_affiliate_percentage: Float?,
|
|
181
|
+
?global_affiliate_status: WhopSDK::Models::global_affiliate_status?,
|
|
182
|
+
?headline: String?,
|
|
183
|
+
?industry_type: WhopSDK::Models::industry_types?,
|
|
184
|
+
?product_tax_code_id: String?,
|
|
185
|
+
?redirect_purchase_url: String?,
|
|
186
|
+
?route: String?,
|
|
187
|
+
?visibility: WhopSDK::Models::visibility?
|
|
188
|
+
) -> void
|
|
189
|
+
|
|
190
|
+
def to_hash: -> {
|
|
191
|
+
external_identifier: String,
|
|
192
|
+
title: String,
|
|
193
|
+
business_type: WhopSDK::Models::business_types?,
|
|
194
|
+
collect_shipping_address: bool?,
|
|
195
|
+
custom_statement_descriptor: String?,
|
|
196
|
+
description: String?,
|
|
197
|
+
global_affiliate_percentage: Float?,
|
|
198
|
+
global_affiliate_status: WhopSDK::Models::global_affiliate_status?,
|
|
199
|
+
headline: String?,
|
|
200
|
+
industry_type: WhopSDK::Models::industry_types?,
|
|
201
|
+
product_tax_code_id: String?,
|
|
202
|
+
redirect_purchase_url: String?,
|
|
203
|
+
route: String?,
|
|
204
|
+
visibility: WhopSDK::Models::visibility?
|
|
205
|
+
}
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
end
|