Class: WhopSDK::Resources::PaymentMethods
- Inherits:
-
Object
- Object
- WhopSDK::Resources::PaymentMethods
- Defined in:
- lib/whop_sdk/resources/payment_methods.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ PaymentMethods
constructor
private
A new instance of PaymentMethods.
-
#list(member_id: , after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::PaymentMethodListResponse>
A payment method is a stored representation of how a customer intends to pay, such as a card, bank account, or digital wallet.
-
#retrieve(id, member_id: , request_options: {}) ⇒ WhopSDK::Models::PaymentMethodRetrieveResponse
A payment method is a stored representation of how a customer intends to pay, such as a card, bank account, or digital wallet.
Constructor Details
#initialize(client:) ⇒ PaymentMethods
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 PaymentMethods.
86 87 88 |
# File 'lib/whop_sdk/resources/payment_methods.rb', line 86 def initialize(client:) @client = client end |
Instance Method Details
#list(member_id: , after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::PaymentMethodListResponse>
A payment method is a stored representation of how a customer intends to pay, such as a card, bank account, or digital wallet. It holds the necessary billing details and can be attached to a member for future one-time or recurring charges. This lets you reuse the same payment credentials across multiple payments.
Required permissions:
-
‘member:payment_methods:read`
71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/whop_sdk/resources/payment_methods.rb', line 71 def list(params) parsed, = WhopSDK::PaymentMethodListParams.dump_request(params) @client.request( method: :get, path: "payment_methods", query: parsed, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::PaymentMethodListResponse, options: ) end |
#retrieve(id, member_id: , request_options: {}) ⇒ WhopSDK::Models::PaymentMethodRetrieveResponse
A payment method is a stored representation of how a customer intends to pay, such as a card, bank account, or digital wallet. It holds the necessary billing details and can be attached to a member for future one-time or recurring charges. This lets you reuse the same payment credentials across multiple payments.
Required permissions:
-
‘member:payment_methods:read`
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/whop_sdk/resources/payment_methods.rb', line 27 def retrieve(id, params) parsed, = WhopSDK::PaymentMethodRetrieveParams.dump_request(params) @client.request( method: :get, path: ["payment_methods/%1$s", id], query: parsed, model: WhopSDK::Models::PaymentMethodRetrieveResponse, options: ) end |