Class: WhopSDK::Resources::SetupIntents
- Inherits:
-
Object
- Object
- WhopSDK::Resources::SetupIntents
- Defined in:
- lib/whop_sdk/resources/setup_intents.rb
Overview
Setup intents
Instance Method Summary collapse
-
#initialize(client:) ⇒ SetupIntents
constructor
private
A new instance of SetupIntents.
-
#list(company_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::SetupIntentListResponse>
Returns a paginated list of setup intents for a company, with optional filtering by creation date.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::SetupIntent
Retrieves the details of an existing setup intent.
Constructor Details
#initialize(client:) ⇒ SetupIntents
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 SetupIntents.
82 83 84 |
# File 'lib/whop_sdk/resources/setup_intents.rb', line 82 def initialize(client:) @client = client end |
Instance Method Details
#list(company_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::SetupIntentListResponse>
Returns a paginated list of setup intents for a company, with optional filtering by creation date. A setup intent securely collects and stores a member’s payment method for future use without charging them immediately.
Required permissions:
-
‘payment:setup_intent:read`
-
‘member:basic:read`
-
‘member:email:read`
66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/whop_sdk/resources/setup_intents.rb', line 66 def list(params) parsed, = WhopSDK::SetupIntentListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "setup_intents", query: query, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::SetupIntentListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::SetupIntent
Retrieves the details of an existing setup intent.
Required permissions:
-
‘payment:setup_intent:read`
-
‘member:basic:read`
-
‘member:email:read`
24 25 26 27 28 29 30 31 |
# File 'lib/whop_sdk/resources/setup_intents.rb', line 24 def retrieve(id, params = {}) @client.request( method: :get, path: ["setup_intents/%1$s", id], model: WhopSDK::SetupIntent, options: params[:request_options] ) end |