Class: Airwallex::GlobalAccountMandate
- Inherits:
-
APIResource
- Object
- APIResource
- Airwallex::GlobalAccountMandate
- Defined in:
- lib/airwallex/resources/global_account_mandate.rb
Overview
Represents a direct debit mandate on 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 mandates.
Instance Method Summary collapse
-
#cancel(params = {}) ⇒ GlobalAccountMandate
Cancel this mandate.
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 mandates.
10 11 12 |
# File 'lib/airwallex/resources/global_account_mandate.rb', line 10 def self.resource_path(global_account_id) "/api/v1/global_accounts/#{global_account_id}/mandates" end |
Instance Method Details
#cancel(params = {}) ⇒ GlobalAccountMandate
Cancel this mandate
18 19 20 21 22 23 24 |
# File 'lib/airwallex/resources/global_account_mandate.rb', line 18 def cancel(params = {}) response = Airwallex.client.post( "#{self.class.resource_path(global_account_id)}/#{id}/cancel", params ) refresh_from(response) self end |