/** * @module Resources/Refunds */ import { AuthParams, PollParams, PollData, SendData } from "../api/RestAPI.js"; import { PaymentError } from "../errors/APIError.js"; import { ProcessingMode } from "./common/enums.js"; import { Metadata } from "./common/types.js"; import { CRUDAOSItemsResponse, CRUDPaginationParams, CRUDResource } from "./CRUDResource.js"; export declare enum RefundStatus { PENDING = "pending", SUCCESSFUL = "successful", FAILED = "failed", ERROR = "error" } export declare enum RefundReason { DUPLICATE = "duplicate", FRAUD = "fraud", CUSTOMER_REQUEST = "customer_request", CHARGEBACK = "chargeback", CHARGEBACK_FEE_EXEMPT = "chargeback_fee_exempt", CHARGEBACK_REVERSE = "chargeback_reverse", SYSTEM_FAILURE = "system_failure" } export type RefundsListParams = CRUDPaginationParams; export interface RefundCreateParams { amount: number; currency: string; reason?: RefundReason; message?: string; metadata?: T | string; /** * Pricing token jwt */ mcpToken?: string; } export interface RefundUpdateParams { status?: RefundStatus; reason?: RefundReason; message?: string; /** * Metadata or stringified JSON object */ metadata?: T | string; } export interface RefundItem { id: string; storeId: string; chargeId: string; ledgerId?: string; mcpTokenId?: string; status: RefundStatus; amount: number; currency: string; amountFormatted: number; reason?: RefundReason; message?: string; error?: PaymentError; metadata?: T; mode: ProcessingMode; createdOn: string; } export type RefundListItem = RefundItem; export type ResponseRefund = RefundItem; export type ResponseRefunds = CRUDAOSItemsResponse>; export declare class Refunds extends CRUDResource { static requiredParams: string[]; static routeBase: string; private _list?; list(storeId: string | null, chargeId: string | null, data?: SendData | null, auth?: AuthParams): Promise>; private _create?; create(storeId: string | null, chargeId: string | null, data: SendData | null, auth?: AuthParams): Promise>; private _get?; get(storeId: string | null, chargeId: string | null, id: string | null, data?: SendData, auth?: AuthParams): Promise>; private _update?; update(storeId: string | null, chargeId: string | null, id: string | null, data?: SendData | null, auth?: AuthParams): Promise>; poll(storeId: string, chargeId: string, id: string, data?: SendData, auth?: AuthParams, pollParams?: Partial>>): Promise>; }