Class: StraddlePay::Resources::EmbedRepresentatives
- Defined in:
- lib/straddle_pay/resources/embed_representatives.rb
Overview
Manage representatives for embedded accounts. Accessed via StraddlePay::Resources::Embed#representatives.
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
-
#create(account_id:, first_name:, last_name:, email:, dob:, mobile_number:, relationship:, ssn_last4:, **options) ⇒ Hash
Create a representative.
-
#get(id, **options) ⇒ Hash
Retrieve a representative by ID.
-
#list(**options) ⇒ Hash
List representatives with optional filters.
-
#unmask(id, **options) ⇒ Hash
Retrieve unmasked representative details.
-
#update(id, **options) ⇒ Hash
Update a representative.
Methods inherited from Base
Constructor Details
This class inherits a constructor from StraddlePay::Resources::Base
Instance Method Details
#create(account_id:, first_name:, last_name:, email:, dob:, mobile_number:, relationship:, ssn_last4:, **options) ⇒ Hash
Create a representative.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/straddle_pay/resources/embed_representatives.rb', line 19 def create(account_id:, first_name:, last_name:, email:, dob:, mobile_number:, relationship:, ssn_last4:, **) payload = { account_id: account_id, first_name: first_name, last_name: last_name, email: email, dob: dob, mobile_number: mobile_number, relationship: relationship, ssn_last4: ssn_last4, ** }.compact headers = extract_headers(payload) @client.post("v1/representatives", payload, headers: headers) end |
#get(id, **options) ⇒ Hash
Retrieve a representative by ID.
34 35 36 37 |
# File 'lib/straddle_pay/resources/embed_representatives.rb', line 34 def get(id, **) headers = extract_headers() @client.get("v1/representatives/#{id}", headers: headers) end |
#list(**options) ⇒ Hash
List representatives with optional filters.
42 43 44 45 |
# File 'lib/straddle_pay/resources/embed_representatives.rb', line 42 def list(**) headers = extract_headers() @client.get("v1/representatives", params: , headers: headers) end |
#unmask(id, **options) ⇒ Hash
Retrieve unmasked representative details.
60 61 62 63 |
# File 'lib/straddle_pay/resources/embed_representatives.rb', line 60 def unmask(id, **) headers = extract_headers() @client.get("v1/representatives/#{id}/unmask", headers: headers) end |
#update(id, **options) ⇒ Hash
Update a representative.
51 52 53 54 |
# File 'lib/straddle_pay/resources/embed_representatives.rb', line 51 def update(id, **) headers = extract_headers() @client.put("v1/representatives/#{id}", , headers: headers) end |