import * as i0 from '@angular/core'; import { EventEmitter, ModuleWithProviders, EnvironmentProviders, InjectionToken } from '@angular/core'; interface MonnifyOptions { /** * Development status. Set to `true` to load the Monnify **sandbox** SDK, and * `false` (the default) to load the **live production** SDK. * * See {@link https://developers.monnify.com/ the Monnify developer docs}. */ isTestMode?: boolean; /** * Merchant's API Key (Can be found on the Monnify dashboard) */ apiKey: string; /** * Merchant's contract code (Can be found on the Monnify dashboard) */ contractCode: string; /** * The amount to be paid by the customer */ amount: number; /** * The currency of the transaction being initialized. `NGN` */ currency: string; /** * Merchant's Unique reference for every transaction. * (The SDK already has a code snippet that generates this for you, but you can always replace it) */ reference: string; /** * Full name of the customer */ customerFullName: string; /** * Email address of the customer */ customerEmail: string; /** * Phone number of the customer. */ customerMobileNumber: string; /** * Description for the transaction. Will be used as the account name for bank transfer payments */ paymentDescription?: string; /** * Transaction Hash added to the transaction response for security purposes. * See {@link https://developers.monnify.com/ the Monnify developer docs} for * information on how to calculate the hash value. */ transactionHash?: object; /** * Status of the transaction ("PAID", "PENDING" or "FAILED") */ paymentStatus?: 'PAID' | 'PENDING' | 'FAILED' | string; /** * Object containing specifications on how payments to this reserve account should be split. */ incomeSplitConfig?: MonnifySplitOptions[]; /** * Redirect URL */ redirectUrl?: string; /** * When you need to pass extra data to the API. */ metadata?: object; } interface MonnifySplitOptions { /** * The unique reference for the sub account that should receive the split. */ subAccountCode: string; /** * Boolean to determine if the sub account should bear transaction fees or not */ feeBearer?: boolean; /** * The percentage of the transaction fee to be borne by the sub account */ feePercentage?: number; /** * The percentage of the amount paid to be split into the sub account. */ splitPercentage?: string; /** * The percentage of the amount paid to be split into the sub account. */ splitAmount?: number; } interface PrivateMonnifyOptions extends MonnifyOptions { /** * A function to be called on successful card charge. User’s can always be redirected to a successful or * failed page supplied by the merchant here based on response * @param response?: The server response */ onComplete: (response?: unknown) => void; /** * A function to be called when the pay modal is closed. */ onClose: (response?: unknown) => void; /** * A function to be called when payment is about to begin */ init?: () => void; } /** * Renders a button that opens the Monnify checkout when clicked. * * Standalone as of v2 — import it directly into a standalone component, or keep * using `AngularMonnifyModule`. */ declare class AngularMonnifyComponent { apiKey?: string; isTestMode?: boolean; contractCode?: string; amount?: number; metadata?: object; reference?: string; currency?: string; customerFullName?: string; customerEmail?: string; customerMobileNumber?: string; paymentDescription?: string; incomeSplitConfig?: MonnifySplitOptions[]; redirectUrl?: string; monnifyOptions?: Partial; class?: string; style?: object; paymentInit: EventEmitter; onClose: EventEmitter; onComplete: EventEmitter; /** The options last handed to the Monnify SDK. Exposed for debugging/tests. */ _MonnifyOptions: Partial; private readonly monnifyService; private isPaying; /** * Validate the inputs and open the Monnify checkout. * * @returns the validation error message, or `undefined` once checkout opened. */ pay(): Promise; validateInput(obj: Partial): string; generateOptions(obj: Partial): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Opens the Monnify checkout when the host element is clicked. * * Standalone as of v2 — import it directly into a standalone component, or keep * using `AngularMonnifyModule`. */ declare class AngularMonnifyDirective { apiKey?: string; isTestMode?: boolean; contractCode?: string; amount?: number; metadata?: object; reference?: string; currency?: string; customerFullName?: string; customerEmail?: string; customerMobileNumber?: string; paymentDescription?: string; incomeSplitConfig?: MonnifySplitOptions[]; redirectUrl?: string; monnifyOptions?: Partial; paymentInit: EventEmitter; onClose: EventEmitter; onComplete: EventEmitter; /** The options last handed to the Monnify SDK. Exposed for debugging/tests. */ _MonnifyOptions: Partial; private readonly monnifyService; private isPaying; /** * Validate the inputs and open the Monnify checkout. * * @returns the validation error message, or `undefined` once checkout opened. */ pay(): Promise; validateInput(obj: Partial): string; generateOptions(obj: Partial): void; buttonClick(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * NgModule wrapper around the standalone `AngularMonnifyComponent` and * `AngularMonnifyDirective`. * * Existing (v1) apps keep working unchanged: * * ```ts * imports: [AngularMonnifyModule.forRoot('apiKey', 'contractCode', false)] * ``` * * Standalone apps should prefer `provideAngularMonnify()` and import the * component/directive directly. */ declare class AngularMonnifyModule { /** * Register the merchant credentials application-wide. * * @param apiKey Merchant's API key from the Monnify dashboard. * @param contractCode Merchant's contract code from the Monnify dashboard. * @param isTestMode `true` loads the sandbox SDK, `false` (default) loads the * live production SDK. */ static forRoot(apiKey: string, contractCode: string, isTestMode?: boolean): ModuleWithProviders; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * Standalone equivalent of `AngularMonnifyModule.forRoot()`. * * ```ts * bootstrapApplication(AppComponent, { * providers: [provideAngularMonnify('apiKey', 'contractCode', false)], * }); * ``` * * @param apiKey Merchant's API key from the Monnify dashboard. * @param contractCode Merchant's contract code from the Monnify dashboard. * @param isTestMode `true` loads the sandbox SDK, `false` (default) loads the * live production SDK. */ declare function provideAngularMonnify(apiKey: string, contractCode: string, isTestMode?: boolean): EnvironmentProviders; declare class AngularMonnifyService { private readonly apiKey; private readonly contractCode; private readonly isTestMode; /** * Resolve the Monnify web SDK URL for the given mode. * * `true` -> sandbox SDK, `false` -> live production SDK. */ getScriptUrl(test?: boolean): string; /** * Append the Monnify web SDK `