Module: MangoApi::Transfers

Extended by:
UriProvider
Defined in:
lib/mangopay/api/service/transfers.rb

Overview

Provides API method delegates concerning the Transfer entity

Class Method Summary collapse

Methods included from UriProvider

provide_uri

Class Method Details

.create(transfer, id_key = nil) ⇒ Transfer

Creates a new transfer entity.

Transfer properties:

  • Required

    • author_id

    • debited_funds

    • fees

    • debited_wallet_id

    • credited_wallet_id

  • Optional

    • tag

    • credited_user_id

Parameters:

  • +transfer+ (Transfer)

    model object of transfer to be created

  • +id_key+ (String)

    idempotency key for future response replication

Returns:

  • (Transfer)

    the newly-created Transfer entity object



26
27
28
29
30
# 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) ⇒ Transfer

Retrieves a transfer entity.

Parameters:

  • +id+ (String)

    ID of the transfer to be retrieved

Returns:

  • (Transfer)

    the requested entity object



36
37
38
39
40
# 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