@mollie/api-client
Version:
Official Mollie API client for Node
64 lines (63 loc) • 3.09 kB
TypeScript
import type TransformingNetworkClient from '../../communication/TransformingNetworkClient';
import type Customer from '../../data/customers/Customer';
import { type CustomerData } from '../../data/customers/Customer';
import type Page from '../../data/page/Page';
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 CustomersBinder extends Binder<CustomerData, Customer> {
protected readonly networkClient: TransformingNetworkClient;
constructor(networkClient: TransformingNetworkClient);
/**
* Creates a simple minimal representation of a customer in the Mollie API to use for the [Mollie Checkout](https://www.mollie.com/products/checkout) and Recurring features. These customers will
* appear in your [Mollie Dashboard](https://www.mollie.com/dashboard) where you can manage their details, and also see their payments and subscriptions.
*
* @since 2.0.0
* @see https://docs.mollie.com/reference/v2/customers-api/create-customer
*/
create(parameters: CreateParameters): Promise<Customer>;
create(parameters: CreateParameters, callback: Callback<Customer>): void;
/**
* Retrieve a single customer by its ID.
*
* @since 2.0.0
* @see https://docs.mollie.com/reference/v2/customers-api/get-customer
*/
get(id: string, parameters?: GetParameters): Promise<Customer>;
get(id: string, parameters: GetParameters, callback: Callback<Customer>): void;
/**
* Retrieve all customers created.
*
* The results are paginated. See pagination for more information.
*
* @since 3.0.0
* @see https://docs.mollie.com/reference/v2/customers-api/list-customers
*/
page(parameters?: PageParameters): Promise<Page<Customer>>;
page(parameters: PageParameters, callback: Callback<Page<Customer>>): void;
/**
* Retrieve all customers created.
*
* The results are paginated. See pagination for more information.
*
* @since 3.6.0
* @see https://docs.mollie.com/reference/v2/customers-api/list-customers
*/
iterate(parameters?: IterateParameters): import("../../plumbing/iteration/HelpfulIterator").default<Customer>;
/**
* Update an existing customer.
*
* @since 2.0.0
* @see https://docs.mollie.com/reference/v2/customers-api/update-customer
*/
update(id: string, parameters: UpdateParameters): Promise<Customer>;
update(id: string, parameters: UpdateParameters, callback: Callback<Customer>): void;
/**
* Delete a customer. All mandates and subscriptions created for this customer will be canceled as well.
*
* @since 2.0.0
* @see https://docs.mollie.com/reference/v2/customers-api/delete-customer
*/
delete(id: string, parameters?: DeleteParameters): Promise<true>;
delete(id: string, parameters: DeleteParameters, callback: Callback<true>): void;
}