@paydock/client-sdk
Version:
Paydock client sdk
86 lines • 2.79 kB
TypeScript
import { EventEmitter } from '../helper/event-emitter';
import { ApiInternal } from '../api/api-internal';
import { SRCProvider } from './providers/src-provider';
import { IStyles, IClickToPayMeta } from './interfaces';
declare abstract class SRC {
protected iframe_selector: string;
protected service_id: string;
protected public_key_or_access_token: string;
protected meta: IClickToPayMeta;
protected eventEmitter: EventEmitter;
protected env: string;
protected alias?: string;
protected api: ApiInternal;
protected provider: SRCProvider;
protected autoResize: boolean;
protected style: IStyles;
constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IClickToPayMeta);
/**
* Object contain styles for widget - call before `.load()`.
*
* @example
* widget.setStyles({
* enable_src_popup: true
* primary_button_color: 'red',
* secondary_button_color: 'blue',
* primary_button_text_color: 'white',
* secondary_button_text_color: 'white',
* font_family: 'Arial',
* });
* @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
*/
setStyles(styles: IStyles): void;
private setStyle;
load(): void;
/**
* Current method can change environment. By default environment = sandbox.
* Also we can change domain alias for this environment. By default domain_alias = paydock.com
*
* @example
* SRC.setEnv('production');
* @param {string} env - sandbox, production
* @param {string} [alias] - Own domain alias
*/
setEnv(env: string, alias?: string): void;
/**
* Method to read the current environment
*
* @example
* SRC.getEnv();
*/
getEnv(): string;
on(eventName: string): Promise<any>;
on(eventName: string, cb: (data: any) => void): any;
/**
* Using this method you can hide checkout after load and button click
* @param {boolean} [saveSize=false] - using this param you can save iframe's size (if applicable)
*
* @example
* SRC.hideCheckout();
*/
hideCheckout(saveSize: boolean): void;
/**
* Using this method you can show checkout after using hideCheckout method
*
* @example
* SRC.showCheckout()
*/
showCheckout(): void;
/**
* Using this method you can reload the whole checkout
*
* @example
* SRC.reload()
*/
reload(): void;
/**
* Use this method for resize checkout iFrame according to content height, if applicable
*
* @example
* SRC.useAutoResize();
*
*/
useAutoResize(): void;
}
export { SRC };
//# sourceMappingURL=secure-remote-commerce.d.ts.map