UNPKG

@paydock/client-sdk

Version:

Paydock client sdk

53 lines 2 kB
import type { Customer, IClickToPayMeta } from './interfaces'; import { SRC } from './secure-remote-commerce'; /** * Class ClickToPay include methods for interacting with the ClickToPay checkout and Manual Card option * * @extends SRC * * @constructor * * @param {string} iframe_selector - Selector of html element. Container for Click To Pay checkout iFrame. * @param {string} service_id - Card Scheme Service ID * @param {string} public_key_or_access_token - Paydock public key or Access Token * @param {IClickToPayMeta} meta - Data that configures the Click To Pay checkout * @example * var mastercardSRC = new ClickToPay('#checkoutIframe', 'service_id', 'public_key', {}); * */ declare class ClickToPay extends SRC { protected iframe_selector: string; protected service_id: string; protected public_key_or_access_token: string; protected meta: IClickToPayMeta; protected holdingForCustomerData: boolean; private pendingCustomerData; /** @constructs */ constructor(iframe_selector: string, service_id: string, public_key_or_access_token: string, meta: IClickToPayMeta); /** * The final method after configuring the SRC to start the load process of Click To Pay checkout */ load(): void; /** * Inject customer data after widget initialization via postMessage * * @param {Customer} customerData - Customer data to inject * @throws {Error} When customer data is invalid or widget is not ready * @example * widget.injectCustomerData({ * email: 'user@example.com', * first_name: 'John', * last_name: 'Doe' * }); */ injectCustomerData(customerData: Customer): void; /** * Validate customer data format * * @private * @param {Customer} customerData - Customer data to validate * @returns {boolean} True if valid */ private validateCustomerData; } export { ClickToPay }; //# sourceMappingURL=click-to-pay-secure-remote-commerce.d.ts.map