Class: PaystackSdk::Resources::TransferRecipients
- Defined in:
- lib/paystack_sdk/resources/transfer_recipients.rb
Constant Summary
Constants included from Utils::ConnectionUtils
Utils::ConnectionUtils::BASE_URL
Instance Method Summary collapse
-
#create(params) ⇒ Object
Create a transfer recipient.
-
#delete(recipient_code:) ⇒ Object
Delete a transfer recipient.
-
#fetch(recipient_code:) ⇒ Object
Fetch a transfer recipient.
-
#list(query = {}) ⇒ Object
List transfer recipients.
-
#update(recipient_code:, params:) ⇒ Object
Update a transfer recipient.
Methods inherited from Base
Methods included from Utils::ConnectionUtils
#create_connection, #initialize_connection
Methods included from Validations
#validate_allowed_values!, #validate_currency!, #validate_date_format!, #validate_email!, #validate_fields!, #validate_hash!, #validate_positive_integer!, #validate_presence!, #validate_reference_format!, #validate_required_params!
Constructor Details
This class inherits a constructor from PaystackSdk::Resources::Base
Instance Method Details
#create(params) ⇒ Object
Create a transfer recipient
8 9 10 11 12 13 14 15 16 |
# File 'lib/paystack_sdk/resources/transfer_recipients.rb', line 8 def create(params) validate_hash!(input: params, name: "TransferRecipient params") validate_required_params!( payload: params, required_params: i[type name account_number bank_code], operation_name: "Create Transfer Recipient" ) handle_response(@connection.post("/transferrecipient", params)) end |
#delete(recipient_code:) ⇒ Object
Delete a transfer recipient
41 42 43 44 |
# File 'lib/paystack_sdk/resources/transfer_recipients.rb', line 41 def delete(recipient_code:) validate_presence!(value: recipient_code, name: "recipient_code") handle_response(@connection.delete("/transferrecipient/#{recipient_code}")) end |
#fetch(recipient_code:) ⇒ Object
Fetch a transfer recipient
26 27 28 29 |
# File 'lib/paystack_sdk/resources/transfer_recipients.rb', line 26 def fetch(recipient_code:) validate_presence!(value: recipient_code, name: "recipient_code") handle_response(@connection.get("/transferrecipient/#{recipient_code}")) end |
#list(query = {}) ⇒ Object
List transfer recipients
20 21 22 |
# File 'lib/paystack_sdk/resources/transfer_recipients.rb', line 20 def list(query = {}) handle_response(@connection.get("/transferrecipient", query)) end |
#update(recipient_code:, params:) ⇒ Object
Update a transfer recipient
33 34 35 36 37 |
# File 'lib/paystack_sdk/resources/transfer_recipients.rb', line 33 def update(recipient_code:, params:) validate_presence!(value: recipient_code, name: "recipient_code") validate_hash!(input: params, name: "Update TransferRecipient params") handle_response(@connection.put("/transferrecipient/#{recipient_code}", params)) end |