Class: Airwallex::Transfer

Inherits:
APIResource show all
Extended by:
APIOperations::Create, APIOperations::List, APIOperations::Retrieve
Defined in:
lib/airwallex/resources/transfer.rb

Instance Attribute Summary

Attributes inherited from APIResource

#attributes, #id

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::Retrieve

retrieve

Methods included from APIOperations::List

list

Methods inherited from APIResource

#changed_attributes, #dirty?, #initialize, #inspect, #method_missing, #refresh, #refresh_from, resource_name, #respond_to_missing?, #to_hash, #to_json, #to_s

Constructor Details

This class inherits a constructor from Airwallex::APIResource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Airwallex::APIResource

Class Method Details

.resource_pathObject



9
10
11
# File 'lib/airwallex/resources/transfer.rb', line 9

def self.resource_path
  "/api/v1/transfers"
end

Instance Method Details

#cancelObject

Cancel a pending transfer



14
15
16
17
18
19
20
21
# File 'lib/airwallex/resources/transfer.rb', line 14

def cancel
  response = Airwallex.client.post(
    "#{self.class.resource_path}/#{id}/cancel",
    {}
  )
  refresh_from(response)
  self
end