/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { paymentLinksCreate } from "../funcs/paymentLinksCreate.js"; import { paymentLinksDisable } from "../funcs/paymentLinksDisable.js"; import { paymentLinksGet } from "../funcs/paymentLinksGet.js"; import { GetQRCodeAcceptEnum, paymentLinksGetQRCode, } from "../funcs/paymentLinksGetQRCode.js"; import { paymentLinksList } from "../funcs/paymentLinksList.js"; import { paymentLinksUpdate } from "../funcs/paymentLinksUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export { GetQRCodeAcceptEnum } from "../funcs/paymentLinksGetQRCode.js"; export class PaymentLinks extends ClientSDK { /** * Create a payment link that allows an end user to make a payment on Moov's hosted payment link page. * * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) * you'll need to specify the `/accounts/{accountID}/transfers.write` scope. */ async create( request: operations.CreatePaymentLinkRequest, options?: RequestOptions, ): Promise { return unwrapAsync(paymentLinksCreate( this, request, options, )); } /** * List all the payment links created under a Moov account. * * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) * you'll need to specify the `/accounts/{accountID}/transfers.read` scope. */ async list( request: operations.ListPaymentLinksRequest, options?: RequestOptions, ): Promise { return unwrapAsync(paymentLinksList( this, request, options, )); } /** * Retrieve a payment link by code. * * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) * you'll need to specify the `/accounts/{accountID}/transfers.read` scope. */ async get( request: operations.GetPaymentLinkRequest, options?: RequestOptions, ): Promise { return unwrapAsync(paymentLinksGet( this, request, options, )); } /** * Update a payment link. * * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) * you'll need to specify the `/accounts/{accountID}/transfers.write` scope. */ async update( request: operations.UpdatePaymentLinkRequest, options?: RequestOptions, ): Promise { return unwrapAsync(paymentLinksUpdate( this, request, options, )); } /** * Disable a payment link. * * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) * you'll need to specify the `/accounts/{accountID}/transfers.write` scope. */ async disable( request: operations.DisablePaymentLinkRequest, options?: RequestOptions, ): Promise { return unwrapAsync(paymentLinksDisable( this, request, options, )); } /** * Retrieve the payment link encoded in a QR code. * * Use the `Accept` header to specify the format of the response. Supported formats are `application/json` and `image/png`. * * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) * you'll need to specify the `/accounts/{accountID}/transfers.write` scope. */ async getQRCode( request: operations.GetPaymentLinkQRCodeRequest, options?: RequestOptions & { acceptHeaderOverride?: GetQRCodeAcceptEnum }, ): Promise { return unwrapAsync(paymentLinksGetQRCode( this, request, options, )); } }