UNPKG

@mollie/api-client

Version:
66 lines (65 loc) 3.38 kB
import type TransformingNetworkClient from '../../communication/TransformingNetworkClient'; import type Page from '../../data/page/Page'; import { type PaymentLinkData } from '../../data/paymentLinks/data'; import type PaymentLink from '../../data/paymentLinks/PaymentLink'; import type Callback from '../../types/Callback'; import Binder from '../Binder'; import { type CreateParameters, type DeleteParameters, type GetParameters, type IterateParameters, type PageParameters, type UpdateParameters } from './parameters'; export default class PaymentsLinksBinder extends Binder<PaymentLinkData, PaymentLink> { protected readonly networkClient: TransformingNetworkClient; constructor(networkClient: TransformingNetworkClient); /** * With the Payment links API you can generate payment links that by default, unlike regular payments, do not expire. The payment link can be shared with your customers and will redirect them to the * payment page where they can complete the payment. A payment will only be created once the customer initiates the payment. * * @since 3.6.0 * @see https://docs.mollie.com/reference/create-payment-link */ create(parameters: CreateParameters): Promise<PaymentLink>; create(parameters: CreateParameters, callback: Callback<PaymentLink>): void; /** * Retrieve a single payment link by its ID. * * @since 3.6.0 * @see https://docs.mollie.com/reference/get-payment-link */ get(id: string, parameters?: GetParameters): Promise<PaymentLink>; get(id: string, parameters: GetParameters, callback: Callback<PaymentLink>): void; /** * Retrieve all payment links created with the current website profile, ordered from newest to oldest. * * The results are paginated. See pagination for more information. * * @since 3.6.0 * @see https://docs.mollie.com/reference/list-payment-links */ page(parameters?: PageParameters): Promise<Page<PaymentLink>>; page(parameters: PageParameters, callback: Callback<Page<PaymentLink>>): void; /** * Retrieve all payment links created with the current website profile, ordered from newest to oldest. * * The results are paginated. See pagination for more information. * * @since 3.6.0 * @see https://docs.mollie.com/reference/list-payment-links */ iterate(parameters?: IterateParameters): import("../../plumbing/iteration/HelpfulIterator").default<PaymentLink>; /** * Update a payment link object by its token. * * @see https://docs.mollie.com/reference/update-payment-link */ update(id: string, parameters: Partial<UpdateParameters>): Promise<PaymentLink>; update(id: string, parameters: Partial<UpdateParameters>, callback: Callback<PaymentLink>): void; /** * Delete a payment link object by its token. * * @see https://docs.mollie.com/reference/delete-payment-link */ delete(id: string, parameters?: DeleteParameters): Promise<true>; /** * @deprecated Passing a callback as the second argument is deprecated and will be removed in the next major version. Use the returned promise instead, or pass `parameters` before the callback. */ delete(id: string, callback: Callback<true>): void; delete(id: string, parameters: DeleteParameters, callback: Callback<true>): void; }