/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { transactionsRefundsCreate } from "../funcs/transactionsRefundsCreate.js"; import { transactionsRefundsGet } from "../funcs/transactionsRefundsGet.js"; import { transactionsRefundsList } from "../funcs/transactionsRefundsList.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import { unwrapAsync } from "../types/fp.js"; import { All } from "./all.js"; export class Gr4vyRefunds extends ClientSDK { private _all?: All; get all(): All { return (this._all ??= new All(this._options)); } /** * List transaction refunds * * @remarks * List refunds for a transaction. */ async list( transactionId: string, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(transactionsRefundsList( this, transactionId, merchantAccountId, options, )); } /** * Create transaction refund * * @remarks * Create a refund for a transaction. */ async create( transactionRefundCreate: components.TransactionRefundCreate, transactionId: string, merchantAccountId?: string | null | undefined, idempotencyKey?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(transactionsRefundsCreate( this, transactionRefundCreate, transactionId, merchantAccountId, idempotencyKey, options, )); } /** * Get transaction refund * * @remarks * Fetch refund for a transaction. */ async get( transactionId: string, refundId: string, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(transactionsRefundsGet( this, transactionId, refundId, merchantAccountId, options, )); } }