Class: Increase::Resources::CheckTransfers

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CheckTransfers

Returns a new instance of CheckTransfers.



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

def initialize(client:)
  @client = client
end

Instance Method Details

#approve(check_transfer_id, opts = {}) ⇒ Increase::Models::CheckTransfer

Approve a Check Transfer

Parameters:

  • check_transfer_id (String)

    The identifier of the Check Transfer to approve.

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

    Options to specify HTTP behaviour for this request.

Returns:



84
85
86
87
88
89
90
# File 'lib/increase/resources/check_transfers.rb', line 84

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

#cancel(check_transfer_id, opts = {}) ⇒ Increase::Models::CheckTransfer

Cancel a pending Check Transfer

Parameters:

  • check_transfer_id (String)

    The identifier of the pending Check Transfer to cancel.

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

    Options to specify HTTP behaviour for this request.

Returns:



98
99
100
101
102
103
104
# File 'lib/increase/resources/check_transfers.rb', line 98

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

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

Create a Check 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 cents.

  • :source_account_number_id (String)

    The identifier of the Account Number from which to send the transfer and print on the check.

  • :fulfillment_method (Symbol)

    Whether Increase will print and mail the check or if you will do it yourself.

  • :physical_check (PhysicalCheck)

    Details relating to the physical check that Increase will print and mail. This is required if fulfillment_method is equal to physical_check. It must not be included if any other fulfillment_method is provided.

  • :require_approval (Boolean)

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

  • :third_party (ThirdParty)

    Details relating to the custom fulfillment you will perform. This is required if fulfillment_method is equal to third_party. It must not be included if any other fulfillment_method is provided.

Returns:



29
30
31
32
33
34
35
36
# File 'lib/increase/resources/check_transfers.rb', line 29

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

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

List Check 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 Check 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:



68
69
70
71
72
73
74
75
76
# File 'lib/increase/resources/check_transfers.rb', line 68

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

#retrieve(check_transfer_id, opts = {}) ⇒ Increase::Models::CheckTransfer

Retrieve a Check Transfer

Parameters:

  • check_transfer_id (String)

    The identifier of the Check Transfer.

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

    Options to specify HTTP behaviour for this request.

Returns:



44
45
46
47
48
49
50
# File 'lib/increase/resources/check_transfers.rb', line 44

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

#stop_payment(check_transfer_id, params = {}, opts = {}) ⇒ Increase::Models::CheckTransfer

Request a stop payment on a Check Transfer

Parameters:

  • check_transfer_id (String)

    The identifier of the Check Transfer.

  • 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):

  • :reason (Symbol)

    The reason why this transfer should be stopped.

Returns:



116
117
118
119
120
121
122
123
# File 'lib/increase/resources/check_transfers.rb', line 116

def stop_payment(check_transfer_id, params = {}, opts = {})
  req = {}
  req[:method] = :post
  req[:path] = "/check_transfers/#{check_transfer_id}/stop_payment"
  req[:body] = params
  req[:model] = Increase::Models::CheckTransfer
  @client.request(req, opts)
end