Class: Airwallex::Dispute
- Inherits:
-
APIResource
- Object
- APIResource
- Airwallex::Dispute
- Extended by:
- APIOperations::List, APIOperations::Retrieve
- Includes:
- APIOperations::Update
- Defined in:
- lib/airwallex/resources/dispute.rb
Overview
Dispute resource for handling chargebacks and payment disputes
Disputes represent chargebacks or payment disputes initiated by cardholders. Merchants can view disputes, challenge them with evidence, or accept them. There is no create — disputes originate from card networks/issuing banks.
Instance Attribute Summary
Attributes inherited from APIResource
Class Method Summary collapse
Instance Method Summary collapse
-
#accept ⇒ Airwallex::Dispute
Accept a dispute without challenging it.
-
#challenge(params = {}) ⇒ Airwallex::Dispute
Challenge a dispute with evidence.
-
#related_payment_intents(params = {}) ⇒ ListObject<PaymentIntent>
List payment intents related to this dispute.
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 ⇒ Object
26 27 28 |
# File 'lib/airwallex/resources/dispute.rb', line 26 def self.resource_path "/api/v1/pa/payment_disputes" end |
Instance Method Details
#accept ⇒ Airwallex::Dispute
Accept a dispute without challenging it
33 34 35 36 37 |
# File 'lib/airwallex/resources/dispute.rb', line 33 def accept response = Airwallex.client.post("#{self.class.resource_path}/#{id}/accept", {}) refresh_from(response) self end |
#challenge(params = {}) ⇒ Airwallex::Dispute
Challenge a dispute with evidence
44 45 46 47 48 |
# File 'lib/airwallex/resources/dispute.rb', line 44 def challenge(params = {}) response = Airwallex.client.post("#{self.class.resource_path}/#{id}/challenge", params) refresh_from(response) self end |
#related_payment_intents(params = {}) ⇒ ListObject<PaymentIntent>
List payment intents related to this dispute
54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/airwallex/resources/dispute.rb', line 54 def (params = {}) response = Airwallex.client.get( "#{self.class.resource_path}/#{id}/related_payment_intents", params ) ListObject.new( data: extract_items(response), has_more: extract_has_more(response), next_cursor: extract_next_cursor(response), resource_class: PaymentIntent, params: params ) end |