Class: StraddlePay::Resources::EmbedOrganizations
- Defined in:
- lib/straddle_pay/resources/embed_organizations.rb
Overview
Manage organizations for embedded accounts. Accessed via StraddlePay::Resources::Embed#organizations.
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
-
#create(name:, **options) ⇒ Hash
Create an organization.
-
#get(id, **options) ⇒ Hash
Retrieve an organization by ID.
-
#list(**options) ⇒ Hash
List organizations with optional filters.
Methods inherited from Base
Constructor Details
This class inherits a constructor from StraddlePay::Resources::Base
Instance Method Details
#create(name:, **options) ⇒ Hash
Create an organization.
12 13 14 15 16 |
# File 'lib/straddle_pay/resources/embed_organizations.rb', line 12 def create(name:, **) payload = { name: name, ** }.compact headers = extract_headers(payload) @client.post("v1/organizations", payload, headers: headers) end |
#get(id, **options) ⇒ Hash
Retrieve an organization by ID.
22 23 24 25 |
# File 'lib/straddle_pay/resources/embed_organizations.rb', line 22 def get(id, **) headers = extract_headers() @client.get("v1/organizations/#{id}", headers: headers) end |
#list(**options) ⇒ Hash
List organizations with optional filters.
30 31 32 33 |
# File 'lib/straddle_pay/resources/embed_organizations.rb', line 30 def list(**) headers = extract_headers() @client.get("v1/organizations", params: , headers: headers) end |