/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { paymentServicesCreate } from "../funcs/paymentServicesCreate.js"; import { paymentServicesDelete } from "../funcs/paymentServicesDelete.js"; import { paymentServicesGet } from "../funcs/paymentServicesGet.js"; import { paymentServicesList } from "../funcs/paymentServicesList.js"; import { paymentServicesSession } from "../funcs/paymentServicesSession.js"; import { paymentServicesUpdate } from "../funcs/paymentServicesUpdate.js"; import { paymentServicesVerify } from "../funcs/paymentServicesVerify.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; import { PageIterator, unwrapResultIterator } from "../types/operations.js"; export class PaymentServices extends ClientSDK { /** * List payment services * * @remarks * List the configured payment services. */ async list( request?: operations.ListPaymentServicesRequest | undefined, options?: RequestOptions, ): Promise< PageIterator > { return unwrapResultIterator(paymentServicesList( this, request, options, )); } /** * Configure a payment service * * @remarks * Configures a new payment service for use by merchants. */ async create( paymentServiceCreate: components.PaymentServiceCreate, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(paymentServicesCreate( this, paymentServiceCreate, merchantAccountId, options, )); } /** * Get payment service * * @remarks * Get the details of a configured payment service. */ async get( paymentServiceId: string, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(paymentServicesGet( this, paymentServiceId, merchantAccountId, options, )); } /** * Update a configured payment service * * @remarks * Updates the configuration of a payment service. */ async update( paymentServiceUpdate: components.PaymentServiceUpdate, paymentServiceId: string, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(paymentServicesUpdate( this, paymentServiceUpdate, paymentServiceId, merchantAccountId, options, )); } /** * Delete a configured payment service * * @remarks * Deletes all the configuration of a payment service. */ async delete( paymentServiceId: string, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(paymentServicesDelete( this, paymentServiceId, merchantAccountId, options, )); } /** * Verify payment service credentials * * @remarks * Verify the credentials of a configured payment service */ async verify( verifyCredentials: components.VerifyCredentials, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(paymentServicesVerify( this, verifyCredentials, merchantAccountId, options, )); } /** * Create a session for a payment service definition * * @remarks * Creates a session for a payment service that supports sessions. */ async session( requestBody: { [k: string]: any }, paymentServiceId: string, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(paymentServicesSession( this, requestBody, paymentServiceId, merchantAccountId, options, )); } }