Class: Airwallex::GlobalAccount
- Inherits:
-
APIResource
- Object
- APIResource
- Airwallex::GlobalAccount
- Extended by:
- APIOperations::Create, APIOperations::List, APIOperations::Retrieve
- Includes:
- APIOperations::Update
- Defined in:
- lib/airwallex/resources/global_account.rb
Overview
Represents a Global Account (Virtual Account Number) used to collect local bank transfers into a specific currency and jurisdiction.
Instance Attribute Summary
Attributes inherited from APIResource
Class Method Summary collapse
-
.resource_path ⇒ String
API resource path for global accounts.
Instance Method Summary collapse
-
#alias(alias_id) ⇒ GlobalAccountAlias
Retrieve a single alias on this account.
-
#aliases(params = {}) ⇒ ListObject<GlobalAccountAlias>
List aliases on this account.
-
#close(params = {}) ⇒ GlobalAccount
Close this global account.
-
#create_alias(params = {}) ⇒ GlobalAccountAlias
Create an alias (e.g. PayID, email, or phone-linked VAN) on this account.
-
#generate_statement_letter(params = {}) ⇒ Hash
Generate a bank-ownership statement letter for this account — e.g.
-
#mandate(mandate_id) ⇒ GlobalAccountMandate
Retrieve a single direct debit mandate on this account.
-
#mandates(params = {}) ⇒ ListObject<GlobalAccountMandate>
List direct debit mandates on this account.
-
#transactions(params = {}) ⇒ ListObject<GlobalAccountTransaction>
List inbound transactions (deposits) received into this account.
Methods included from APIOperations::Create
Methods included from APIOperations::Retrieve
Methods included from APIOperations::List
Methods included from APIOperations::Update
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_path ⇒ String
Returns API resource path for global accounts.
27 28 29 |
# File 'lib/airwallex/resources/global_account.rb', line 27 def self.resource_path "/api/v1/global_accounts" end |
Instance Method Details
#alias(alias_id) ⇒ GlobalAccountAlias
Retrieve a single alias on this account
75 76 77 78 |
# File 'lib/airwallex/resources/global_account.rb', line 75 def alias(alias_id) response = Airwallex.client.get("#{GlobalAccountAlias.resource_path(id)}/#{alias_id}") GlobalAccountAlias.new(response) end |
#aliases(params = {}) ⇒ ListObject<GlobalAccountAlias>
List aliases on this account
84 85 86 87 |
# File 'lib/airwallex/resources/global_account.rb', line 84 def aliases(params = {}) response = Airwallex.client.get(GlobalAccountAlias.resource_path(id), params) build_list(response, GlobalAccountAlias, params) end |
#close(params = {}) ⇒ GlobalAccount
Close this global account
35 36 37 38 39 |
# File 'lib/airwallex/resources/global_account.rb', line 35 def close(params = {}) response = Airwallex.client.post("#{self.class.resource_path}/#{id}/close", params) refresh_from(response) self end |
#create_alias(params = {}) ⇒ GlobalAccountAlias
Create an alias (e.g. PayID, email, or phone-linked VAN) on this account
66 67 68 69 |
# File 'lib/airwallex/resources/global_account.rb', line 66 def create_alias(params = {}) response = Airwallex.client.post("#{GlobalAccountAlias.resource_path(id)}/create", params) GlobalAccountAlias.new(response) end |
#generate_statement_letter(params = {}) ⇒ Hash
Generate a bank-ownership statement letter for this account — e.g. for marketplace seller verification (known value: "AMAZON"; other marketplace-specific values likely exist).
49 50 51 |
# File 'lib/airwallex/resources/global_account.rb', line 49 def generate_statement_letter(params = {}) Airwallex.client.post("#{self.class.resource_path}/#{id}/generate_statement_letter", params) end |
#mandate(mandate_id) ⇒ GlobalAccountMandate
Retrieve a single direct debit mandate on this account
93 94 95 96 |
# File 'lib/airwallex/resources/global_account.rb', line 93 def mandate(mandate_id) response = Airwallex.client.get("#{GlobalAccountMandate.resource_path(id)}/#{mandate_id}") GlobalAccountMandate.new(response) end |
#mandates(params = {}) ⇒ ListObject<GlobalAccountMandate>
List direct debit mandates on this account
102 103 104 105 |
# File 'lib/airwallex/resources/global_account.rb', line 102 def mandates(params = {}) response = Airwallex.client.get(GlobalAccountMandate.resource_path(id), params) build_list(response, GlobalAccountMandate, params) end |
#transactions(params = {}) ⇒ ListObject<GlobalAccountTransaction>
List inbound transactions (deposits) received into this account
57 58 59 60 |
# File 'lib/airwallex/resources/global_account.rb', line 57 def transactions(params = {}) response = Airwallex.client.get("#{self.class.resource_path}/#{id}/transactions", params) build_list(response, GlobalAccountTransaction, params) end |