Class: Airwallex::PaymentMethod
- Inherits:
-
APIResource
- Object
- APIResource
- Airwallex::PaymentMethod
- Extended by:
- APIOperations::Create, APIOperations::List, APIOperations::Retrieve
- Includes:
- APIOperations::Update
- Defined in:
- lib/airwallex/resources/payment_method.rb
Overview
Represents a payment method (card, bank account, etc.) that can be reused
Payment methods allow you to store customer payment credentials securely and reuse them for future payments without collecting details again.
Note: raw card tokenization via .create requires PCI-scoped "Native API" account access, which isn't enabled by default — if your account isn't provisioned for it, collect cards via Airwallex's hosted checkout or Embedded Elements instead.
Instance Attribute Summary
Attributes inherited from APIResource
Class Method Summary collapse
-
.resource_path ⇒ String
API resource path for payment methods.
Instance Method Summary collapse
-
#disable(params = {}) ⇒ PaymentMethod
Disable this payment method (Airwallex has no delete/detach endpoint; disabling is the real lifecycle operation and preserves history).
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 payment methods.
44 45 46 |
# File 'lib/airwallex/resources/payment_method.rb', line 44 def self.resource_path "/api/v1/pa/payment_methods" end |
Instance Method Details
#disable(params = {}) ⇒ PaymentMethod
Disable this payment method (Airwallex has no delete/detach endpoint; disabling is the real lifecycle operation and preserves history)
53 54 55 56 57 |
# File 'lib/airwallex/resources/payment_method.rb', line 53 def disable(params = {}) response = Airwallex.client.post("#{self.class.resource_path}/#{id}/disable", params) refresh_from(response) self end |