Class: WhopSDK::Resources::CheckoutConfigurations
- Inherits:
-
Object
- Object
- WhopSDK::Resources::CheckoutConfigurations
- Defined in:
- lib/whop_sdk/resources/checkout_configurations.rb
Overview
Checkout configurations
Instance Method Summary collapse
-
#create(body:, request_options: {}) ⇒ WhopSDK::Models::CheckoutConfiguration
Creates a new checkout configuration.
-
#initialize(client:) ⇒ CheckoutConfigurations
constructor
private
A new instance of CheckoutConfigurations.
-
#list(company_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, plan_id: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::CheckoutConfigurationListResponse>
Some parameter documentations has been truncated, see Models::CheckoutConfigurationListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::CheckoutConfiguration
Retrieves the details of an existing checkout configuration.
Constructor Details
#initialize(client:) ⇒ CheckoutConfigurations
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of CheckoutConfigurations.
112 113 114 |
# File 'lib/whop_sdk/resources/checkout_configurations.rb', line 112 def initialize(client:) @client = client end |
Instance Method Details
#create(body:, request_options: {}) ⇒ WhopSDK::Models::CheckoutConfiguration
Creates a new checkout configuration
Required permissions:
-
‘checkout_configuration:create`
-
‘plan:create`
-
‘access_pass:create`
-
‘access_pass:update`
-
‘checkout_configuration:basic:read`
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/whop_sdk/resources/checkout_configurations.rb', line 26 def create(params) parsed, = WhopSDK::CheckoutConfigurationCreateParams.dump_request(params) @client.request( method: :post, path: "checkout_configurations", body: parsed[:body], model: WhopSDK::CheckoutConfiguration, options: ) end |
#list(company_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, plan_id: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::CheckoutConfigurationListResponse>
Some parameter documentations has been truncated, see Models::CheckoutConfigurationListParams for more details.
Returns a paginated list of checkout configurations for a company, with optional filtering by plan and creation date.
Required permissions:
-
‘checkout_configuration:basic:read`
96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/whop_sdk/resources/checkout_configurations.rb', line 96 def list(params) parsed, = WhopSDK::CheckoutConfigurationListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "checkout_configurations", query: query, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::CheckoutConfigurationListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::CheckoutConfiguration
Retrieves the details of an existing checkout configuration.
Required permissions:
-
‘checkout_configuration:basic:read`
52 53 54 55 56 57 58 59 |
# File 'lib/whop_sdk/resources/checkout_configurations.rb', line 52 def retrieve(id, params = {}) @client.request( method: :get, path: ["checkout_configurations/%1$s", id], model: WhopSDK::CheckoutConfiguration, options: params[:request_options] ) end |