Class: Transferwise::Transfer

Inherits:
APIResource show all
Defined in:
lib/transferwise/transfer.rb

Constant Summary

Constants inherited from APIResource

APIResource::API_VERSION

Class Method Summary collapse

Methods inherited from APIResource

class_name, collection_url, create, get, list, resource_url

Methods included from TransferwiseObject

#add_methods, included, #initialize, #initialize_from, #update_attributes

Class Method Details

.cancel(transfer_id, headers) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/transferwise/transfer.rb', line 3

def self.cancel(transfer_id, headers)
  url = "#{resource_url(transfer_id)}/cancel"

  params = { 'transferId' => transfer_id }
  response = Request.request(:put, url, params, headers)
  convert_to_transferwise_object(response)
end

.fund(transfer_id, headers) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/transferwise/transfer.rb', line 11

def self.fund(transfer_id, headers)
  url = "#{resource_url(transfer_id)}/payments"

  params = { 'type' => 'BALANCE' }
  response = Request.request(:post, url, params, headers)
  convert_to_transferwise_object(response)
end