Class: Increase::Resources::AccountTransfers

Inherits:
Object
  • Object
show all
Defined in:
lib/increase/resources/account_transfers.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ AccountTransfers

Returns a new instance of AccountTransfers.



6
7
8
# File 'lib/increase/resources/account_transfers.rb', line 6

def initialize(client:)
  @client = client
end

Instance Method Details

#approve(account_transfer_id, opts = {}) ⇒ Increase::Models::AccountTransfer

Approve an Account Transfer

Parameters:

  • account_transfer_id (String)

    The identifier of the Account Transfer to approve.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



78
79
80
81
82
83
84
# File 'lib/increase/resources/account_transfers.rb', line 78

def approve(, opts = {})
  req = {}
  req[:method] = :post
  req[:path] = "/account_transfers/#{}/approve"
  req[:model] = Increase::Models::AccountTransfer
  @client.request(req, opts)
end

#cancel(account_transfer_id, opts = {}) ⇒ Increase::Models::AccountTransfer

Cancel an Account Transfer

Parameters:

  • account_transfer_id (String)

    The identifier of the pending Account Transfer to cancel.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



92
93
94
95
96
97
98
# File 'lib/increase/resources/account_transfers.rb', line 92

def cancel(, opts = {})
  req = {}
  req[:method] = :post
  req[:path] = "/account_transfers/#{}/cancel"
  req[:model] = Increase::Models::AccountTransfer
  @client.request(req, opts)
end

#create(params = {}, opts = {}) ⇒ Increase::Models::AccountTransfer

Create an Account Transfer

Parameters:

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :account_id (String)

    The identifier for the account that will send the transfer.

  • :amount (Integer)

    The transfer amount in the minor unit of the account currency. For dollars, for example, this is cents.

  • :description (String)

    The description you choose to give the transfer.

  • :destination_account_id (String)

    The identifier for the account that will receive the transfer.

  • :require_approval (Boolean)

    Whether the transfer requires explicit approval via the dashboard or API.

Returns:



23
24
25
26
27
28
29
30
# File 'lib/increase/resources/account_transfers.rb', line 23

def create(params = {}, opts = {})
  req = {}
  req[:method] = :post
  req[:path] = "/account_transfers"
  req[:body] = params
  req[:model] = Increase::Models::AccountTransfer
  @client.request(req, opts)
end

#list(params = {}, opts = {}) ⇒ Increase::Page<Increase::Models::AccountTransfer>

List Account Transfers

Parameters:

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :account_id (String)

    Filter Account Transfers to those that originated from the specified Account.

  • :created_at (CreatedAt)
  • :cursor (String)

    Return the page of entries after this one.

  • :idempotency_key (String)

    Filter records to the one with the specified idempotency_key you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about idempotency.

  • :limit (Integer)

    Limit the size of the list that is returned. The default (and maximum) is 100 objects.

Returns:



62
63
64
65
66
67
68
69
70
# File 'lib/increase/resources/account_transfers.rb', line 62

def list(params = {}, opts = {})
  req = {}
  req[:method] = :get
  req[:path] = "/account_transfers"
  req[:query] = params
  req[:page] = Increase::Page
  req[:model] = Increase::Models::AccountTransfer
  @client.request(req, opts)
end

#retrieve(account_transfer_id, opts = {}) ⇒ Increase::Models::AccountTransfer

Retrieve an Account Transfer

Parameters:

  • account_transfer_id (String)

    The identifier of the Account Transfer.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



38
39
40
41
42
43
44
# File 'lib/increase/resources/account_transfers.rb', line 38

def retrieve(, opts = {})
  req = {}
  req[:method] = :get
  req[:path] = "/account_transfers/#{}"
  req[:model] = Increase::Models::AccountTransfer
  @client.request(req, opts)
end