Class: WhopSDK::Resources::CheckoutConfigurations
- Inherits:
-
Object
- Object
- WhopSDK::Resources::CheckoutConfigurations
- Defined in:
- lib/whop_sdk/resources/checkout_configurations.rb,
sig/whop_sdk/resources/checkout_configurations.rbs
Overview
A Checkout Configuration is a reusable checkout link owned by an account. In
payment mode it sells a specific plan; in setup mode it collects and saves
payment details without charging. Each configuration can also override which
payment methods are accepted and how 3D Secure is enforced for that checkout.
Use the Checkout Configurations API to create checkout links for an existing or inline plan, list configurations for an account, retrieve the configuration behind a checkout URL, and delete links that should no longer be used.
Instance Method Summary collapse
-
#create(affiliate_code: nil, company_id: nil, currency: nil, metadata: nil, mode: nil, payment_method_configuration: nil, plan: nil, plan_id: nil, redirect_url: nil, three_ds_level: nil, request_options: {}) ⇒ WhopSDK::Models::CheckoutConfigurationCreateResponse
Some parameter documentations has been truncated, see Models::CheckoutConfigurationCreateParams for more details.
-
#delete(id, request_options: {}) ⇒ nil
Deletes a checkout configuration so its checkout URL can no longer be used.
-
#initialize(client:) ⇒ CheckoutConfigurations
constructor
private
A new instance of CheckoutConfigurations.
-
#list(company_id:, after: nil, created_after: nil, created_before: nil, direction: nil, first: nil, order: nil, plan_id: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::CheckoutConfigurationListResponse>
Lists checkout configurations for an account.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::CheckoutConfigurationRetrieveResponse
Retrieves a checkout configuration by ID.
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.
139 140 141 |
# File 'lib/whop_sdk/resources/checkout_configurations.rb', line 139 def initialize(client:) @client = client end |
Instance Method Details
#create(affiliate_code: nil, company_id: nil, currency: nil, metadata: nil, mode: nil, payment_method_configuration: nil, plan: nil, plan_id: nil, redirect_url: nil, three_ds_level: nil, request_options: {}) ⇒ WhopSDK::Models::CheckoutConfigurationCreateResponse
Some parameter documentations has been truncated, see Models::CheckoutConfigurationCreateParams for more details.
Creates a reusable checkout configuration for an existing or inline plan.
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/whop_sdk/resources/checkout_configurations.rb', line 46 def create(params = {}) parsed, = WhopSDK::CheckoutConfigurationCreateParams.dump_request(params) @client.request( method: :post, path: "checkout_configurations", body: parsed, model: WhopSDK::Models::CheckoutConfigurationCreateResponse, options: ) end |
#delete(id, request_options: {}) ⇒ nil
Deletes a checkout configuration so its checkout URL can no longer be used.
127 128 129 130 131 132 133 134 |
# File 'lib/whop_sdk/resources/checkout_configurations.rb', line 127 def delete(id, params = {}) @client.request( method: :delete, path: ["checkout_configurations/%1$s", id], model: NilClass, options: params[:request_options] ) end |
#list(company_id:, after: nil, created_after: nil, created_before: nil, direction: nil, first: nil, order: nil, plan_id: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::CheckoutConfigurationListResponse>
Lists checkout configurations for an account.
103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/whop_sdk/resources/checkout_configurations.rb', line 103 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::CheckoutConfigurationRetrieveResponse
Retrieves a checkout configuration by ID. This endpoint is public so a checkout page can load from the configuration URL.
69 70 71 72 73 74 75 76 |
# File 'lib/whop_sdk/resources/checkout_configurations.rb', line 69 def retrieve(id, params = {}) @client.request( method: :get, path: ["checkout_configurations/%1$s", id], model: WhopSDK::Models::CheckoutConfigurationRetrieveResponse, options: params[:request_options] ) end |