Class: MangoPay::UboDeclaration
- Defined in:
- lib/mangopay/ubo_declaration.rb
Overview
Provides API methods for the UBO declaration entity.
Class Method Summary collapse
- .create(user_id, idempotency_key = nil) ⇒ Object
-
.fetch(user_id, id, idempotency_key = nil) ⇒ Object
Fetches the Ubo declaration belonging to the given
user_id
if given, with the givenid
. - .update(user_id, id, params = {}, idempotency_key = nil) ⇒ Object
- .url(user_id, id = nil) ⇒ Object
Methods inherited from Resource
Class Method Details
.create(user_id, idempotency_key = nil) ⇒ Object
13 14 15 |
# File 'lib/mangopay/ubo_declaration.rb', line 13 def create(user_id, idempotency_key = nil) MangoPay.request(:post, url(user_id), {}, {}, idempotency_key) end |
.fetch(user_id, id, idempotency_key = nil) ⇒ Object
Fetches the Ubo declaration belonging to the given user_id
if given, with the given id
.
18 19 20 21 |
# File 'lib/mangopay/ubo_declaration.rb', line 18 def fetch(user_id, id, idempotency_key = nil) url = (user_id) ? url(user_id, id) : "#{MangoPay.api_path}/kyc/ubodeclarations/#{CGI.escape(id.to_s)}" MangoPay.request(:get, url, {}, {}, idempotency_key) end |
.update(user_id, id, params = {}, idempotency_key = nil) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/mangopay/ubo_declaration.rb', line 23 def update(user_id, id, params = {}, idempotency_key = nil) request_params = { Status: params['Status'], Ubos: params['Ubos'] } MangoPay.request(:put, url(user_id, id), request_params, {}, idempotency_key) end |