UNPKG

@mollie/api-client

Version:
40 lines (39 loc) 1.61 kB
import type TransformingNetworkClient from '../../communication/TransformingNetworkClient'; import type HelpfulIterator from '../../plumbing/iteration/HelpfulIterator'; import type Callback from '../../types/Callback'; import type Maybe from '../../types/Maybe'; import { type ThrottlingParameter } from '../../types/parameters'; import Helper from '../Helper'; import type Customer from '../customers/Customer'; import type Payment from '../payments/Payment'; import type Profile from '../profiles/Profile'; import type Subscription from './Subscription'; import { type SubscriptionData } from './data'; export default class SubscriptionHelper extends Helper<SubscriptionData, Subscription> { protected readonly links: SubscriptionData['_links']; constructor(networkClient: TransformingNetworkClient, links: SubscriptionData['_links']); /** * Returns the URL Mollie will call as soon a payment status change takes place. */ getWebhookUrl(this: SubscriptionData): string; /** * Returns the customer the subscription is for. * * @since 3.6.0 */ getCustomer(): Promise<Customer>; getCustomer(callback: Callback<Customer>): void; /** * Returns the website profile on which this subscription was created. * * @since 3.6.0 */ getProfile(): Promise<Profile> | Promise<undefined>; getProfile(callback: Callback<Maybe<Profile>>): void; /** * Returns the payments that are created by this subscription. * * @since 3.6.0 */ getPayments(parameters?: ThrottlingParameter): HelpfulIterator<Payment>; }