@mollie/api-client
Version:
Official Mollie API client for Node
80 lines (79 loc) • 3.89 kB
TypeScript
import type TransformingNetworkClient from '../../communication/TransformingNetworkClient';
import type Page from '../../data/page/Page';
import { type ProfileData } from '../../data/profiles/data';
import type Profile from '../../data/profiles/Profile';
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 ProfilesBinder extends Binder<ProfileData, Profile> {
protected readonly networkClient: TransformingNetworkClient;
constructor(networkClient: TransformingNetworkClient);
/**
* In order to process payments, you need to create a website profile. A website profile can easily be created via the Dashboard manually. However, the Mollie API also allows automatic profile
* creation via the Profiles API.
*
* @since 3.2.0
* @see https://docs.mollie.com/reference/create-profile
*/
create(parameters: CreateParameters): Promise<Profile>;
create(parameters: CreateParameters, callback: Callback<Profile>): void;
/**
* Retrieve details of a profile, using the profile's identifier.
*
* @since 3.2.0
* @see https://docs.mollie.com/reference/get-profile
*/
get(id: string, parameters?: GetParameters): Promise<Profile>;
/**
* @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.
*/
get(id: string, callback: Callback<Profile>): void;
get(id: string, parameters: GetParameters, callback: Callback<Profile>): void;
/**
* Use this API if you are creating a plugin or SaaS application that allows users to enter a Mollie API key, and you want to give a confirmation of the website profile that will be used in your
* plugin or application.
*
* This is similar to the Get current organization endpoint for OAuth.
*
* @since 3.2.0
* @see https://docs.mollie.com/reference/get-current-profile
*/
getCurrent(): Promise<Profile>;
getCurrent(callback: Callback<Profile>): void;
/**
* Retrieve all profiles available on the account.
*
* The results are paginated. See pagination for more information.
*
* @since 3.2.0 (as `list`)
* @see https://docs.mollie.com/reference/list-profiles
*/
page(parameters?: PageParameters): Promise<Page<Profile>>;
page(parameters: PageParameters, callback: Callback<Page<Profile>>): void;
/**
* Retrieve all profiles available on the account.
*
* The results are paginated. See pagination for more information.
*
* @since 3.6.0
* @see https://docs.mollie.com/reference/list-profiles
*/
iterate(parameters?: IterateParameters): import("../../plumbing/iteration/HelpfulIterator").default<Profile>;
/**
* A profile is required to process payments. A profile can easily be created and updated via the Dashboard manually. However, the Mollie API also allows automatic profile creation and updates via
* the Profiles API.
*
* @since 3.2.0
* @see https://docs.mollie.com/reference/update-profile
*/
update(id: string, parameters: UpdateParameters): Promise<Profile>;
update(id: string, parameters: UpdateParameters, callback: Callback<Profile>): void;
/**
* This endpoint enables profile deletions, rendering the profile unavailable for further API calls and transactions.
*
* @since 3.2.0
* @see https://docs.mollie.com/reference/delete-profile
*/
delete(id: string, parameters?: DeleteParameters): Promise<true>;
delete(id: string, parameters: DeleteParameters, callback: Callback<true>): void;
}