UNPKG

@paydock/client-sdk

Version:

Paydock client sdk

93 lines 3.16 kB
import { Link } from '../components/link'; import { Configuration } from '../widget/configuration'; import { IStyles } from '../components/param'; /** * * Class PaymentSourceWidget include method for for creating iframe url * @constructor * * @param {string} publicKey - PayDock users public key * @param {string} customer - PayDock's customer_id or customer_reference (In order to use the customer_reference, you must explicitly specify useReference as true) * @param {boolean} [useReference=false] * * @example * var widget = new PaymentSourceWidget('publicKey','customerId'); * // or * var widget = new PaymentSourceWidget('publicKey', customerReference, true); */ declare class PaymentSourceWidget { protected link: Link; protected configs: Configuration[]; protected configTokens: string[]; protected publicKey: string; /** @constructs */ constructor(accessToken: string, queryToken: string); /** * Object contain styles for widget * * @example * widget.setStyles({ * background_color: 'rgb(0, 0, 0)', * border_color: 'yellow', * text_color: '#FFFFAA', * icon_size: 'small', * font_size: '20px' * }); * @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE} */ setStyles(styles: IStyles): void; setStyle(param: string, value: string): void; /** * Current method can set custom ID to identify the data in the future * * @example * widget.setRefId('id'); * * @param {string} refId - custom id */ setRefId(refId: string): void; /** * Current method can set limit for payment sources count. In case when limit sets less then general count will be shown pagination buttons prev and next. * * @param {string} count - payment source count */ setLimit(count: number): 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 * widget.setEnv('production'); * @param {string} env - sandbox, production * @param {string} [alias] - Own domain alias */ setEnv(env: string, alias?: string): void; getEnv(): void; /** * Method for getting iframe's url */ getIFrameUrl(): string; /** * Show payment source inside widget only with requested gateway ids * * * @param {string[]} ids - List of gateway_id */ filterByGatewayIds(ids: string[]): void; /** * * Show payment source inside widget only with requested payment source types * * @param types - List of payment source types. Available parameters [PAYMENT_TYPE]{@link PAYMENT_TYPE} */ filterByTypes(types: string[]): void; /** * Method for setting a custom language code * * @example * config.setLanguage('en'); * @param {string} code - ISO 639-1 */ setLanguage(code: any): void; } export { PaymentSourceWidget }; //# sourceMappingURL=payment-source-widget.d.ts.map