class TransfeeraSDK::Batch

Public Instance Methods

close!(batch_id) click to toggle source
# File lib/transfeera_sdk/batch.rb, line 23
def close!(batch_id)
  details(batch_id)
  # send_request(:post, "/batch/#{batch_id}/close")
end
create!(opts = {}) click to toggle source
# File lib/transfeera_sdk/batch.rb, line 10
def create!(opts = {})
  update_bank_ids(opts)
  send_request(:post, "/batch", opts)
end
details(batch_id) click to toggle source
# File lib/transfeera_sdk/batch.rb, line 19
def details(batch_id)
  send_request(:get, "/batch/#{batch_id}")
end
list() click to toggle source
# File lib/transfeera_sdk/batch.rb, line 6
def list
  send_request(:get, '/batch')
end
remove(batch_id) click to toggle source
# File lib/transfeera_sdk/batch.rb, line 28
def remove(batch_id)
  send_request(:delete, "/batch/#{batch_id}")
end
transfers(batch_id) click to toggle source
# File lib/transfeera_sdk/batch.rb, line 32
def transfers(batch_id)
  send_request(:get, "/batch/#{batch_id}/transfer")
end
update!(batch_id, opts = {}) click to toggle source
# File lib/transfeera_sdk/batch.rb, line 15
def update!(batch_id, opts = {})
  send_request(:put, "/batch/#{batch_id}", opts)
end

Private Instance Methods

update_bank_ids(opts) click to toggle source
# File lib/transfeera_sdk/batch.rb, line 38
def update_bank_ids(opts)
  opts[:transfers].each do |transfer|
    bank_code = transfer[:destination_bank_account][:bank_id].to_s.rjust(3, '0')
    transfer[:destination_bank_account][:bank_id] = ::TransfeeraSDK::Bank.new.bank_id_from_code(bank_code)
  end
end