Class: Airwallex::GlobalAccountAlias

Inherits:
APIResource show all
Defined in:
lib/airwallex/resources/global_account_alias.rb

Overview

Represents an alias (e.g. PayID, email, or phone-linked VAN) attached to a GlobalAccount. Always accessed through its parent GlobalAccount, since its API path is scoped by global_account_id.

Instance Attribute Summary

Attributes inherited from APIResource

#attributes, #id

Class Method Summary collapse

Instance Method Summary collapse

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(global_account_id) ⇒ String

Returns API resource path for this account's aliases.

Parameters:

  • global_account_id (String)

    the parent GlobalAccount's id

Returns:

  • (String)

    API resource path for this account's aliases



10
11
12
# File 'lib/airwallex/resources/global_account_alias.rb', line 10

def self.resource_path()
  "/api/v1/global_accounts/#{}/aliases"
end

Instance Method Details

#cancel(params = {}) ⇒ GlobalAccountAlias

Cancel this alias

Parameters:

  • params (Hash) (defaults to: {})

    additional params

Returns:



54
55
56
57
58
59
60
# File 'lib/airwallex/resources/global_account_alias.rb', line 54

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

#initiate_port(params = {}) ⇒ GlobalAccountAlias

Begin porting this alias in from another provider

Parameters:

  • params (Hash) (defaults to: {})

    additional porting params

Returns:



18
19
20
21
22
23
24
# File 'lib/airwallex/resources/global_account_alias.rb', line 18

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

#request_new_verification_code(params = {}) ⇒ GlobalAccountAlias

Request a new verification code for this alias

Parameters:

  • params (Hash) (defaults to: {})

    additional params

Returns:



42
43
44
45
46
47
48
# File 'lib/airwallex/resources/global_account_alias.rb', line 42

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

#submit_verification_code(params = {}) ⇒ GlobalAccountAlias

Submit the verification code sent to confirm this alias

Parameters:

  • params (Hash) (defaults to: {})

    e.g. code:

Returns:



30
31
32
33
34
35
36
# File 'lib/airwallex/resources/global_account_alias.rb', line 30

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