module MangoApi::Transfers
Provides API method delegates concerning the Transfer
entity
Public Class Methods
create(transfer, id_key = nil)
click to toggle source
Creates a new transfer entity.
Transfer
properties:
-
Required
-
author_id
-
debited_funds
-
fees
-
debited_wallet_id
-
credited_wallet_id
-
-
Optional
-
tag
-
credited_user_id
-
@param transfer
[Transfer] model object of transfer to be created @param id_key
[String] idempotency key for future response replication @return [Transfer] the newly-created Transfer entity object
# File lib/mangopay/api/service/transfers.rb, line 26 def create(transfer, id_key = nil) uri = provide_uri(:create_transfer) response = HttpClient.post(uri, transfer, id_key) parse response end
get(id)
click to toggle source
Retrieves a transfer entity.
@param id
[String] ID of the transfer to be retrieved @return [Transfer] the requested entity object
# File lib/mangopay/api/service/transfers.rb, line 36 def get(id) uri = provide_uri(:get_transfer, id) response = HttpClient.get(uri) parse response end
Private Class Methods
parse(response)
click to toggle source
Parses a JSON-originating hash into the corresponding Transfer entity object.
@param response
[Hash] JSON-originating data hash @return [Transfer] corresponding Transfer entity object
# File lib/mangopay/api/service/transfers.rb, line 49 def parse(response) MangoModel::Transfer.new.dejsonify response end