Class: Airwallex::GlobalAccountAlias
- Inherits:
-
APIResource
- Object
- APIResource
- Airwallex::GlobalAccountAlias
- 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
Class Method Summary collapse
-
.resource_path(global_account_id) ⇒ String
API resource path for this account's aliases.
Instance Method Summary collapse
-
#cancel(params = {}) ⇒ GlobalAccountAlias
Cancel this alias.
-
#initiate_port(params = {}) ⇒ GlobalAccountAlias
Begin porting this alias in from another provider.
-
#request_new_verification_code(params = {}) ⇒ GlobalAccountAlias
Request a new verification code for this alias.
-
#submit_verification_code(params = {}) ⇒ GlobalAccountAlias
Submit the verification code sent to confirm this alias.
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.
10 11 12 |
# File 'lib/airwallex/resources/global_account_alias.rb', line 10 def self.resource_path(global_account_id) "/api/v1/global_accounts/#{global_account_id}/aliases" end |
Instance Method Details
#cancel(params = {}) ⇒ GlobalAccountAlias
Cancel this alias
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(global_account_id)}/#{id}/cancel", params ) refresh_from(response) self end |
#initiate_port(params = {}) ⇒ GlobalAccountAlias
Begin porting this alias in from another provider
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(global_account_id)}/#{id}/initiate_port", params ) refresh_from(response) self end |
#request_new_verification_code(params = {}) ⇒ GlobalAccountAlias
Request a new verification code for this alias
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(global_account_id)}/#{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
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(global_account_id)}/#{id}/submit_verification_code", params ) refresh_from(response) self end |