module MangoApi::PayOuts

Provides API method delegates concerning the PayOut entity

Public Class Methods

create(pay_out, id_key = nil) click to toggle source

Creates a new pay-out entity.

PayOut properties:

  • Required

    • author_id

    • debited_funds

    • fees

    • bank_account_id

    • debited_wallet_id

  • Optional

    • tag

    • bank_wire_ref

@param pay_out [PayOut] model object of the pay-out to be created @param id_key [String] idempotency key for future response replication @return [PayOut] the newly-created PayOut entity object

# File lib/mangopay/api/service/pay_outs.rb, line 26
def create(pay_out, id_key = nil)
  uri = provide_uri(:create_pay_out)
  response = HttpClient.post(uri, pay_out, id_key)
  parse response
end
get(id) click to toggle source

Retrieves a pay-out entity.

@param id [String] ID of the pay-out to retrieve @return [PayOut] the requested PayOut entity object

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

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

# File lib/mangopay/api/service/pay_outs.rb, line 49
def parse(response)
  MangoModel::PayOut.new.dejsonify response
end