Class: Leetchi::Beneficiary
- Defined in:
- lib/leetchi/beneficiary.rb
Overview
A beneficiary is an item who is the target of withdrawal. It’s the object that contains the bank details for a withdrawal. A beneficiary can be linked to a user.
Class Method Summary collapse
-
.create(data) ⇒ Object
Create a beneficiary.
-
.create_strong_authentication(beneficiary_id, data) ⇒ Object
Create a strong authentication for a given beneficiary.
-
.details(beneficiary_id) ⇒ Object
Get a beneficiary.
-
.get_strong_authentication(beneficiary_id) ⇒ Object
Get the strong authentication for a given beneficiary.
-
.update_strong_authentication(beneficiary_id, data) ⇒ Object
Update a strong authentication object for a given beneficiary.
Class Method Details
.create(data) ⇒ Object
Create a beneficiary
-
Args :
-
data
-> A JSON with the following attributes (Square brackets for optionals):* [Tag] * [UserID] * BankAccountOwnerName * BankAccountIBAN * BankAccountBIC
-
-
Returns :
-
A beneficiary object in case of success
-
19 20 21 |
# File 'lib/leetchi/beneficiary.rb', line 19 def self.create(data) post_request('beneficiaries', data) end |
.create_strong_authentication(beneficiary_id, data) ⇒ Object
Create a strong authentication for a given beneficiary
-
Args :
-
beneficiary_id
-> The id of the beneficiary you want strongly authenticate -
data
-> A JSON with the following attributes (Square brackets for optionals):* [Tag]
-
-
Returns :
-
A strong authentication object
-
43 44 45 |
# File 'lib/leetchi/beneficiary.rb', line 43 def self.create_strong_authentication(beneficiary_id, data) post_request(File.join('beneficiaries', beneficiary_id.to_s, 'strongAuthentication'), data) end |
.details(beneficiary_id) ⇒ Object
Get a beneficiary
-
Args :
-
beneficiary_id
-> The id of the beneficiary you want to get
-
-
Returns :
-
A beneficiary object if it exists
-
30 31 32 |
# File 'lib/leetchi/beneficiary.rb', line 30 def self.details(beneficiary_id) get_request(File.join('beneficiaries', beneficiary_id.to_s)) end |
.get_strong_authentication(beneficiary_id) ⇒ Object
Get the strong authentication for a given beneficiary
-
Args :
-
beneficiary_id
-> The id of the beneficiary you want strongly authenticate
-
-
Returns :
-
A strong authentication object
-
54 55 56 |
# File 'lib/leetchi/beneficiary.rb', line 54 def self.get_strong_authentication(beneficiary_id) get_request(File.join('beneficiaries', beneficiary_id.to_s, 'strongAuthentication')) end |
.update_strong_authentication(beneficiary_id, data) ⇒ Object
Update a strong authentication object for a given beneficiary
-
Args :
-
beneficiary_id
-> The id of the beneficiary you want strongly authenticate -
data
-> A JSON with the following attributes (Square brackets for optionals):* [Tag] * [IsDocumentsTransmitted]
-
-
Returns :
-
A strong authentication object
-
68 69 70 |
# File 'lib/leetchi/beneficiary.rb', line 68 def self.update_strong_authentication(beneficiary_id, data) put_request(File.join('beneficiaries', beneficiary_id.to_s, 'strongAuthentication'), data) end |