Module: MangoApi::PayOuts

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

Overview

Provides API method delegates concerning the PayOut entity

Class Method Summary collapse

Methods included from UriProvider

provide_uri

Class Method Details

.create(pay_out, id_key = nil) ⇒ PayOut

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

Parameters:

  • +pay_out+ (PayOut)

    model object of the pay-out to be created

  • +id_key+ (String)

    idempotency key for future response replication

Returns:

  • (PayOut)

    the newly-created PayOut entity object



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

Retrieves a pay-out entity.

Parameters:

  • +id+ (String)

    ID of the pay-out to retrieve

Returns:

  • (PayOut)

    the requested PayOut entity object



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