Class: Airwallex::PaymentMethod
- Inherits:
-
APIResource
- Object
- APIResource
- Airwallex::PaymentMethod
- Extended by:
- APIOperations::Create, APIOperations::Delete, APIOperations::List, APIOperations::Retrieve, APIOperations::Update
- 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.
Instance Attribute Summary
Attributes inherited from APIResource
Class Method Summary collapse
-
.resource_path ⇒ String
API resource path for payment methods.
Instance Method Summary collapse
-
#detach ⇒ PaymentMethod
Detach this payment method from its customer.
Methods included from APIOperations::Create
Methods included from APIOperations::Retrieve
Methods included from APIOperations::List
Methods included from APIOperations::Update
Methods included from APIOperations::Delete
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
38 39 40 |
# File 'lib/airwallex/resources/payment_method.rb', line 38 def self.resource_path "/api/v1/pa/payment_methods" end |
Instance Method Details
#detach ⇒ PaymentMethod
Detach this payment method from its customer
45 46 47 48 49 |
# File 'lib/airwallex/resources/payment_method.rb', line 45 def detach response = Airwallex.client.post("#{self.class.resource_path}/#{id}/detach", {}) refresh_from(response) self end |