Class: Zspay::Transfer
- Defined in:
- lib/zspay/resources/transfer.rb
Overview
The Transfer class manages transfer-related actions within the Zspay platform. It provides methods to create, schedule, and remove transfers, extending from Zspay::Resource.
Class Method Summary collapse
-
.create(transfer, custom_token = nil) ⇒ OpenStruct
Creates a new transfer on the Zspay platform.
-
.remove(transfer_id, custom_token = nil) ⇒ OpenStruct
Cancels a scheduled transfer.
-
.schedule_transfer(transfer_id, custom_token = nil) ⇒ OpenStruct
Retrieves the details of a scheduled transfer.
Methods inherited from Resource
delete, endpoint, get, headers, parse_body, parse_json, patch, post, put, req, req_form, req_json, success_request?
Class Method Details
.create(transfer, custom_token = nil) ⇒ OpenStruct
Creates a new transfer on the Zspay platform.
This method sends a POST request to create a new transfer with the provided details.
15 16 17 |
# File 'lib/zspay/resources/transfer.rb', line 15 def create(transfer, custom_token = nil) post("/transferencias", transfer, custom_token) end |
.remove(transfer_id, custom_token = nil) ⇒ OpenStruct
Cancels a scheduled transfer.
This method sends a DELETE request to remove a previously scheduled transfer from the system.
37 38 39 |
# File 'lib/zspay/resources/transfer.rb', line 37 def remove(transfer_id, custom_token = nil) delete("/transferencias/agendadas/#{transfer_id}", custom_token) end |
.schedule_transfer(transfer_id, custom_token = nil) ⇒ OpenStruct
Retrieves the details of a scheduled transfer.
This method sends a GET request to obtain details about a transfer that has been scheduled.
26 27 28 |
# File 'lib/zspay/resources/transfer.rb', line 26 def schedule_transfer(transfer_id, custom_token = nil) get("/transferencias/agendadas/#{transfer_id}", custom_token) end |