Class: Airwallex::PaymentConsent
- Inherits:
-
APIResource
- Object
- APIResource
- Airwallex::PaymentConsent
- Extended by:
- APIOperations::Create, APIOperations::List, APIOperations::Retrieve
- Includes:
- APIOperations::Update
- Defined in:
- lib/airwallex/resources/payment_consent.rb
Overview
Represents a Payment Consent — a saved card/payment method authorized for future off-session charges without re-prompting the customer.
Does NOT attach directly to a BillingSubscription — a subscription's payment_source_id references a PaymentSource (see Airwallex::PaymentSource), a separate Billing object created FROM a verified, merchant-initiated PaymentConsent. See PaymentSource's docstring for the full chain.
Instance Attribute Summary
Attributes inherited from APIResource
Class Method Summary collapse
-
.resource_path ⇒ String
API resource path for payment consents.
Instance Method Summary collapse
-
#disable(params = {}) ⇒ PaymentConsent
Disable this consent so it can no longer be charged.
-
#verify(params = {}) ⇒ PaymentConsent
Verify this consent (e.g. via a zero/low-value authorization) before it can be used for off-session charges.
-
#verify_continue(params = {}) ⇒ PaymentConsent
Continue a verification that requires further customer action (e.g. completing 3DS).
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 consents.
32 33 34 |
# File 'lib/airwallex/resources/payment_consent.rb', line 32 def self.resource_path "/api/v1/pa/payment_consents" end |
Instance Method Details
#disable(params = {}) ⇒ PaymentConsent
Disable this consent so it can no longer be charged
62 63 64 65 66 |
# File 'lib/airwallex/resources/payment_consent.rb', line 62 def disable(params = {}) response = Airwallex.client.post("#{self.class.resource_path}/#{id}/disable", params) refresh_from(response) self end |
#verify(params = {}) ⇒ PaymentConsent
Verify this consent (e.g. via a zero/low-value authorization) before it can be used for off-session charges
41 42 43 44 45 |
# File 'lib/airwallex/resources/payment_consent.rb', line 41 def verify(params = {}) response = Airwallex.client.post("#{self.class.resource_path}/#{id}/verify", params) refresh_from(response) self end |
#verify_continue(params = {}) ⇒ PaymentConsent
Continue a verification that requires further customer action (e.g. completing 3DS)
52 53 54 55 56 |
# File 'lib/airwallex/resources/payment_consent.rb', line 52 def verify_continue(params = {}) response = Airwallex.client.post("#{self.class.resource_path}/#{id}/verify_continue", params) refresh_from(response) self end |