Class: Airwallex::AccountAmendment
- Inherits:
-
APIResource
- Object
- APIResource
- Airwallex::AccountAmendment
- Defined in:
- lib/airwallex/resources/account_amendment.rb
Overview
Represents an amendment to whichever account the request is authenticated as (the platform's own account, or a connected account via x-on-behalf-of). Not nested under /accounts/Airwallex::APIResource#id — scoped implicitly by auth context, same as ConnectedAccount.current.
.create requires Admin-level API key permissions, a separate tier from the normal per-resource Read/Write scopes.
Constant Summary collapse
- SIMULATION_PATH =
Sandbox-only — see https://www.airwallex.com/docs/api/simulation/account-amendments
"/api/v1/simulation/account/amendments"
Instance Attribute Summary
Attributes inherited from APIResource
Class Method Summary collapse
-
.resource_path ⇒ String
API resource path for account amendments.
-
.simulate_approve(amendment_id) ⇒ AccountAmendment
Simulate approving a PENDING amendment.
-
.simulate_reject(amendment_id) ⇒ AccountAmendment
Simulate rejecting a PENDING amendment.
Instance Method Summary collapse
-
#simulate_approve ⇒ AccountAmendment
Simulate approving this amendment.
-
#simulate_reject ⇒ AccountAmendment
Simulate rejecting this amendment.
Methods included from Airwallex::APIOperations::Create
Methods included from Airwallex::APIOperations::Retrieve
Methods inherited from APIResource
#changed_attributes, #dirty?, #initialize, #inspect, #method_missing, #refresh, #refresh_from, resource_name, #respond_to_missing?, symbolized_get, symbolized_post, #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 account amendments.
28 29 30 |
# File 'lib/airwallex/resources/account_amendment.rb', line 28 def self.resource_path "/api/v1/account/amendments" end |
.simulate_approve(amendment_id) ⇒ AccountAmendment
Simulate approving a PENDING amendment
36 37 38 39 |
# File 'lib/airwallex/resources/account_amendment.rb', line 36 def self.simulate_approve(amendment_id) response = Airwallex.client.post("#{SIMULATION_PATH}/#{amendment_id}/approve", {}) new(response) end |
.simulate_reject(amendment_id) ⇒ AccountAmendment
Simulate rejecting a PENDING amendment
45 46 47 48 |
# File 'lib/airwallex/resources/account_amendment.rb', line 45 def self.simulate_reject(amendment_id) response = Airwallex.client.post("#{SIMULATION_PATH}/#{amendment_id}/reject", {}) new(response) end |
Instance Method Details
#simulate_approve ⇒ AccountAmendment
Simulate approving this amendment
53 54 55 56 57 |
# File 'lib/airwallex/resources/account_amendment.rb', line 53 def simulate_approve response = Airwallex.client.post("#{self.class::SIMULATION_PATH}/#{id}/approve", {}) refresh_from(response) self end |
#simulate_reject ⇒ AccountAmendment
Simulate rejecting this amendment
62 63 64 65 66 |
# File 'lib/airwallex/resources/account_amendment.rb', line 62 def simulate_reject response = Airwallex.client.post("#{self.class::SIMULATION_PATH}/#{id}/reject", {}) refresh_from(response) self end |