@mollie/api-client
Version:
Official Mollie API client for Node
76 lines (75 loc) • 3.65 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 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/v2/profiles-api/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/v2/profiles-api/get-profile
*/
get(id: string): Promise<Profile>;
get(id: string, 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/v2/profiles-api/get-profile-me
*/
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/v2/profiles-api/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/v2/profiles-api/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/v2/profiles-api/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/v2/profiles-api/delete-profile
*/
delete(id: string, parameters?: DeleteParameters): Promise<true>;
delete(id: string, parameters: DeleteParameters, callback: Callback<true>): void;
}