module MangoApi::SettlementTransfers

Provides API method delegates concerning the SettlementTransfer entity

Public Class Methods

create(repudiation_id, transfer) click to toggle source

Creates a new settlement transfer entity.

SettlementTransfer properties:

  • Required

    • author_id

    • debited_funds

    • fees

  • Optional

    • tag

@param repudiation_id [String] ID of the corresponding repudiation @param transfer [SettlementTransfer] model object of the settlement transfer to be created @return [SettlementTransfer] the newly-created SettlementTransfer entity object

# File lib/mangopay/api/service/settlement_transfers.rb, line 25
def create(repudiation_id, transfer)
  uri = provide_uri(:create_settlement_transfer, repudiation_id)
  response = HttpClient.post(uri, transfer)
  parse response
end
get(id) click to toggle source

Retrieves a settlement transfer entity.

@param id [String] ID of the settlement transfer to retrieve @return [SettlementTransfer] the requested SettlementTransfer entity object

# File lib/mangopay/api/service/settlement_transfers.rb, line 36
def get(id)
  uri = provide_uri(:get_settlement_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 SettlementTransfer entity object.

@param response [Hash] JSON-originating data hash @return [SettlementTransfer] corresponding SettlementTransfer entity object

# File lib/mangopay/api/service/settlement_transfers.rb, line 50
def parse(response)
  MangoModel::SettlementTransfer.new.dejsonify response
end