/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { paymentsCreatePayment } from "../funcs/payments-create-payment.js"; import { paymentsDeletePayment } from "../funcs/payments-delete-payment.js"; import { paymentsGetPayment } from "../funcs/payments-get-payment.js"; import { paymentsListPayments } from "../funcs/payments-list-payments.js"; import { paymentsProcessPayment } from "../funcs/payments-process-payment.js"; import { paymentsUpdatePayment } from "../funcs/payments-update-payment.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { unwrapAsync } from "../types/fp.js"; import * as models from "./models/index.js"; export class Payments extends ClientSDK { /** * List payments * * @remarks * Use when listing or searching payments (e.g. reconciliation UI or customer payment history). Returns a paginated list; supports filtering by customer, invoice, status. */ async listPayments( request?: models.ListPaymentsRequest | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(paymentsListPayments( this, request, options, )); } /** * Create payment * * @remarks * Use when recording a payment against an invoice (e.g. after receiving funds via a gateway or manual entry). */ async createPayment( request: models.CreatePaymentRequest, options?: RequestOptions, ): Promise { return unwrapAsync(paymentsCreatePayment( this, request, options, )); } /** * Get payment * * @remarks * Use when you need to load a single payment (e.g. for a receipt view or reconciliation). */ async getPayment( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(paymentsGetPayment( this, id, options, )); } /** * Update payment * * @remarks * Use when updating payment status or metadata (e.g. after reconciliation or adding a reference). */ async updatePayment( id: string, body: models.UpdatePaymentRequest, options?: RequestOptions, ): Promise { return unwrapAsync(paymentsUpdatePayment( this, id, body, options, )); } /** * Delete payment * * @remarks * Use when removing or voiding a payment record (e.g. correcting erroneous entries). Returns 200 with success message. */ async deletePayment( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(paymentsDeletePayment( this, id, options, )); } /** * Process payment * * @remarks * Use when you need to charge or process a payment (e.g. trigger the payment provider to capture funds). Returns updated payment with status. */ async processPayment( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(paymentsProcessPayment( this, id, options, )); } }