View Source ExCashfreeSdk.PaymentGateway.Refunds (ExCashfreeSDK v0.1.5)
Refunds APIs implementation for Cashfree SDK.
This module provides functions to create and retrieve refunds for orders processed through Cashfree's Payment Gateway.
Summary
Functions
Creates a refund for a specific order.
Retrieves details of a specific refund for an order.
Retrieves all refunds for a specific order.
Types
Functions
Creates a refund for a specific order.
Parameters
order_id
- The ID of the order to be refunded.refund_params
- A map containing refund details (seerefund/0
).refund_splits
- Optional list of refund splits (default: []).
Examples
iex> refund_params = %{
...> refund_amount: 100.00,
...> refund_id: "refund_123",
...> refund_note: "Customer requested refund",
...> refund_speed: "STANDARD"
...> }
iex> ExCashfreeSdk.PaymentGateway.Refunds.create_refund("order_123", refund_params)
{:ok, %{refund_id: "refund_123", order_id: "order_123", status: "PENDING"}}
Retrieves details of a specific refund for an order.
Parameters
order_id
- The ID of the order.refund_id
- The ID of the refund to retrieve.
Examples
iex> ExCashfreeSdk.PaymentGateway.Refunds.get_refund("order_123", "refund_123")
{:ok, %{
refund_id: "refund_123",
order_id: "order_123",
status: "PROCESSED",
amount: 100.00,
created_at: "2023-04-01T12:00:00Z"
}}
Retrieves all refunds for a specific order.
Parameters
order_id
- The ID of the order to fetch refunds for.
Examples
iex> ExCashfreeSdk.PaymentGateway.Refunds.get_refunds("order_123")
{:ok, [
%{refund_id: "refund_123", status: "PROCESSED", amount: 50.00},
%{refund_id: "refund_124", status: "PENDING", amount: 25.00}
]}