Class: Airwallex::Dispute

Inherits:
APIResource show all
Extended by:
APIOperations::List, APIOperations::Retrieve
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, submit evidence to challenge them, or accept them.

Examples:

List open disputes

disputes = Airwallex::Dispute.list(status: 'OPEN')

Retrieve a dispute

dispute = Airwallex::Dispute.retrieve('dis_123')

Submit evidence

dispute = Airwallex::Dispute.retrieve('dis_123')
dispute.submit_evidence(
  customer_communication: "Email showing delivery confirmation",
  shipping_tracking_number: "1Z999AA10123456784"
)

Accept a dispute

dispute = Airwallex::Dispute.retrieve('dis_123')
dispute.accept

Instance Attribute Summary

Attributes inherited from APIResource

#attributes, #id

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::Retrieve

retrieve

Methods included from APIOperations::List

list

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_pathObject



30
31
32
# File 'lib/airwallex/resources/dispute.rb', line 30

def self.resource_path
  "/api/v1/disputes"
end

Instance Method Details

#acceptAirwallex::Dispute

Accept a dispute without challenging it



37
38
39
40
41
# File 'lib/airwallex/resources/dispute.rb', line 37

def accept
  response = Airwallex.client.post("#{resource_path}/#{id}/accept", {})
  refresh_from(response)
  self
end

#submit_evidence(evidence) ⇒ Airwallex::Dispute

Submit evidence to challenge a dispute

Options Hash (evidence):

  • :customer_communication (String)

    Email or chat logs

  • :shipping_tracking_number (String)

    Tracking number

  • :shipping_documentation (String)

    Proof of shipping

  • :customer_signature (String)

    Signed receipt

  • :receipt (String)

    Proof of purchase

  • :refund_policy (String)

    Refund policy document

  • :cancellation_policy (String)

    Cancellation policy

  • :additional_information (String)

    Other relevant info



56
57
58
59
60
# File 'lib/airwallex/resources/dispute.rb', line 56

def submit_evidence(evidence)
  response = Airwallex.client.post("#{resource_path}/#{id}/evidence", evidence)
  refresh_from(response)
  self
end