Class: Airwallex::Refund

Inherits:
APIResource show all
Extended by:
APIOperations::Create, APIOperations::List, APIOperations::Retrieve
Defined in:
lib/airwallex/resources/refund.rb

Overview

Represents a refund of a payment intent

Refunds can be full or partial. Multiple refunds can be created for a single payment intent as long as the total refunded amount doesn’t exceed the original amount.

Examples:

Create a full refund

refund = Airwallex::Refund.create(
  payment_intent_id: "pi_123",
  amount: 100.00,
  reason: "requested_by_customer"
)

Create a partial refund

refund = Airwallex::Refund.create(
  payment_intent_id: "pi_123",
  amount: 25.00
)

List refunds for a payment

refunds = Airwallex::Refund.list(payment_intent_id: "pi_123")

Instance Attribute Summary

Attributes inherited from APIResource

#attributes, #id

Class Method Summary collapse

Methods included from APIOperations::Create

create

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_pathString

Returns API resource path for refunds.

Returns:

  • (String)

    API resource path for refunds



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

def self.resource_path
  "/api/v1/pa/refunds"
end