Class: Trolley::RecipientAccountGateway

Inherits:
Object
  • Object
show all
Defined in:
lib/trolley/gateways/RecipientAccountGateway.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ RecipientAccountGateway

Returns a new instance of RecipientAccountGateway.



5
6
7
# File 'lib/trolley/gateways/RecipientAccountGateway.rb', line 5

def initialize(client)
  @client = client
end

Instance Method Details

#all(recipient_id) ⇒ Object



14
15
16
17
# File 'lib/trolley/gateways/RecipientAccountGateway.rb', line 14

def all(recipient_id)
  response = @client.get("/v1/recipients/#{recipient_id}/accounts/")
  (response)
end

#create(recipient_id, body) ⇒ Object



19
20
21
22
# File 'lib/trolley/gateways/RecipientAccountGateway.rb', line 19

def create(recipient_id, body)
  response = @client.post("/v1/recipients/#{recipient_id}/accounts", body)
  (response)
end

#delete(recipient_id, recipient_account_id) ⇒ Object



29
30
31
32
# File 'lib/trolley/gateways/RecipientAccountGateway.rb', line 29

def delete(recipient_id, )
  @client.delete("/v1/recipients/#{recipient_id}/accounts/#{}")
  true
end

#find(recipient_id, recipient_account_id) ⇒ Object



9
10
11
12
# File 'lib/trolley/gateways/RecipientAccountGateway.rb', line 9

def find(recipient_id, )
  response = @client.get("/v1/recipients/#{recipient_id}/accounts/#{}")
  (response)
end

#recipient_account_builder(response) ⇒ Object



34
35
36
# File 'lib/trolley/gateways/RecipientAccountGateway.rb', line 34

def (response)
  Utils::ResponseMapper.build(response, RecipientAccount)
end

#recipient_account_list_builder(response) ⇒ Object



38
39
40
# File 'lib/trolley/gateways/RecipientAccountGateway.rb', line 38

def (response)
  Utils::PaginatedArray.from_response(response, RecipientAccount)
end

#update(recipient_id, recipient_account_id, body) ⇒ Object



24
25
26
27
# File 'lib/trolley/gateways/RecipientAccountGateway.rb', line 24

def update(recipient_id, , body)
  response = @client.patch("/v1/recipients/#{recipient_id}/accounts/#{}", body)
  (response)
end