@paydock/client-sdk 1.143.0 → 1.144.1-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +158 -0
- package/bundles/index.cjs +920 -661
- package/bundles/index.cjs.d.ts +1046 -399
- package/bundles/index.mjs +915 -662
- package/bundles/index.mjs.d.ts +1046 -399
- package/bundles/types/api/api-base.d.ts +15 -2
- package/bundles/types/api/api-base.d.ts.map +1 -1
- package/bundles/types/api/api-charge-internal.d.ts +3 -49
- package/bundles/types/api/api-charge-internal.d.ts.map +1 -1
- package/bundles/types/api/api-checkout-internal.d.ts +1 -47
- package/bundles/types/api/api-checkout-internal.d.ts.map +1 -1
- package/bundles/types/api/api-shared-types.d.ts +53 -0
- package/bundles/types/api/api-shared-types.d.ts.map +1 -0
- package/bundles/types/canvas-3ds/canvas-3ds-event-map.d.ts +95 -0
- package/bundles/types/canvas-3ds/canvas-3ds-event-map.d.ts.map +1 -0
- package/bundles/types/canvas-3ds/canvas-3ds.d.ts +10 -7
- package/bundles/types/canvas-3ds/canvas-3ds.d.ts.map +1 -1
- package/bundles/types/canvas-3ds/index.d.ts +4 -0
- package/bundles/types/canvas-3ds/index.d.ts.map +1 -1
- package/bundles/types/canvas-3ds/services/gpayments-service.d.ts +41 -12
- package/bundles/types/canvas-3ds/services/gpayments-service.d.ts.map +1 -1
- package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts +20 -2
- package/bundles/types/canvas-3ds/services/standalone3ds-service.d.ts.map +1 -1
- package/bundles/types/checkout/checkout-event-map.d.ts +43 -0
- package/bundles/types/checkout/checkout-event-map.d.ts.map +1 -0
- package/bundles/types/checkout/checkout.d.ts +25 -9
- package/bundles/types/checkout/checkout.d.ts.map +1 -1
- package/bundles/types/checkout/v1/instructions/instruction.canvas_3ds.show.d.ts.map +1 -1
- package/bundles/types/checkout/v3/instructions/instruction.canvas_3ds.show.d.ts.map +1 -1
- package/bundles/types/components/param.d.ts +29 -0
- package/bundles/types/components/param.d.ts.map +1 -1
- package/bundles/types/helper/event-error.d.ts +49 -1
- package/bundles/types/helper/event-error.d.ts.map +1 -1
- package/bundles/types/index-cba.d.ts +3 -1
- package/bundles/types/index-cba.d.ts.map +1 -1
- package/bundles/types/index.d.ts +12 -1
- package/bundles/types/index.d.ts.map +1 -1
- package/bundles/types/open-wallets/base/open-wallet-buttons.d.ts +37 -0
- package/bundles/types/open-wallets/base/open-wallet-buttons.d.ts.map +1 -1
- package/bundles/types/open-wallets/base/open-wallet.service.d.ts +12 -0
- package/bundles/types/open-wallets/base/open-wallet.service.d.ts.map +1 -1
- package/bundles/types/open-wallets/google-pay-open-wallet-button.d.ts.map +1 -1
- package/bundles/types/open-wallets/index.d.ts +25 -0
- package/bundles/types/open-wallets/index.d.ts.map +1 -1
- package/bundles/types/open-wallets/interfaces/apple-pay/apple-pay-payment-request.interface.d.ts +2 -2
- package/bundles/types/open-wallets/interfaces/apple-pay/apple-pay-payment-request.interface.d.ts.map +1 -1
- package/bundles/types/open-wallets/interfaces/apple-pay/index.d.ts +1 -1
- package/bundles/types/open-wallets/interfaces/apple-pay/index.d.ts.map +1 -1
- package/bundles/types/open-wallets/interfaces/events.interface.d.ts +1 -1
- package/bundles/types/open-wallets/interfaces/events.interface.d.ts.map +1 -1
- package/bundles/types/open-wallets/interfaces/google-pay/google-pay-meta.interface.d.ts +46 -0
- package/bundles/types/open-wallets/interfaces/google-pay/google-pay-meta.interface.d.ts.map +1 -1
- package/bundles/types/open-wallets/services/apple-pay/apple-pay.open-wallet.service.d.ts +48 -2
- package/bundles/types/open-wallets/services/apple-pay/apple-pay.open-wallet.service.d.ts.map +1 -1
- package/bundles/types/open-wallets/services/google-pay/google-pay.open-wallet.service.d.ts.map +1 -1
- package/bundles/types/open-wallets/types/index.d.ts +1 -1
- package/bundles/types/open-wallets/types/index.d.ts.map +1 -1
- package/bundles/types/open-wallets/types/payment-source.type.d.ts +104 -0
- package/bundles/types/open-wallets/types/payment-source.type.d.ts.map +1 -1
- package/bundles/types/secure-remote-commerce/secure-remote-commerce.d.ts.map +1 -1
- package/bundles/types/wallet-buttons/interfaces.d.ts +55 -1
- package/bundles/types/wallet-buttons/interfaces.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/interfaces/base-wallet-meta.interface.d.ts +7 -0
- package/bundles/types/wallet-buttons-express/interfaces/base-wallet-meta.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts +23 -0
- package/bundles/types/wallet-buttons-express/services/apple-pay/interfaces/apple-pay-wallet-meta.interface.d.ts.map +1 -1
- package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts +31 -0
- package/bundles/types/wallet-buttons-express/services/paypal/interfaces/paypal-wallet-meta.interface.d.ts.map +1 -1
- package/bundles/widget.umd.js +920 -661
- package/bundles/widget.umd.js.d.ts +1046 -399
- package/bundles/widget.umd.js.min.d.ts +1046 -399
- package/bundles/widget.umd.min.js +1 -1
- package/docs/api-canvas3ds.md +19 -12
- package/docs/open-wallet-buttons.md +158 -0
- package/package.json +6 -2
package/bundles/index.mjs.d.ts
CHANGED
|
@@ -133,164 +133,6 @@ declare class Env implements IEnvironment {
|
|
|
133
133
|
private validateEnvironmentId;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
type HttpRequestMethod = 'GET' | 'POST';
|
|
137
|
-
type HttpRequestUrl = string | URL;
|
|
138
|
-
|
|
139
|
-
type AgentPrototype = Pick<(typeof MicroAgent)['prototype'], 'addPageAction' | 'noticeError'>;
|
|
140
|
-
type AgentMethodNames = keyof AgentPrototype;
|
|
141
|
-
type AgentMethodParameters<T extends AgentMethodNames> = Parameters<AgentPrototype[T]>;
|
|
142
|
-
type InstrumentationClient = {
|
|
143
|
-
call<T extends AgentMethodNames>(method: T, ...args: AgentMethodParameters<T>): void;
|
|
144
|
-
};
|
|
145
|
-
declare class InstrumentationAgent extends MicroAgent {
|
|
146
|
-
private static agent;
|
|
147
|
-
private static available;
|
|
148
|
-
private static initialized;
|
|
149
|
-
private static readonly noopClient;
|
|
150
|
-
private constructor();
|
|
151
|
-
static get instance(): InstrumentationClient;
|
|
152
|
-
isAvailable(): boolean;
|
|
153
|
-
call: <T extends "addPageAction" | "noticeError">(method: T, ...args: AgentMethodParameters<T>) => void;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
interface CustomEventDTO {
|
|
157
|
-
environment: string;
|
|
158
|
-
appId?: never;
|
|
159
|
-
timestamp?: never;
|
|
160
|
-
[x: string]: unknown;
|
|
161
|
-
}
|
|
162
|
-
interface ReportBaseContext {
|
|
163
|
-
sdkVersion: string | null;
|
|
164
|
-
description?: string;
|
|
165
|
-
environment?: string;
|
|
166
|
-
[x: string]: SerializableValue | undefined;
|
|
167
|
-
}
|
|
168
|
-
type SerializableValue = string | number | symbol | object | null;
|
|
169
|
-
|
|
170
|
-
type ReportErrorFn = (repository: ErrorRepository, error: string | Error, ctx: ReportBaseContext & ({
|
|
171
|
-
className: string;
|
|
172
|
-
classMethod: string;
|
|
173
|
-
functionName?: never;
|
|
174
|
-
} | {
|
|
175
|
-
className?: never;
|
|
176
|
-
classMethod?: never;
|
|
177
|
-
functionName: string;
|
|
178
|
-
})) => void;
|
|
179
|
-
declare class ErrorRepository {
|
|
180
|
-
private readonly agent;
|
|
181
|
-
constructor();
|
|
182
|
-
createError(...args: Parameters<InstrumentationAgent['noticeError']>): Promise<void>;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
type ReportEventFn = (repository: EventRepository, actionName: string, ctx: ReportBaseContext & CustomEventDTO) => void;
|
|
186
|
-
declare class EventRepository {
|
|
187
|
-
private readonly agent;
|
|
188
|
-
constructor();
|
|
189
|
-
createEvent(...args: Parameters<InstrumentationAgent['addPageAction']>): Promise<void>;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
declare enum API_AUTH_TYPE {
|
|
193
|
-
PUBLIC_KEY = 0,
|
|
194
|
-
TOKEN = 1
|
|
195
|
-
}
|
|
196
|
-
declare class ApiBase {
|
|
197
|
-
protected env: Env;
|
|
198
|
-
auth: string;
|
|
199
|
-
authType: API_AUTH_TYPE;
|
|
200
|
-
constructor(auth: string, authType?: API_AUTH_TYPE);
|
|
201
|
-
/**
|
|
202
|
-
* Current method can change environment. By default environment = sandbox.
|
|
203
|
-
* Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
204
|
-
*
|
|
205
|
-
* @example
|
|
206
|
-
* widget.setEnv('production');
|
|
207
|
-
* @param {string} env - sandbox, production
|
|
208
|
-
* @param {string} [alias] - Own domain alias
|
|
209
|
-
*/
|
|
210
|
-
setEnv(env: string, alias?: string): ApiBase;
|
|
211
|
-
requestObservable<Req extends object, Res>(method: 'GET' | 'POST', url: string, requestBody: Req): Observable<Res>;
|
|
212
|
-
private makeRequest;
|
|
213
|
-
private onRequestLoad;
|
|
214
|
-
private onRequestError;
|
|
215
|
-
setAuthType(): API_AUTH_TYPE;
|
|
216
|
-
getClient(method: Extract<HttpRequestMethod, 'GET' | 'POST'>, link: string): {
|
|
217
|
-
config: XMLHttpRequest;
|
|
218
|
-
send: (body: any, cb?: (data) => void, errorCb?: (data: any) => any) => void;
|
|
219
|
-
};
|
|
220
|
-
getClientPromise<Req extends object, Res>(method: Extract<HttpRequestMethod, 'GET' | 'POST'>, link: string): {
|
|
221
|
-
config: XMLHttpRequest;
|
|
222
|
-
send: (body: Req) => Promise<Res>;
|
|
223
|
-
};
|
|
224
|
-
parser({ text, status }: {
|
|
225
|
-
text: string;
|
|
226
|
-
status: number;
|
|
227
|
-
}, cb: any, errorCb: any): any;
|
|
228
|
-
parserPromise<Res>({ text, status, }: {
|
|
229
|
-
text: string;
|
|
230
|
-
status: number;
|
|
231
|
-
}): Promise<Res>;
|
|
232
|
-
reportEvent: ReportEventFn;
|
|
233
|
-
reportError: ReportErrorFn;
|
|
234
|
-
protected newApiRequest(method: Extract<HttpRequestMethod, 'GET' | 'POST'>, link: string): XMLHttpRequest;
|
|
235
|
-
get ctx(): {
|
|
236
|
-
sdkVersion: string;
|
|
237
|
-
className: string;
|
|
238
|
-
environment: string;
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Interface for browser details response.
|
|
244
|
-
* @interface BrowserDetails
|
|
245
|
-
*
|
|
246
|
-
* @param {string} [name]
|
|
247
|
-
* @param {string} [java_enabled]
|
|
248
|
-
* @param {string} [language]
|
|
249
|
-
* @param {string} [screen_height]
|
|
250
|
-
* @param {string} [screen_width]
|
|
251
|
-
* @param {string} [time_zone]
|
|
252
|
-
* @param {string} [color_depth]
|
|
253
|
-
* */
|
|
254
|
-
interface BrowserDetails {
|
|
255
|
-
name: string;
|
|
256
|
-
java_enabled: string;
|
|
257
|
-
language: string;
|
|
258
|
-
screen_height: string;
|
|
259
|
-
screen_width: string;
|
|
260
|
-
time_zone: string;
|
|
261
|
-
color_depth: string;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Class Api include method for working with paydock api
|
|
265
|
-
* @constructor
|
|
266
|
-
*
|
|
267
|
-
* @param {string} publicKey - PayDock users public key
|
|
268
|
-
* @example
|
|
269
|
-
* var api = new Api('publicKey');
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
**/
|
|
273
|
-
declare class Api extends ApiBase {
|
|
274
|
-
publicKey: String;
|
|
275
|
-
/** @constructs */ constructor(publicKey: string);
|
|
276
|
-
/**
|
|
277
|
-
* Method for getting browser details
|
|
278
|
-
*
|
|
279
|
-
* @example
|
|
280
|
-
* api.getBrowserDetails();
|
|
281
|
-
*
|
|
282
|
-
* @return {BrowserDetails} Browser details object
|
|
283
|
-
*/
|
|
284
|
-
getBrowserDetails(): BrowserDetails;
|
|
285
|
-
/**
|
|
286
|
-
* Current method allows to work with charge related endpoints
|
|
287
|
-
*
|
|
288
|
-
* @example
|
|
289
|
-
* api.charge();
|
|
290
|
-
*/
|
|
291
|
-
charge(): ApiCharge;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
136
|
/**
|
|
295
137
|
* List of available form field validators dedicated to cards and their definition
|
|
296
138
|
*
|
|
@@ -704,64 +546,59 @@ type WalletRawDataInitialization = {
|
|
|
704
546
|
} | object;
|
|
705
547
|
type ApplePayRawDataInitialization = ApplePayJS.ApplePayPaymentRequest;
|
|
706
548
|
type GooglePayRawDataInitialization = google.payments.api.IsReadyToPayPaymentMethodSpecification | google.payments.api.PaymentMethodSpecification;
|
|
549
|
+
/**
|
|
550
|
+
* Metadata for the multi-wallet `WalletButtons` container (chargeToken-based flow).
|
|
551
|
+
* Drives the appearance and behavior of every wallet button rendered by the container.
|
|
552
|
+
*
|
|
553
|
+
* Most fields are optional because their defaults are derived from the chargeToken
|
|
554
|
+
* the constructor decodes; set them explicitly only to override.
|
|
555
|
+
*/
|
|
707
556
|
interface IWalletMeta {
|
|
557
|
+
/** Label shown next to the total in the wallet sheet (e.g. `'TOTAL'`). */
|
|
708
558
|
amount_label?: string;
|
|
559
|
+
/** ISO 3166-1 alpha-2 country code for the transaction (e.g. `'AU'`). */
|
|
709
560
|
country?: string;
|
|
561
|
+
/** Enable PayPal's Pay Later messaging when the PayPal wallet is rendered. */
|
|
710
562
|
pay_later?: boolean;
|
|
563
|
+
/** Hide PayPal's Pay Later message copy. */
|
|
711
564
|
hide_message?: boolean;
|
|
565
|
+
/** Render the PayPal standalone button instead of the smart button group. */
|
|
712
566
|
standalone?: boolean;
|
|
567
|
+
/** Whether to surface billing address fields in the wallet sheet. */
|
|
713
568
|
show_billing_address?: boolean;
|
|
569
|
+
/** Whether to collect the payer's name. */
|
|
714
570
|
request_payer_name?: boolean;
|
|
571
|
+
/** Whether to collect the payer's email. */
|
|
715
572
|
request_payer_email?: boolean;
|
|
573
|
+
/** Whether to collect the payer's phone number. */
|
|
716
574
|
request_payer_phone?: boolean;
|
|
575
|
+
/** Whether to collect a shipping address. */
|
|
717
576
|
request_shipping?: boolean;
|
|
577
|
+
/** Available shipping options to display. The first item is selected by default. */
|
|
718
578
|
shipping_options?: IShippingOption[];
|
|
579
|
+
/** Merchant display name shown in the wallet sheet. */
|
|
719
580
|
merchant_name?: string;
|
|
581
|
+
/** Wallet-native payment request objects passed through verbatim (advanced — overrides SDK defaults). */
|
|
720
582
|
raw_data_initialization?: WalletRawDataInitialization;
|
|
583
|
+
/** Optional access token for wallets that require additional auth beyond the chargeToken. */
|
|
721
584
|
access_token?: string;
|
|
585
|
+
/** Optional refresh token paired with `access_token`. */
|
|
722
586
|
refresh_token?: string;
|
|
587
|
+
/** Visual styling overrides for the wallet buttons. */
|
|
723
588
|
style?: WalletStyles;
|
|
589
|
+
/** Restrict which wallets the container should render. Defaults to all wallets the chargeToken authorizes. */
|
|
724
590
|
wallets?: WALLET_TYPE[];
|
|
591
|
+
/** Optional client identifier passed through to the wallet provider when required. */
|
|
725
592
|
client_id?: string;
|
|
593
|
+
/**
|
|
594
|
+
* Apple Pay device capabilities allowed for the button to be considered available.
|
|
595
|
+
* Used as a relaxation knob for testing — defaults to `['paymentCredentialsAvailable']` only.
|
|
596
|
+
*/
|
|
726
597
|
apple_pay_capabilities?: Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>;
|
|
727
598
|
}
|
|
728
599
|
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
protected linkResource: string;
|
|
732
|
-
protected params: IParams;
|
|
733
|
-
protected widgetId: string;
|
|
734
|
-
constructor(linkResource: string);
|
|
735
|
-
getNetUrl(): string;
|
|
736
|
-
getUrl(): string;
|
|
737
|
-
setParams(params: IParams | IWalletParams | ISRCParams): void;
|
|
738
|
-
concatParams(params: IParams): void;
|
|
739
|
-
getParams(): IParams;
|
|
740
|
-
setEnv(env: string, alias?: string): void;
|
|
741
|
-
getEnv(): string;
|
|
742
|
-
getBaseUrl(): string;
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
declare class IFrame {
|
|
746
|
-
protected container: Container;
|
|
747
|
-
constructor(container: Container);
|
|
748
|
-
load(link: string, options?: {
|
|
749
|
-
title?: string;
|
|
750
|
-
attributes?: Record<string, string>;
|
|
751
|
-
styles?: Record<string, string>;
|
|
752
|
-
}, iframeClass?: string): void;
|
|
753
|
-
loadFromHtml(content: string, options?: {
|
|
754
|
-
title?: string;
|
|
755
|
-
}, iframeClass?: string): void;
|
|
756
|
-
remove(): void;
|
|
757
|
-
show(): void;
|
|
758
|
-
hide(saveSize?: boolean): void;
|
|
759
|
-
isExist(): boolean;
|
|
760
|
-
getElement(): HTMLIFrameElement;
|
|
761
|
-
setStyle(property: string, value: string): void;
|
|
762
|
-
setIframeHeight(iframeElement: HTMLIFrameElement, iFrameDocument: Document, selector: string): void;
|
|
763
|
-
private setStyles;
|
|
764
|
-
}
|
|
600
|
+
type HttpRequestMethod = 'GET' | 'POST';
|
|
601
|
+
type HttpRequestUrl = string | URL;
|
|
765
602
|
|
|
766
603
|
/**
|
|
767
604
|
* List of available payment source types
|
|
@@ -927,38 +764,129 @@ declare class Configuration {
|
|
|
927
764
|
disableResultMessage(): void;
|
|
928
765
|
}
|
|
929
766
|
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
767
|
+
declare class IFrame {
|
|
768
|
+
protected container: Container;
|
|
769
|
+
constructor(container: Container);
|
|
770
|
+
load(link: string, options?: {
|
|
771
|
+
title?: string;
|
|
772
|
+
attributes?: Record<string, string>;
|
|
773
|
+
styles?: Record<string, string>;
|
|
774
|
+
}, iframeClass?: string): void;
|
|
775
|
+
loadFromHtml(content: string, options?: {
|
|
776
|
+
title?: string;
|
|
777
|
+
}, iframeClass?: string): void;
|
|
778
|
+
remove(): void;
|
|
779
|
+
show(): void;
|
|
780
|
+
hide(saveSize?: boolean): void;
|
|
781
|
+
isExist(): boolean;
|
|
782
|
+
getElement(): HTMLIFrameElement;
|
|
783
|
+
setStyle(property: string, value: string): void;
|
|
784
|
+
setIframeHeight(iframeElement: HTMLIFrameElement, iFrameDocument: Document, selector: string): void;
|
|
785
|
+
private setStyles;
|
|
935
786
|
}
|
|
787
|
+
|
|
936
788
|
/**
|
|
937
|
-
*
|
|
938
|
-
* @interface ITriggerData
|
|
789
|
+
* Contains basic information associated with the event.
|
|
939
790
|
*
|
|
940
|
-
*
|
|
941
|
-
*
|
|
942
|
-
* @param {string} [elements]
|
|
943
|
-
* @param {string} [form_values]
|
|
944
|
-
* */
|
|
945
|
-
/**
|
|
946
|
-
* List of available triggers
|
|
791
|
+
* Including event (name), source of the message, purpose and a unique identifier
|
|
792
|
+
* for the event.
|
|
947
793
|
*
|
|
948
|
-
* @
|
|
949
|
-
*
|
|
950
|
-
* @param {string}
|
|
951
|
-
* @param {string}
|
|
952
|
-
* @param {string}
|
|
953
|
-
* @param {string}
|
|
954
|
-
* @param {string} UPDATE_FORM_VALUES=update_form_values
|
|
955
|
-
* @param {string} INIT_CHECKOUT=init_checkout
|
|
956
|
-
* @param {string} INJECT_CUSTOMER_DATA=inject_customer_data
|
|
794
|
+
* @interface IEventData
|
|
795
|
+
*
|
|
796
|
+
* @param {string} event The name of the event.
|
|
797
|
+
* @param {string} message_source A system variable that identifies the event source.
|
|
798
|
+
* @param {string} purpose A system variable that states the purpose of the event.
|
|
799
|
+
* @param {string} [ref_id] Custom unique value that identifies result of processed operation.
|
|
957
800
|
*/
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
801
|
+
interface IEventData$1 {
|
|
802
|
+
event: string;
|
|
803
|
+
message_source: string;
|
|
804
|
+
purpose: PURPOSE;
|
|
805
|
+
widget_id: string;
|
|
806
|
+
data?: any;
|
|
807
|
+
ref_id?: string;
|
|
808
|
+
error?: IEventError;
|
|
809
|
+
}
|
|
810
|
+
declare const EVENT$3: {
|
|
811
|
+
readonly AFTER_LOAD: "afterLoad";
|
|
812
|
+
readonly SUBMIT: "submit";
|
|
813
|
+
readonly FINISH: "finish";
|
|
814
|
+
readonly VALIDATION_ERROR: "validationError";
|
|
815
|
+
readonly SYSTEM_ERROR: "systemError";
|
|
816
|
+
readonly ERROR: "error";
|
|
817
|
+
/** @deprecated */
|
|
818
|
+
readonly CHECKOUT_SUCCESS: "checkoutSuccess";
|
|
819
|
+
readonly CHECKOUT_READY: "checkoutReady";
|
|
820
|
+
readonly CHECKOUT_ERROR: "checkoutError";
|
|
821
|
+
readonly CHECKOUT_COMPLETED: "checkoutCompleted";
|
|
822
|
+
readonly CHECKOUT_POPUP_OPEN: "checkoutPopupOpen";
|
|
823
|
+
readonly CHECKOUT_POPUP_CLOSE: "checkoutPopupClose";
|
|
824
|
+
readonly RECOGNITION_TOKEN_REQUESTED: "recognitionTokenRequested";
|
|
825
|
+
readonly RECOGNITION_TOKEN_DROPPED: "recognitionTokenDropped";
|
|
826
|
+
readonly VALIDATION: "validation";
|
|
827
|
+
readonly SELECT: "select";
|
|
828
|
+
readonly UNSELECT: "unselect";
|
|
829
|
+
readonly NEXT: "next";
|
|
830
|
+
readonly PREV: "prev";
|
|
831
|
+
readonly META_CHANGE: "metaChange";
|
|
832
|
+
readonly RESIZE: "resize";
|
|
833
|
+
readonly CHARGE_AUTH_SUCCESS: "chargeAuthSuccess";
|
|
834
|
+
readonly CHARGE_AUTH_REJECT: "chargeAuthReject";
|
|
835
|
+
readonly CHARGE_AUTH_CANCELLED: "chargeAuthCancelled";
|
|
836
|
+
readonly ADDITIONAL_DATA_SUCCESS: "additionalDataCollectSuccess";
|
|
837
|
+
readonly ADDITIONAL_DATA_REJECT: "additionalDataCollectReject";
|
|
838
|
+
readonly CHARGE_AUTH: "chargeAuth";
|
|
839
|
+
readonly DISPATCH_SUCCESS: "dispatchSuccess";
|
|
840
|
+
readonly DISPATCH_ERROR: "dispatchError";
|
|
841
|
+
};
|
|
842
|
+
type EventTypes = typeof EVENT$3[keyof typeof EVENT$3];
|
|
843
|
+
interface Listener {
|
|
844
|
+
event: string;
|
|
845
|
+
listener: (event: any) => void;
|
|
846
|
+
widget_id: string;
|
|
847
|
+
}
|
|
848
|
+
declare type Listeners = Listener[];
|
|
849
|
+
declare class IFrameEvent {
|
|
850
|
+
protected listeners: Listeners;
|
|
851
|
+
constructor(subject: Window | null);
|
|
852
|
+
emit(data: IEventData$1): void;
|
|
853
|
+
on<T>(eventName: string, widgetId: string, cb: (data: T) => void): void;
|
|
854
|
+
clear(): void;
|
|
855
|
+
private subscribe;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
interface ITriggerData {
|
|
859
|
+
configuration_token?: string;
|
|
860
|
+
tab_number?: number;
|
|
861
|
+
elements?: string;
|
|
862
|
+
form_values?: string;
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Interface for classes that represent a trigger data.
|
|
866
|
+
* @interface ITriggerData
|
|
867
|
+
*
|
|
868
|
+
* @param {string} [configuration_token]
|
|
869
|
+
* @param {string} [tab_number]
|
|
870
|
+
* @param {string} [elements]
|
|
871
|
+
* @param {string} [form_values]
|
|
872
|
+
* */
|
|
873
|
+
/**
|
|
874
|
+
* List of available triggers
|
|
875
|
+
*
|
|
876
|
+
* @type {object}
|
|
877
|
+
* @param {string} SUBMIT_FORM=submit_form
|
|
878
|
+
* @param {string} CHANGE_TAB=tab
|
|
879
|
+
* @param {string} HIDE_ELEMENTS=hide_elements
|
|
880
|
+
* @param {string} SHOW_ELEMENTS=show_elements
|
|
881
|
+
* @param {string} REFRESH_CHECKOUT=refresh_checkout
|
|
882
|
+
* @param {string} UPDATE_FORM_VALUES=update_form_values
|
|
883
|
+
* @param {string} INIT_CHECKOUT=init_checkout
|
|
884
|
+
* @param {string} INJECT_CUSTOMER_DATA=inject_customer_data
|
|
885
|
+
*/
|
|
886
|
+
declare const TRIGGER: {
|
|
887
|
+
SUBMIT_FORM: string;
|
|
888
|
+
CHANGE_TAB: string;
|
|
889
|
+
HIDE_ELEMENTS: string;
|
|
962
890
|
SHOW_ELEMENTS: string;
|
|
963
891
|
REFRESH_CHECKOUT: string;
|
|
964
892
|
UPDATE_FORM_VALUES: string;
|
|
@@ -971,6 +899,22 @@ declare class Trigger {
|
|
|
971
899
|
push(triggerName: string, data?: ITriggerData): void;
|
|
972
900
|
}
|
|
973
901
|
|
|
902
|
+
declare class Link {
|
|
903
|
+
protected env: Env;
|
|
904
|
+
protected linkResource: string;
|
|
905
|
+
protected params: IParams;
|
|
906
|
+
protected widgetId: string;
|
|
907
|
+
constructor(linkResource: string);
|
|
908
|
+
getNetUrl(): string;
|
|
909
|
+
getUrl(): string;
|
|
910
|
+
setParams(params: IParams | IWalletParams | ISRCParams): void;
|
|
911
|
+
concatParams(params: IParams): void;
|
|
912
|
+
getParams(): IParams;
|
|
913
|
+
setEnv(env: string, alias?: string): void;
|
|
914
|
+
getEnv(): string;
|
|
915
|
+
getBaseUrl(): string;
|
|
916
|
+
}
|
|
917
|
+
|
|
974
918
|
/**
|
|
975
919
|
* Current constant include available type of element for styling
|
|
976
920
|
* @const STYLABLE_ELEMENT
|
|
@@ -1069,45 +1013,6 @@ interface IElementStyleTitleDescription {
|
|
|
1069
1013
|
margin?: string;
|
|
1070
1014
|
}
|
|
1071
1015
|
|
|
1072
|
-
declare const ERROR_CATEGORY: {
|
|
1073
|
-
readonly CONFIGURATION: "configuration";
|
|
1074
|
-
readonly IDENTITY: "identity_access_management";
|
|
1075
|
-
readonly INTERNAL: "internal";
|
|
1076
|
-
readonly PROCESS: "process";
|
|
1077
|
-
readonly RESOURCE: "resource";
|
|
1078
|
-
readonly VALIDATION: "validation";
|
|
1079
|
-
};
|
|
1080
|
-
type ErrorCategory = (typeof ERROR_CATEGORY)[keyof typeof ERROR_CATEGORY];
|
|
1081
|
-
declare const ERROR_CAUSE: {
|
|
1082
|
-
readonly ABORTED: "aborted";
|
|
1083
|
-
readonly ACCESS_FORBIDDEN: "access_forbidden";
|
|
1084
|
-
readonly ALREADY_EXISTS: "already_exists";
|
|
1085
|
-
readonly CANCELED: "canceled";
|
|
1086
|
-
readonly INVALID_CONFIGURATION: "invalid_configuration";
|
|
1087
|
-
readonly INVALID_INPUT: "invalid_input";
|
|
1088
|
-
readonly NOT_FOUND: "not_found";
|
|
1089
|
-
readonly NOT_IMPLEMENTED: "not_implemented";
|
|
1090
|
-
readonly RATE_LIMITED: "rate_limited";
|
|
1091
|
-
readonly SERVER_BUSY: "server_busy";
|
|
1092
|
-
readonly SERVICE_UNREACHABLE: "service_unreachable";
|
|
1093
|
-
readonly UNAUTHORIZED: "unauthorized";
|
|
1094
|
-
readonly UNKNOWN: "unknown_error";
|
|
1095
|
-
readonly UNPROCESSABLE_ENTITY: "unprocessable_entity";
|
|
1096
|
-
};
|
|
1097
|
-
type ErrorCause = (typeof ERROR_CAUSE)[keyof typeof ERROR_CAUSE];
|
|
1098
|
-
interface ErrorDetails {
|
|
1099
|
-
cause: ErrorCause;
|
|
1100
|
-
contextId: string;
|
|
1101
|
-
message: string;
|
|
1102
|
-
timestamp: string;
|
|
1103
|
-
}
|
|
1104
|
-
interface IEventError {
|
|
1105
|
-
cause: ErrorCause;
|
|
1106
|
-
category: ErrorCategory;
|
|
1107
|
-
retryable: boolean;
|
|
1108
|
-
details: ErrorDetails;
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
1016
|
/**
|
|
1112
1017
|
*
|
|
1113
1018
|
* Class MultiWidget include method for for creating iframe url
|
|
@@ -2108,86 +2013,390 @@ declare class HtmlWidget extends HtmlMultiWidget {
|
|
|
2108
2013
|
}
|
|
2109
2014
|
|
|
2110
2015
|
/**
|
|
2111
|
-
*
|
|
2016
|
+
* Top-level classification of an error. Used by the SDK to route errors to the
|
|
2017
|
+
* right category in instrumentation and to give consumers a coarse-grained
|
|
2018
|
+
* tag for grouping/filtering. See {@link getErrorCategory} for the mapping
|
|
2019
|
+
* between {@link ERROR_CAUSE} and {@link ERROR_CATEGORY}.
|
|
2020
|
+
*/
|
|
2021
|
+
declare const ERROR_CATEGORY: {
|
|
2022
|
+
/** SDK was misconfigured (missing keys, invalid options, etc.). */
|
|
2023
|
+
readonly CONFIGURATION: "configuration";
|
|
2024
|
+
/** Authentication or authorization failure. */
|
|
2025
|
+
readonly IDENTITY: "identity_access_management";
|
|
2026
|
+
/** SDK internal failure or upstream service problem. */
|
|
2027
|
+
readonly INTERNAL: "internal";
|
|
2028
|
+
/** Flow lifecycle event (user cancelled, aborted, etc.) — not a real fault. */
|
|
2029
|
+
readonly PROCESS: "process";
|
|
2030
|
+
/** Resource lookup failed or was rate-limited. */
|
|
2031
|
+
readonly RESOURCE: "resource";
|
|
2032
|
+
/** Invalid input or business-rule validation failure. */
|
|
2033
|
+
readonly VALIDATION: "validation";
|
|
2034
|
+
};
|
|
2035
|
+
type ErrorCategory = (typeof ERROR_CATEGORY)[keyof typeof ERROR_CATEGORY];
|
|
2036
|
+
/**
|
|
2037
|
+
* Concrete cause of an error. More specific than {@link ERROR_CATEGORY} —
|
|
2038
|
+
* useful for deciding programmatic responses (e.g. show a retry button only
|
|
2039
|
+
* when `cause` is `'service_unreachable'` or `'server_busy'`).
|
|
2040
|
+
*/
|
|
2041
|
+
declare const ERROR_CAUSE: {
|
|
2042
|
+
/** Operation was aborted programmatically. */
|
|
2043
|
+
readonly ABORTED: "aborted";
|
|
2044
|
+
/** Caller has insufficient permissions for the operation. */
|
|
2045
|
+
readonly ACCESS_FORBIDDEN: "access_forbidden";
|
|
2046
|
+
/** Resource already exists when create was expected. */
|
|
2047
|
+
readonly ALREADY_EXISTS: "already_exists";
|
|
2048
|
+
/** User cancelled the flow (e.g. closed the wallet sheet). */
|
|
2049
|
+
readonly CANCELED: "canceled";
|
|
2050
|
+
/** SDK was instantiated or invoked with invalid configuration. */
|
|
2051
|
+
readonly INVALID_CONFIGURATION: "invalid_configuration";
|
|
2052
|
+
/** Input failed structural or business-rule validation. */
|
|
2053
|
+
readonly INVALID_INPUT: "invalid_input";
|
|
2054
|
+
/** Resource was not found by the backend. */
|
|
2055
|
+
readonly NOT_FOUND: "not_found";
|
|
2056
|
+
/** Operation is not supported in the current context or version. */
|
|
2057
|
+
readonly NOT_IMPLEMENTED: "not_implemented";
|
|
2058
|
+
/** Caller exceeded the allowed request rate. */
|
|
2059
|
+
readonly RATE_LIMITED: "rate_limited";
|
|
2060
|
+
/** Backend is healthy but currently overloaded — typically retryable. */
|
|
2061
|
+
readonly SERVER_BUSY: "server_busy";
|
|
2062
|
+
/** Backend or third-party service could not be reached — typically retryable. */
|
|
2063
|
+
readonly SERVICE_UNREACHABLE: "service_unreachable";
|
|
2064
|
+
/** Caller is not authenticated. */
|
|
2065
|
+
readonly UNAUTHORIZED: "unauthorized";
|
|
2066
|
+
/** Catch-all when no other cause applies. */
|
|
2067
|
+
readonly UNKNOWN: "unknown_error";
|
|
2068
|
+
/** Request was syntactically valid but semantically rejected. */
|
|
2069
|
+
readonly UNPROCESSABLE_ENTITY: "unprocessable_entity";
|
|
2070
|
+
};
|
|
2071
|
+
type ErrorCause = (typeof ERROR_CAUSE)[keyof typeof ERROR_CAUSE];
|
|
2072
|
+
/**
|
|
2073
|
+
* Diagnostic detail attached to every {@link IEventError}.
|
|
2074
|
+
* Useful for logging, surfacing user-facing messages, and correlating with
|
|
2075
|
+
* server-side logs via `contextId`.
|
|
2076
|
+
*/
|
|
2077
|
+
interface ErrorDetails {
|
|
2078
|
+
/** Concrete cause classification (mirrors the top-level `cause` on `IEventError`). */
|
|
2079
|
+
cause: ErrorCause;
|
|
2080
|
+
/** Correlation identifier — typically a request id or trace id from the backend. Empty string when none is available. */
|
|
2081
|
+
contextId: string;
|
|
2082
|
+
/** Human-readable message safe to surface to developers (NOT necessarily safe for end-users). */
|
|
2083
|
+
message: string;
|
|
2084
|
+
/** ISO 8601 UTC timestamp captured at error creation time. */
|
|
2085
|
+
timestamp: string;
|
|
2086
|
+
}
|
|
2087
|
+
/**
|
|
2088
|
+
* Standard error envelope emitted by the SDK on event payloads (`IEventData.error`)
|
|
2089
|
+
* and exposed publicly so integrators can `instanceof`/structurally narrow against it.
|
|
2090
|
+
*/
|
|
2091
|
+
interface IEventError {
|
|
2092
|
+
/** Concrete cause of the error. See {@link ERROR_CAUSE} for the full list. */
|
|
2093
|
+
cause: ErrorCause;
|
|
2094
|
+
/** Coarse-grained category derived from `cause`. See {@link ERROR_CATEGORY}. */
|
|
2095
|
+
category: ErrorCategory;
|
|
2096
|
+
/** Whether the operation can be retried as-is. Must be set explicitly by the producer; `EventError.create()` defaults it to `false`. The intended candidates for `true` are transient causes such as `service_unreachable` and `server_busy`. */
|
|
2097
|
+
retryable: boolean;
|
|
2098
|
+
/** Diagnostic detail (message, timestamp, correlation id). */
|
|
2099
|
+
details: ErrorDetails;
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
type AgentPrototype = Pick<(typeof MicroAgent)['prototype'], 'addPageAction' | 'noticeError'>;
|
|
2103
|
+
type AgentMethodNames = keyof AgentPrototype;
|
|
2104
|
+
type AgentMethodParameters<T extends AgentMethodNames> = Parameters<AgentPrototype[T]>;
|
|
2105
|
+
type InstrumentationClient = {
|
|
2106
|
+
call<T extends AgentMethodNames>(method: T, ...args: AgentMethodParameters<T>): void;
|
|
2107
|
+
};
|
|
2108
|
+
declare class InstrumentationAgent extends MicroAgent {
|
|
2109
|
+
private static agent;
|
|
2110
|
+
private static available;
|
|
2111
|
+
private static initialized;
|
|
2112
|
+
private static readonly noopClient;
|
|
2113
|
+
private constructor();
|
|
2114
|
+
static get instance(): InstrumentationClient;
|
|
2115
|
+
isAvailable(): boolean;
|
|
2116
|
+
call: <T extends "addPageAction" | "noticeError">(method: T, ...args: AgentMethodParameters<T>) => void;
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
interface CustomEventDTO {
|
|
2120
|
+
environment: string;
|
|
2121
|
+
appId?: never;
|
|
2122
|
+
timestamp?: never;
|
|
2123
|
+
[x: string]: unknown;
|
|
2124
|
+
}
|
|
2125
|
+
interface ReportBaseContext {
|
|
2126
|
+
sdkVersion: string | null;
|
|
2127
|
+
description?: string;
|
|
2128
|
+
environment?: string;
|
|
2129
|
+
[x: string]: SerializableValue | undefined;
|
|
2130
|
+
}
|
|
2131
|
+
type SerializableValue = string | number | symbol | object | null;
|
|
2132
|
+
|
|
2133
|
+
type ReportErrorFn = (repository: ErrorRepository, error: string | Error, ctx: ReportBaseContext & ({
|
|
2134
|
+
className: string;
|
|
2135
|
+
classMethod: string;
|
|
2136
|
+
functionName?: never;
|
|
2137
|
+
} | {
|
|
2138
|
+
className?: never;
|
|
2139
|
+
classMethod?: never;
|
|
2140
|
+
functionName: string;
|
|
2141
|
+
})) => void;
|
|
2142
|
+
declare class ErrorRepository {
|
|
2143
|
+
private readonly agent;
|
|
2144
|
+
constructor();
|
|
2145
|
+
createError(...args: Parameters<InstrumentationAgent['noticeError']>): Promise<void>;
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
type ReportEventFn = (repository: EventRepository, actionName: string, ctx: ReportBaseContext & CustomEventDTO) => void;
|
|
2149
|
+
declare class EventRepository {
|
|
2150
|
+
private readonly agent;
|
|
2151
|
+
constructor();
|
|
2152
|
+
createEvent(...args: Parameters<InstrumentationAgent['addPageAction']>): Promise<void>;
|
|
2153
|
+
}
|
|
2154
|
+
|
|
2155
|
+
declare enum API_AUTH_TYPE {
|
|
2156
|
+
PUBLIC_KEY = 0,
|
|
2157
|
+
TOKEN = 1
|
|
2158
|
+
}
|
|
2159
|
+
declare class ApiBase {
|
|
2160
|
+
protected env: Env;
|
|
2161
|
+
auth: string;
|
|
2162
|
+
authType: API_AUTH_TYPE;
|
|
2163
|
+
constructor(auth: string, authType?: API_AUTH_TYPE);
|
|
2164
|
+
/**
|
|
2165
|
+
* Current method can change environment. By default environment = sandbox.
|
|
2166
|
+
* Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
2167
|
+
*
|
|
2168
|
+
* @example
|
|
2169
|
+
* widget.setEnv('production');
|
|
2170
|
+
* @param {string} env - sandbox, production
|
|
2171
|
+
* @param {string} [alias] - Own domain alias
|
|
2172
|
+
*/
|
|
2173
|
+
setEnv(env: string, alias?: string): ApiBase;
|
|
2174
|
+
requestObservable<Req extends object, Res>(method: 'GET' | 'POST', url: string, requestBody: Req): Observable<Res>;
|
|
2175
|
+
private makeRequest;
|
|
2176
|
+
private onRequestLoad;
|
|
2177
|
+
private onRequestError;
|
|
2178
|
+
setAuthType(): API_AUTH_TYPE;
|
|
2179
|
+
getClient(method: Extract<HttpRequestMethod, 'GET' | 'POST'>, link: string): {
|
|
2180
|
+
config: XMLHttpRequest;
|
|
2181
|
+
send: (body: any, cb?: (data) => void, errorCb?: (data: any) => any) => void;
|
|
2182
|
+
};
|
|
2183
|
+
getClientPromise<Req extends object, Res>(method: Extract<HttpRequestMethod, 'GET' | 'POST'>, link: string): {
|
|
2184
|
+
config: XMLHttpRequest;
|
|
2185
|
+
send: (body: Req) => Promise<Res>;
|
|
2186
|
+
};
|
|
2187
|
+
parser({ text, status }: {
|
|
2188
|
+
text: string;
|
|
2189
|
+
status: number;
|
|
2190
|
+
}, cb: any, errorCb: any): any;
|
|
2191
|
+
parserPromise<Res>({ text, status }: {
|
|
2192
|
+
text: string;
|
|
2193
|
+
status: number;
|
|
2194
|
+
}): Promise<Res>;
|
|
2195
|
+
/**
|
|
2196
|
+
* Wires the XHR failure events that `onload` does not cover. `onload` only
|
|
2197
|
+
* fires when an HTTP response is received (any status, including 4xx/5xx);
|
|
2198
|
+
* transport-level failures — a dropped connection, a failed CORS preflight,
|
|
2199
|
+
* an HTTP/2 protocol error, or a timeout — fire `onerror`/`ontimeout`/
|
|
2200
|
+
* `onabort` instead. Without these the request never settles and fails
|
|
2201
|
+
* silently (e.g. `onUnavailable` is never invoked for wallet callbacks).
|
|
2202
|
+
*/
|
|
2203
|
+
protected attachFailureHandlers(request: XMLHttpRequest, onFailure: (error: {
|
|
2204
|
+
message: string;
|
|
2205
|
+
code: ErrorCause;
|
|
2206
|
+
}) => void): void;
|
|
2207
|
+
reportEvent: ReportEventFn;
|
|
2208
|
+
reportError: ReportErrorFn;
|
|
2209
|
+
protected newApiRequest(method: Extract<HttpRequestMethod, 'GET' | 'POST'>, link: string): XMLHttpRequest;
|
|
2210
|
+
get ctx(): {
|
|
2211
|
+
sdkVersion: string;
|
|
2212
|
+
className: string;
|
|
2213
|
+
environment: string;
|
|
2214
|
+
};
|
|
2215
|
+
}
|
|
2216
|
+
|
|
2217
|
+
/**
|
|
2218
|
+
* Interface for browser details response.
|
|
2219
|
+
* @interface BrowserDetails
|
|
2112
2220
|
*
|
|
2113
|
-
*
|
|
2114
|
-
*
|
|
2221
|
+
* @param {string} [name]
|
|
2222
|
+
* @param {string} [java_enabled]
|
|
2223
|
+
* @param {string} [language]
|
|
2224
|
+
* @param {string} [screen_height]
|
|
2225
|
+
* @param {string} [screen_width]
|
|
2226
|
+
* @param {string} [time_zone]
|
|
2227
|
+
* @param {string} [color_depth]
|
|
2228
|
+
* */
|
|
2229
|
+
interface BrowserDetails {
|
|
2230
|
+
name: string;
|
|
2231
|
+
java_enabled: string;
|
|
2232
|
+
language: string;
|
|
2233
|
+
screen_height: string;
|
|
2234
|
+
screen_width: string;
|
|
2235
|
+
time_zone: string;
|
|
2236
|
+
color_depth: string;
|
|
2237
|
+
}
|
|
2238
|
+
/**
|
|
2239
|
+
* Class Api include method for working with paydock api
|
|
2240
|
+
* @constructor
|
|
2115
2241
|
*
|
|
2116
|
-
* @
|
|
2242
|
+
* @param {string} publicKey - PayDock users public key
|
|
2243
|
+
* @example
|
|
2244
|
+
* var api = new Api('publicKey');
|
|
2117
2245
|
*
|
|
2118
|
-
*
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2246
|
+
*
|
|
2247
|
+
**/
|
|
2248
|
+
declare class Api extends ApiBase {
|
|
2249
|
+
publicKey: String;
|
|
2250
|
+
/** @constructs */ constructor(publicKey: string);
|
|
2251
|
+
/**
|
|
2252
|
+
* Method for getting browser details
|
|
2253
|
+
*
|
|
2254
|
+
* @example
|
|
2255
|
+
* api.getBrowserDetails();
|
|
2256
|
+
*
|
|
2257
|
+
* @return {BrowserDetails} Browser details object
|
|
2258
|
+
*/
|
|
2259
|
+
getBrowserDetails(): BrowserDetails;
|
|
2260
|
+
/**
|
|
2261
|
+
* Current method allows to work with charge related endpoints
|
|
2262
|
+
*
|
|
2263
|
+
* @example
|
|
2264
|
+
* api.charge();
|
|
2265
|
+
*/
|
|
2266
|
+
charge(): ApiCharge;
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
/**
|
|
2270
|
+
* Decoded payload of the Standalone 3DS charge token (the JWT body) the SDK
|
|
2271
|
+
* receives in `Canvas3ds`'s constructor when the token format is `standalone_3ds`.
|
|
2272
|
+
*
|
|
2273
|
+
* This shape is set by the Paydock backend when minting the token. Integrators
|
|
2274
|
+
* who decode the token themselves can use this interface to type the result.
|
|
2122
2275
|
*/
|
|
2123
|
-
interface
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2276
|
+
interface ITokenStandalone3DS {
|
|
2277
|
+
/** Optional merchant-side correlation identifier carried through from the original charge request. */
|
|
2278
|
+
external_id?: string;
|
|
2279
|
+
/** URL of the first iframe the SDK loads to bootstrap the 3DS provider's authentication flow. */
|
|
2280
|
+
initialization_url: string;
|
|
2281
|
+
/**
|
|
2282
|
+
* @deprecated No longer read by the Standalone 3DS flow. The field is kept
|
|
2283
|
+
* on the interface for backwards compatibility with tokens minted by older
|
|
2284
|
+
* API versions; it will be removed in a future major release. Prefer
|
|
2285
|
+
* `initialization_url` + `secondary_url`.
|
|
2286
|
+
*/
|
|
2287
|
+
authorization_url?: string;
|
|
2288
|
+
/** Optional URL of a secondary iframe used by some providers (e.g. GPayments) for monitoring/polling alongside the main flow. */
|
|
2289
|
+
secondary_url?: string;
|
|
2290
|
+
/** The Paydock 3DS charge identifier this token authorizes. Echoed back in every event payload emitted during the flow. */
|
|
2291
|
+
charge_3ds_id: string;
|
|
2292
|
+
/** Identifier of the 3DS gateway the SDK should delegate to. Currently only `'GPayments'` is handled; other values fall through. */
|
|
2293
|
+
service_type: string;
|
|
2131
2294
|
}
|
|
2132
|
-
declare
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
readonly CHECKOUT_ERROR: "checkoutError";
|
|
2143
|
-
readonly CHECKOUT_COMPLETED: "checkoutCompleted";
|
|
2144
|
-
readonly CHECKOUT_POPUP_OPEN: "checkoutPopupOpen";
|
|
2145
|
-
readonly CHECKOUT_POPUP_CLOSE: "checkoutPopupClose";
|
|
2146
|
-
readonly RECOGNITION_TOKEN_REQUESTED: "recognitionTokenRequested";
|
|
2147
|
-
readonly RECOGNITION_TOKEN_DROPPED: "recognitionTokenDropped";
|
|
2148
|
-
readonly VALIDATION: "validation";
|
|
2149
|
-
readonly SELECT: "select";
|
|
2150
|
-
readonly UNSELECT: "unselect";
|
|
2151
|
-
readonly NEXT: "next";
|
|
2152
|
-
readonly PREV: "prev";
|
|
2153
|
-
readonly META_CHANGE: "metaChange";
|
|
2154
|
-
readonly RESIZE: "resize";
|
|
2155
|
-
readonly CHARGE_AUTH_SUCCESS: "chargeAuthSuccess";
|
|
2156
|
-
readonly CHARGE_AUTH_REJECT: "chargeAuthReject";
|
|
2157
|
-
readonly CHARGE_AUTH_CANCELLED: "chargeAuthCancelled";
|
|
2158
|
-
readonly ADDITIONAL_DATA_SUCCESS: "additionalDataCollectSuccess";
|
|
2159
|
-
readonly ADDITIONAL_DATA_REJECT: "additionalDataCollectReject";
|
|
2160
|
-
readonly CHARGE_AUTH: "chargeAuth";
|
|
2161
|
-
readonly DISPATCH_SUCCESS: "dispatchSuccess";
|
|
2162
|
-
readonly DISPATCH_ERROR: "dispatchError";
|
|
2163
|
-
};
|
|
2164
|
-
type EventTypes = typeof EVENT$2[keyof typeof EVENT$2];
|
|
2165
|
-
interface Listener {
|
|
2166
|
-
event: string;
|
|
2167
|
-
listener: (event: any) => void;
|
|
2168
|
-
widget_id: string;
|
|
2295
|
+
declare class Standalone3dsService {
|
|
2296
|
+
protected container: Container;
|
|
2297
|
+
protected eventEmitter: EventEmitter;
|
|
2298
|
+
protected env: string;
|
|
2299
|
+
protected alias: string;
|
|
2300
|
+
constructor(container: Container, eventEmitter: any);
|
|
2301
|
+
load(token: string, options: {
|
|
2302
|
+
title: string;
|
|
2303
|
+
}): void;
|
|
2304
|
+
setEnv(env: string, alias?: string): void;
|
|
2169
2305
|
}
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2306
|
+
|
|
2307
|
+
/**
|
|
2308
|
+
* Payload emitted by the Standalone 3DS flow for auth-related events
|
|
2309
|
+
* (chargeAuthSuccess, chargeAuthReject, chargeAuthChallenge, chargeAuthDecoupled).
|
|
2310
|
+
*/
|
|
2311
|
+
interface Canvas3dsAuthPayload {
|
|
2312
|
+
/** The Paydock 3DS charge identifier (e.g. `'chrg_3ds_xxxxx'`) used to correlate the authentication with the underlying charge. */
|
|
2313
|
+
charge_3ds_id: string;
|
|
2314
|
+
/** Authentication outcome status reported by the 3DS provider (e.g. `'authenticated'`, `'rejected'`, `'pending'`). */
|
|
2315
|
+
status: string;
|
|
2316
|
+
/** Optional result details. Present when the 3DS provider returns additional context for the outcome. */
|
|
2317
|
+
result?: {
|
|
2318
|
+
/** Human-readable description of the outcome (e.g. `'frictionless'`). */
|
|
2319
|
+
description?: string;
|
|
2320
|
+
};
|
|
2321
|
+
}
|
|
2322
|
+
/**
|
|
2323
|
+
* Payload emitted by the Standalone 3DS flow for error events.
|
|
2324
|
+
* `error` is intentionally `unknown` — upstream emitters do not guarantee a shape.
|
|
2325
|
+
*/
|
|
2326
|
+
interface Canvas3dsErrorPayload {
|
|
2327
|
+
/** The Paydock 3DS charge identifier associated with the failed authentication attempt. */
|
|
2328
|
+
charge_3ds_id: string;
|
|
2329
|
+
/** The underlying error. Typed as `unknown` to force the consumer to narrow it before use. */
|
|
2330
|
+
error: unknown;
|
|
2178
2331
|
}
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2332
|
+
/**
|
|
2333
|
+
* Payload emitted by the iframe-based 3DS flow for auth-related events
|
|
2334
|
+
* (`chargeAuth`, `chargeAuthSuccess`, `chargeAuthReject`).
|
|
2335
|
+
*
|
|
2336
|
+
* Extends `IEventData` with optional 3DS-specific fields that the widget
|
|
2337
|
+
* merges into the message envelope for charge correlation.
|
|
2338
|
+
*/
|
|
2339
|
+
interface Canvas3dsChargeAuthEventPayload extends IEventData$1 {
|
|
2340
|
+
/** The Paydock 3DS charge identifier. Present when the widget correlates the event with a charge. */
|
|
2341
|
+
charge_3ds_id?: string;
|
|
2342
|
+
/** Authentication outcome status reported by the widget (e.g. `'authenticated'`, `'server_error'`). */
|
|
2343
|
+
status?: string;
|
|
2344
|
+
/** Optional result details forwarded from the 3DS provider. */
|
|
2345
|
+
result?: {
|
|
2346
|
+
/** Human-readable description of the outcome (e.g. `'frictionless'`). */
|
|
2347
|
+
description?: string;
|
|
2348
|
+
};
|
|
2349
|
+
}
|
|
2350
|
+
/**
|
|
2351
|
+
* Payload emitted by the iframe-based 3DS flow for error events.
|
|
2352
|
+
* Extends `IEventData` with optional 3DS-specific fields for charge correlation.
|
|
2353
|
+
*/
|
|
2354
|
+
interface Canvas3dsErrorEventPayload extends IEventData$1 {
|
|
2355
|
+
/** The Paydock 3DS charge identifier associated with the error. */
|
|
2356
|
+
charge_3ds_id?: string;
|
|
2190
2357
|
}
|
|
2358
|
+
/**
|
|
2359
|
+
* Maps Canvas3ds event names to their callback data types.
|
|
2360
|
+
*
|
|
2361
|
+
* Events that can fire from both the iframe (html/url) and standalone flows
|
|
2362
|
+
* use a union to accommodate both shapes. Standalone-only and iframe-only events
|
|
2363
|
+
* use a single payload type.
|
|
2364
|
+
*/
|
|
2365
|
+
interface Canvas3dsEventMap {
|
|
2366
|
+
/** Successful authentication. Standalone path emits `Canvas3dsAuthPayload`; iframe path emits `Canvas3dsChargeAuthEventPayload`. Narrow with `'event' in data` for iframe vs standalone. */
|
|
2367
|
+
chargeAuthSuccess: Canvas3dsAuthPayload | Canvas3dsChargeAuthEventPayload;
|
|
2368
|
+
/** Rejected authentication. Same dual-emit pattern as `chargeAuthSuccess`. */
|
|
2369
|
+
chargeAuthReject: Canvas3dsAuthPayload | Canvas3dsChargeAuthEventPayload;
|
|
2370
|
+
/** Authentication or processing error. Standalone path emits `Canvas3dsErrorPayload`; iframe path emits `Canvas3dsErrorEventPayload`. */
|
|
2371
|
+
error: Canvas3dsErrorPayload | Canvas3dsErrorEventPayload;
|
|
2372
|
+
/** Challenge required — issuer demands user interaction (OTP, biometric, etc.). Standalone-only. */
|
|
2373
|
+
chargeAuthChallenge: Canvas3dsAuthPayload;
|
|
2374
|
+
/** Decoupled authentication — issuer will authenticate out-of-band and notify later. Standalone-only. */
|
|
2375
|
+
chargeAuthDecoupled: Canvas3dsAuthPayload;
|
|
2376
|
+
/** Iframe-path authentication event. Extends `IEventData` with optional 3DS correlation fields (`charge_3ds_id`, `status`). */
|
|
2377
|
+
chargeAuth: Canvas3dsChargeAuthEventPayload;
|
|
2378
|
+
/** User cancelled the authentication flow before completion. Iframe-only. */
|
|
2379
|
+
chargeAuthCancelled: IEventData$1;
|
|
2380
|
+
/** Additional data collection step completed successfully. Iframe-only. */
|
|
2381
|
+
additionalDataCollectSuccess: IEventData$1;
|
|
2382
|
+
/** Additional data collection step was rejected. Iframe-only. */
|
|
2383
|
+
additionalDataCollectReject: IEventData$1;
|
|
2384
|
+
}
|
|
2385
|
+
/** Union of all known Canvas3ds event names. */
|
|
2386
|
+
type Canvas3dsEventName = keyof Canvas3dsEventMap;
|
|
2387
|
+
/**
|
|
2388
|
+
* Public, tree-shakeable alias for the internal `TOKEN_FORMAT` enum in canvas-3ds.ts.
|
|
2389
|
+
* Mirrors the string values of that enum without exposing the private enum itself.
|
|
2390
|
+
*/
|
|
2391
|
+
declare const Canvas3dsTokenFormat: {
|
|
2392
|
+
/** Token whose `content` is a complete HTML page. The SDK renders it inside an iframe. */
|
|
2393
|
+
readonly HTML: "html";
|
|
2394
|
+
/** Token whose `content` is a URL. The SDK loads it inside an iframe. */
|
|
2395
|
+
readonly URL: "url";
|
|
2396
|
+
/** Token whose `content` describes a standalone 3DS service (e.g. GPayments). The SDK delegates to that service's flow. */
|
|
2397
|
+
readonly STANDALONE_3DS: "standalone_3ds";
|
|
2398
|
+
};
|
|
2399
|
+
type Canvas3dsTokenFormat = (typeof Canvas3dsTokenFormat)[keyof typeof Canvas3dsTokenFormat];
|
|
2191
2400
|
|
|
2192
2401
|
/**
|
|
2193
2402
|
* List of available token's content formats
|
|
@@ -2223,7 +2432,7 @@ declare enum TOKEN_FORMAT {
|
|
|
2223
2432
|
* @param {string} CHARGE_AUTH_CHALLENGE=chargeAuthChallenge
|
|
2224
2433
|
* @param {string} CHARGE_AUTH_INFO=chargeAuthInfo
|
|
2225
2434
|
* @param {string} ERROR=error
|
|
2226
|
-
*/
|
|
2435
|
+
*/
|
|
2227
2436
|
/**
|
|
2228
2437
|
* Class Canvas3ds include method for working on html
|
|
2229
2438
|
* @constructor
|
|
@@ -2271,8 +2480,10 @@ declare class Canvas3ds {
|
|
|
2271
2480
|
*/
|
|
2272
2481
|
setEnv(env: string, alias?: string): void;
|
|
2273
2482
|
getEnv(): string;
|
|
2483
|
+
on<E extends keyof Canvas3dsEventMap>(eventName: E, cb: (data: Canvas3dsEventMap[E]) => void): void;
|
|
2484
|
+
on<E extends keyof Canvas3dsEventMap>(eventName: E): Promise<Canvas3dsEventMap[E]>;
|
|
2485
|
+
on(eventName: string, cb: (data: IEventData$1) => void): void;
|
|
2274
2486
|
on(eventName: string): Promise<IEventData$1>;
|
|
2275
|
-
on(eventName: string, cb: (data: IEventData$1) => void): any;
|
|
2276
2487
|
/**
|
|
2277
2488
|
* Using this method you can hide widget after load
|
|
2278
2489
|
* @param {boolean} [saveSize=false] - using this param you can save iframe's size
|
|
@@ -2290,6 +2501,59 @@ declare class Canvas3ds {
|
|
|
2290
2501
|
reload(): void;
|
|
2291
2502
|
}
|
|
2292
2503
|
|
|
2504
|
+
/**
|
|
2505
|
+
* Canonical shared response shapes used by both Charge and Checkout internal APIs.
|
|
2506
|
+
* Extracted here to remove the prior duplicated definitions in
|
|
2507
|
+
* api-charge-internal.ts and api-checkout-internal.ts.
|
|
2508
|
+
*/
|
|
2509
|
+
interface HandleResponseInterface {
|
|
2510
|
+
status: string;
|
|
2511
|
+
error: string;
|
|
2512
|
+
result: {
|
|
2513
|
+
reference: string;
|
|
2514
|
+
reference_2: string;
|
|
2515
|
+
identifier: string;
|
|
2516
|
+
identifier_2: string;
|
|
2517
|
+
identifier_3: string;
|
|
2518
|
+
identifier_4: string;
|
|
2519
|
+
identifier_5: string;
|
|
2520
|
+
type: string;
|
|
2521
|
+
status: string;
|
|
2522
|
+
status_2: string;
|
|
2523
|
+
status_code: string;
|
|
2524
|
+
ref_token: string;
|
|
2525
|
+
cancellation: string;
|
|
2526
|
+
count: string;
|
|
2527
|
+
version: string;
|
|
2528
|
+
whitelist: {
|
|
2529
|
+
status: string;
|
|
2530
|
+
source: string;
|
|
2531
|
+
};
|
|
2532
|
+
result: string;
|
|
2533
|
+
};
|
|
2534
|
+
}
|
|
2535
|
+
interface ProcessAuthenticationResponse {
|
|
2536
|
+
status: string;
|
|
2537
|
+
error?: string;
|
|
2538
|
+
result?: {
|
|
2539
|
+
challenge: string;
|
|
2540
|
+
challenge_url: string;
|
|
2541
|
+
decoupled_challenge: boolean;
|
|
2542
|
+
frictionless: boolean;
|
|
2543
|
+
identifier: string;
|
|
2544
|
+
identifier_3: string;
|
|
2545
|
+
identifier_4: string;
|
|
2546
|
+
reference: string;
|
|
2547
|
+
reference_2: string;
|
|
2548
|
+
secondary_url: string;
|
|
2549
|
+
skipped: boolean;
|
|
2550
|
+
status: string;
|
|
2551
|
+
type: string;
|
|
2552
|
+
version: string;
|
|
2553
|
+
description?: string;
|
|
2554
|
+
};
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2293
2557
|
declare class ApiChargeInternal {
|
|
2294
2558
|
protected api: ApiInternal;
|
|
2295
2559
|
constructor(api: ApiInternal);
|
|
@@ -2339,52 +2603,14 @@ interface WalletCallbackResponse {
|
|
|
2339
2603
|
interface Standalone3dsProcessBody {
|
|
2340
2604
|
charge_3ds_id: string;
|
|
2341
2605
|
}
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
identifier_3: string;
|
|
2351
|
-
identifier_4: string;
|
|
2352
|
-
identifier_5: string;
|
|
2353
|
-
type: string;
|
|
2354
|
-
status: string;
|
|
2355
|
-
status_2: string;
|
|
2356
|
-
status_code: string;
|
|
2357
|
-
ref_token: string;
|
|
2358
|
-
cancellation: string;
|
|
2359
|
-
count: string;
|
|
2360
|
-
version: string;
|
|
2361
|
-
whitelist: {
|
|
2362
|
-
status: string;
|
|
2363
|
-
source: string;
|
|
2364
|
-
};
|
|
2365
|
-
result: string;
|
|
2366
|
-
};
|
|
2367
|
-
}
|
|
2368
|
-
interface ProcessAuthenticationResponse {
|
|
2369
|
-
status: string;
|
|
2370
|
-
error?: string;
|
|
2371
|
-
result?: {
|
|
2372
|
-
challenge: string;
|
|
2373
|
-
challenge_url: string;
|
|
2374
|
-
decoupled_challenge: boolean;
|
|
2375
|
-
frictionless: boolean;
|
|
2376
|
-
identifier: string;
|
|
2377
|
-
identifier_3: string;
|
|
2378
|
-
identifier_4: string;
|
|
2379
|
-
reference: string;
|
|
2380
|
-
reference_2: string;
|
|
2381
|
-
secondary_url: string;
|
|
2382
|
-
skipped: boolean;
|
|
2383
|
-
status: string;
|
|
2384
|
-
type: string;
|
|
2385
|
-
version: string;
|
|
2386
|
-
description?: string;
|
|
2387
|
-
};
|
|
2606
|
+
|
|
2607
|
+
declare class ApiCheckoutInternal {
|
|
2608
|
+
protected api: ApiInternal;
|
|
2609
|
+
constructor(api: ApiInternal);
|
|
2610
|
+
instructions(): Observable<object>;
|
|
2611
|
+
private getInstructionLink;
|
|
2612
|
+
callback(payload: Object): Promise<Object>;
|
|
2613
|
+
status(id: string): Promise<Object>;
|
|
2388
2614
|
}
|
|
2389
2615
|
|
|
2390
2616
|
declare class ApiGatewayInternal {
|
|
@@ -2448,80 +2674,184 @@ declare enum WALLET_TYPES {
|
|
|
2448
2674
|
GOOGLE_PAY = "google"
|
|
2449
2675
|
}
|
|
2450
2676
|
|
|
2677
|
+
/**
|
|
2678
|
+
* The created One-Time Token (OTT) returned by the SDK after the user authorizes
|
|
2679
|
+
* a wallet payment. Use `temp_token` server-side to create the actual charge via
|
|
2680
|
+
* `POST /v1/charges` (or equivalent).
|
|
2681
|
+
*/
|
|
2451
2682
|
interface CreateOTTResponse {
|
|
2683
|
+
/** The temporary one-time token string. Single use, short TTL — exchange it server-side immediately. */
|
|
2452
2684
|
temp_token: string;
|
|
2685
|
+
/** Token classification. `CARD` for FPAN (Google Pay only); `CARD_SCHEME_TOKEN` for DPAN (Apple Pay & Google Pay). */
|
|
2453
2686
|
token_type: TOKEN_TYPE;
|
|
2454
2687
|
}
|
|
2688
|
+
/**
|
|
2689
|
+
* Billing address captured from the wallet payment sheet, when requested via
|
|
2690
|
+
* `required_billing_contact_fields` (Apple Pay) or equivalent (Google Pay).
|
|
2691
|
+
*/
|
|
2455
2692
|
interface Billing {
|
|
2693
|
+
/** First street address line. */
|
|
2456
2694
|
address_line1: string;
|
|
2695
|
+
/** Second street address line. Empty string when the wallet did not provide it. */
|
|
2457
2696
|
address_line2: string;
|
|
2697
|
+
/** ISO 3166-1 alpha-2 country code (e.g. `'AU'`, `'US'`). */
|
|
2458
2698
|
address_country: string;
|
|
2699
|
+
/** City. */
|
|
2459
2700
|
address_city: string;
|
|
2701
|
+
/** Postal/ZIP code. */
|
|
2460
2702
|
address_postcode: string;
|
|
2703
|
+
/** State or administrative area (e.g. `'NSW'`, `'CA'`). */
|
|
2461
2704
|
address_state: string;
|
|
2462
2705
|
}
|
|
2706
|
+
/**
|
|
2707
|
+
* Card details captured when the wallet returns a card-scheme token (DPAN).
|
|
2708
|
+
* Only the non-sensitive metadata is exposed — full card numbers never reach the SDK.
|
|
2709
|
+
*/
|
|
2463
2710
|
interface CardInfo {
|
|
2711
|
+
/** Card network identifier from the wallet (e.g. `'visa'`, `'mastercard'`, `'amex'`). */
|
|
2464
2712
|
card_scheme: string;
|
|
2713
|
+
/** Last 4 digits of the card, when the wallet provider exposes them. */
|
|
2465
2714
|
card_number_last4?: string;
|
|
2466
2715
|
}
|
|
2716
|
+
/**
|
|
2717
|
+
* Internal payload the SDK sends to Paydock when creating a One-Time Token.
|
|
2718
|
+
* Exposed publicly so integrators can construct fixtures for testing.
|
|
2719
|
+
*/
|
|
2467
2720
|
interface CreateOTTData {
|
|
2721
|
+
/** Charge amount as a number (e.g. `19.99`). */
|
|
2468
2722
|
amount: number;
|
|
2723
|
+
/** Shipping address and contact info captured from the wallet. */
|
|
2469
2724
|
shipping: Shipping;
|
|
2725
|
+
/** Billing address captured from the wallet. */
|
|
2470
2726
|
billing: Billing;
|
|
2727
|
+
/** Card metadata captured from the wallet (network, last 4). */
|
|
2471
2728
|
card_info: CardInfo;
|
|
2729
|
+
/** Wallet-provider reference token (DPAN/FPAN payload) used by Paydock to settle the charge. */
|
|
2472
2730
|
ref_token: string;
|
|
2473
2731
|
}
|
|
2732
|
+
/**
|
|
2733
|
+
* Request body used internally when calling Paydock's OTT-creation endpoint.
|
|
2734
|
+
* Exposed publicly so integrators can mirror the shape if they need to. */
|
|
2474
2735
|
interface CreateOTTRequest {
|
|
2736
|
+
/** The Paydock service ID configured in the merchant dashboard for this wallet. */
|
|
2475
2737
|
service_id: string;
|
|
2738
|
+
/** Wallet type identifier (Apple Pay, Google Pay, etc.). */
|
|
2476
2739
|
service_type: SERVICE_TYPES;
|
|
2740
|
+
/** Service group classification (e.g. `'WALLET'`). */
|
|
2477
2741
|
service_group: SERVICE_GROUP;
|
|
2742
|
+
/** Encrypted/encoded payload from the wallet (DPAN/FPAN data). */
|
|
2478
2743
|
payload: string;
|
|
2744
|
+
/** Encoding format of `payload` — currently `'encrypted_string'`. */
|
|
2479
2745
|
payload_format: PAYLOAD_FORMAT;
|
|
2480
2746
|
}
|
|
2747
|
+
/**
|
|
2748
|
+
* Request body sent when initiating a wallet session against Paydock
|
|
2749
|
+
* (used by the Apple Pay merchant validation flow).
|
|
2750
|
+
*/
|
|
2481
2751
|
interface CreateSessionRequest {
|
|
2752
|
+
/** The Paydock service ID for the wallet. */
|
|
2482
2753
|
service_id: string;
|
|
2754
|
+
/** Caller-controlled session identifier — Paydock binds the session to this id. */
|
|
2483
2755
|
session_id: string;
|
|
2756
|
+
/** Whether the wallet sheet should ask the user for shipping. */
|
|
2484
2757
|
request_shipping?: boolean;
|
|
2758
|
+
/** Merchant store name displayed in the wallet sheet. */
|
|
2485
2759
|
store_name: string;
|
|
2486
2760
|
}
|
|
2761
|
+
/**
|
|
2762
|
+
* Response returned by Paydock after creating a wallet session.
|
|
2763
|
+
* Used internally by the SDK to drive merchant validation; rarely consumed directly.
|
|
2764
|
+
*/
|
|
2487
2765
|
interface CreateSessionResponse {
|
|
2766
|
+
/** Paydock session identifier. */
|
|
2488
2767
|
id: string;
|
|
2768
|
+
/** Session status (e.g. `'active'`). */
|
|
2489
2769
|
status: string;
|
|
2770
|
+
/** HTTP method the SDK should use to invoke the callback URL. */
|
|
2490
2771
|
callback_method: string;
|
|
2772
|
+
/** Relation/role of the callback (e.g. `'merchant_validation'`). */
|
|
2491
2773
|
callback_rel: string;
|
|
2774
|
+
/** URL the SDK calls to complete the merchant validation step. */
|
|
2492
2775
|
callback_url: string;
|
|
2493
2776
|
}
|
|
2777
|
+
/**
|
|
2778
|
+
* Union of the native wallet authorization payloads the SDK may receive
|
|
2779
|
+
* from Apple Pay or Google Pay at the moment of payment authorization.
|
|
2780
|
+
* Used internally; rarely exposed to integrators directly.
|
|
2781
|
+
*/
|
|
2494
2782
|
type CheckoutResponse = ApplePayJS.ApplePayPaymentAuthorizedEvent | google.payments.api.PaymentAuthorizationResult | google.payments.api.PaymentData;
|
|
2783
|
+
/**
|
|
2784
|
+
* Action codes returned by the SDK during the wallet checkout lifecycle.
|
|
2785
|
+
* Mirrors the ApplePay payment authorization completion codes used internally
|
|
2786
|
+
* to decide what UI/state transition to perform next.
|
|
2787
|
+
*/
|
|
2495
2788
|
declare enum CheckoutActionCode {
|
|
2789
|
+
/** Payment completed successfully. */
|
|
2496
2790
|
COMPLETE = "COMPLETE",
|
|
2791
|
+
/** User cancelled the wallet sheet. */
|
|
2497
2792
|
CANCEL = "CANCEL",
|
|
2793
|
+
/** An error occurred during payment authorization. */
|
|
2498
2794
|
ERROR = "ERROR",
|
|
2795
|
+
/** User opted to switch to a different card in the wallet. */
|
|
2499
2796
|
CHANGE_CARD = "CHANGE_CARD",
|
|
2797
|
+
/** User opted to add a new card to the wallet. */
|
|
2500
2798
|
ADD_CARD = "ADD_CARD",
|
|
2799
|
+
/** User switched to a different consumer (Click to Pay flow). */
|
|
2501
2800
|
SWITCH_CONSUMER = "SWITCH_CONSUMER"
|
|
2502
2801
|
}
|
|
2802
|
+
/**
|
|
2803
|
+
* Token response shape returned by Paydock after creating an OTT.
|
|
2804
|
+
* Used by the SDK to decide whether a follow-up 3DS step is required.
|
|
2805
|
+
*/
|
|
2503
2806
|
interface OTTResponse {
|
|
2807
|
+
/** The OTT string. */
|
|
2504
2808
|
token: string;
|
|
2809
|
+
/** Token type identifier (string form of {@link TOKEN_TYPE}). */
|
|
2505
2810
|
token_type: string;
|
|
2811
|
+
/** When `true`, the integrator must invoke a Canvas3DS step before settling the charge. */
|
|
2506
2812
|
three_ds_required?: boolean;
|
|
2813
|
+
/** Which wallet produced the token (Apple Pay or Google Pay). */
|
|
2507
2814
|
wallet_type: WalletType;
|
|
2508
2815
|
}
|
|
2816
|
+
/**
|
|
2817
|
+
* Shipping address and contact information captured from the wallet payment sheet,
|
|
2818
|
+
* when requested via `request_shipping` (and friends) on the wallet meta.
|
|
2819
|
+
*
|
|
2820
|
+
* All fields are optional because each wallet provider returns a different subset.
|
|
2821
|
+
* Address line fields are typically Apple Pay-only (Google Pay returns a coarser shape).
|
|
2822
|
+
*/
|
|
2509
2823
|
interface Shipping {
|
|
2824
|
+
/** Selected shipping method identifier (e.g. `'standard'`, `'express'`). */
|
|
2510
2825
|
method?: string;
|
|
2826
|
+
/** Updated shipping options that were available when the user made their selection. */
|
|
2511
2827
|
options?: IShippingOption[];
|
|
2828
|
+
/** First street address line (Apple Pay only). */
|
|
2512
2829
|
address_line1?: string;
|
|
2830
|
+
/** Second street address line (Apple Pay only). */
|
|
2513
2831
|
address_line2?: string;
|
|
2832
|
+
/** City. */
|
|
2514
2833
|
address_city?: string;
|
|
2834
|
+
/** Postal/ZIP code. */
|
|
2515
2835
|
address_postcode?: string;
|
|
2836
|
+
/** State or administrative area. */
|
|
2516
2837
|
address_state?: string;
|
|
2838
|
+
/** ISO 3166-1 alpha-2 country code. */
|
|
2517
2839
|
address_country?: string;
|
|
2840
|
+
/** Company name on the address (when the wallet captured it). */
|
|
2518
2841
|
address_company?: string;
|
|
2842
|
+
/** Origin postal code — used for shipping calculations when the merchant ships from a fixed location. */
|
|
2519
2843
|
address_origin_postcode?: string;
|
|
2844
|
+
/** Shipping contact information (Apple Pay only). */
|
|
2520
2845
|
contact?: {
|
|
2846
|
+
/** Contact first name. */
|
|
2521
2847
|
first_name?: string;
|
|
2848
|
+
/** Contact last name. */
|
|
2522
2849
|
last_name?: string;
|
|
2850
|
+
/** Contact email address. */
|
|
2523
2851
|
email?: string;
|
|
2852
|
+
/** Contact phone number. */
|
|
2524
2853
|
phone?: string;
|
|
2854
|
+
/** Contact secondary phone number. */
|
|
2525
2855
|
phone2?: string;
|
|
2526
2856
|
};
|
|
2527
2857
|
}
|
|
@@ -2541,13 +2871,52 @@ declare class ApiInternal extends ApiBase {
|
|
|
2541
2871
|
paymentSource(): ApiPaymentSourceInternal;
|
|
2542
2872
|
}
|
|
2543
2873
|
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2874
|
+
/**
|
|
2875
|
+
* Public alias for GPAYMENTS_EVENT. Same object reference — no behavioral change.
|
|
2876
|
+
* Prefer `CANVAS_3DS_EVENT` in public-facing code; `GPAYMENTS_EVENT` remains for
|
|
2877
|
+
* backwards-compatible internal usage.
|
|
2878
|
+
*/
|
|
2879
|
+
declare const CANVAS_3DS_EVENT: {
|
|
2880
|
+
/** Authentication succeeded. Payload: `Canvas3dsAuthPayload`. */
|
|
2881
|
+
readonly AUTH_SUCCESS: "chargeAuthSuccess";
|
|
2882
|
+
/** Authentication failed — covers issuer rejection, iframe timeout (`AuthTimedOut`), and invalid-event outcomes. Payload: `Canvas3dsAuthPayload`. */
|
|
2883
|
+
readonly AUTH_ERROR: "chargeAuthReject";
|
|
2884
|
+
/** Decoupled authentication — issuer will authenticate out-of-band. Payload: `Canvas3dsAuthPayload`. */
|
|
2885
|
+
readonly DECOUPLED: "chargeAuthDecoupled";
|
|
2886
|
+
/** Challenge required — issuer demands user interaction. Payload: `Canvas3dsAuthPayload`. */
|
|
2887
|
+
readonly CHALLENGE: "chargeAuthChallenge";
|
|
2888
|
+
/** Informational signal emitted by the GPayments flow. Internal — not part of the public typed surface. */
|
|
2889
|
+
readonly INFO: "chargeAuthInfo";
|
|
2890
|
+
/** Error during the flow (network, parsing, etc.). Payload: `Canvas3dsErrorPayload`. */
|
|
2891
|
+
readonly ERROR: "error";
|
|
2892
|
+
};
|
|
2893
|
+
|
|
2894
|
+
/**
|
|
2895
|
+
* Payload emitted by `Checkout.onPaymentSuccessful`.
|
|
2896
|
+
*
|
|
2897
|
+
* Permissively extends `IEventData` because the Checkout emission contract
|
|
2898
|
+
* is not yet fully documented (see D8). This gives a named surface that
|
|
2899
|
+
* integrators can import while keeping the type backwards-compatible with
|
|
2900
|
+
* the raw `IEventData` shape the runtime currently emits.
|
|
2901
|
+
*/
|
|
2902
|
+
interface CheckoutPaymentSuccessPayload extends IEventData$1 {
|
|
2903
|
+
}
|
|
2904
|
+
/**
|
|
2905
|
+
* Payload emitted by `Checkout.onPaymentFailure`.
|
|
2906
|
+
*
|
|
2907
|
+
* Permissively extends `IEventData` — same reasoning as
|
|
2908
|
+
* `CheckoutPaymentSuccessPayload`. Tighten in a follow-up once the emission
|
|
2909
|
+
* contract is confirmed.
|
|
2910
|
+
*/
|
|
2911
|
+
interface CheckoutPaymentFailurePayload extends IEventData$1 {
|
|
2912
|
+
}
|
|
2913
|
+
/**
|
|
2914
|
+
* Payload emitted by `Checkout.onPaymentExpired`.
|
|
2915
|
+
*
|
|
2916
|
+
* Permissively extends `IEventData` — same reasoning as
|
|
2917
|
+
* `CheckoutPaymentSuccessPayload`.
|
|
2918
|
+
*/
|
|
2919
|
+
interface CheckoutPaymentExpiredPayload extends IEventData$1 {
|
|
2551
2920
|
}
|
|
2552
2921
|
|
|
2553
2922
|
type Instruction = new (selector: string, api: ApiInternal, checkoutWidget: Checkout, formSelector?: string) => InstructionHandler & InstructionDestroyable & InstructionDecorated;
|
|
@@ -2577,11 +2946,32 @@ declare class InstructionModule {
|
|
|
2577
2946
|
getInstruction(id: string): Instruction | null;
|
|
2578
2947
|
}
|
|
2579
2948
|
|
|
2580
|
-
|
|
2949
|
+
/** Event name emitted when a checkout payment completes successfully. */
|
|
2950
|
+
declare const PAYMENT_SUCCESSFUL = "paymentSuccessful";
|
|
2951
|
+
/** Event name emitted when a checkout payment fails. */
|
|
2952
|
+
declare const PAYMENT_FAILURE = "paymentFailure";
|
|
2953
|
+
/** Event name emitted when a checkout session expires. */
|
|
2954
|
+
declare const PAYMENT_EXPIRED = "paymentExpired";
|
|
2955
|
+
declare const EVENT$2: {
|
|
2956
|
+
PAYMENT_SUCCESSFUL: string;
|
|
2957
|
+
PAYMENT_FAILURE: string;
|
|
2958
|
+
PAYMENT_EXPIRED: string;
|
|
2959
|
+
};
|
|
2960
|
+
/**
|
|
2961
|
+
* Decoded payload of the intent JWT the `Checkout` widget receives in its constructor.
|
|
2962
|
+
* Issued by the Paydock backend when a checkout intent is created. Integrators who
|
|
2963
|
+
* decode the token themselves (e.g. for diagnostics) can use this type to inspect it.
|
|
2964
|
+
*/
|
|
2965
|
+
interface CheckoutIntentTokenPayload {
|
|
2966
|
+
/** Backend environment that minted this token (e.g. `'sandbox'`, `'production'`). */
|
|
2581
2967
|
env: string;
|
|
2968
|
+
/** The Paydock checkout intent identifier this token authorizes. */
|
|
2582
2969
|
intent_id: string;
|
|
2970
|
+
/** Token schema version. Used by the SDK for forward/backward compatibility. */
|
|
2583
2971
|
version: number;
|
|
2972
|
+
/** Human-readable alias for the environment (e.g. `'staging-3'`, `'multitenant-preprod'`). */
|
|
2584
2973
|
env_alias: string;
|
|
2974
|
+
/** Hostnames the token may be used from. When present, the SDK rejects the token if the current origin is not listed; an absent or empty array allows all origins. */
|
|
2585
2975
|
whitelist_domains: string[];
|
|
2586
2976
|
}
|
|
2587
2977
|
/**
|
|
@@ -2601,7 +2991,7 @@ declare class Checkout {
|
|
|
2601
2991
|
protected window: Window;
|
|
2602
2992
|
protected eventEmitter: EventEmitter;
|
|
2603
2993
|
protected container: Container;
|
|
2604
|
-
protected intentTokenPayload:
|
|
2994
|
+
protected intentTokenPayload: CheckoutIntentTokenPayload;
|
|
2605
2995
|
protected api: ApiInternal;
|
|
2606
2996
|
protected checkoutApi: ApiCheckoutInternal;
|
|
2607
2997
|
protected instructions: InstructionModule;
|
|
@@ -2615,7 +3005,7 @@ declare class Checkout {
|
|
|
2615
3005
|
fetchInstruction(): void;
|
|
2616
3006
|
finaliseCheckout(): void;
|
|
2617
3007
|
private setupTimeoutTimer;
|
|
2618
|
-
private
|
|
3008
|
+
private extractCheckoutIntentTokenPayload;
|
|
2619
3009
|
validateJWTWhitelistedDomains(whitelist_domains: string[]): boolean;
|
|
2620
3010
|
private ready;
|
|
2621
3011
|
private initContractVersion;
|
|
@@ -2634,7 +3024,7 @@ declare class Checkout {
|
|
|
2634
3024
|
* console.log('Payment successful!');
|
|
2635
3025
|
* });
|
|
2636
3026
|
*/
|
|
2637
|
-
onPaymentSuccessful(handler: (data:
|
|
3027
|
+
onPaymentSuccessful<T extends IEventData$1 = CheckoutPaymentSuccessPayload>(handler: (data: T) => void): () => void;
|
|
2638
3028
|
/**
|
|
2639
3029
|
* If the payment was not successful, the function passed as parameter will be called.
|
|
2640
3030
|
* Important: Do not perform thread blocking operations in callback such as window.alert() calls.
|
|
@@ -2644,17 +3034,17 @@ declare class Checkout {
|
|
|
2644
3034
|
* console.log('Payment not successful');
|
|
2645
3035
|
* });
|
|
2646
3036
|
*/
|
|
2647
|
-
onPaymentFailure(handler: (data:
|
|
3037
|
+
onPaymentFailure<T extends IEventData$1 = CheckoutPaymentFailurePayload>(handler: (data: T) => void): () => void;
|
|
2648
3038
|
/**
|
|
2649
3039
|
* If the payment was expired, the function passed as parameter will be called.
|
|
2650
3040
|
* Important: Do not perform thread blocking operations in callback such as window.alert() calls.
|
|
2651
3041
|
*
|
|
2652
3042
|
* @example
|
|
2653
|
-
* widget.
|
|
2654
|
-
* console.log('Payment
|
|
3043
|
+
* widget.onPaymentExpired((data) => {
|
|
3044
|
+
* console.log('Payment session expired');
|
|
2655
3045
|
* });
|
|
2656
3046
|
*/
|
|
2657
|
-
onPaymentExpired(handler: (data:
|
|
3047
|
+
onPaymentExpired<T extends IEventData$1 = CheckoutPaymentExpiredPayload>(handler: (data: T) => void): () => void;
|
|
2658
3048
|
createWidgetStructure(): void;
|
|
2659
3049
|
private changeLoadingSpinnerVisibility;
|
|
2660
3050
|
}
|
|
@@ -3734,6 +4124,18 @@ declare abstract class OpenWalletService implements IOpenWalletProvider {
|
|
|
3734
4124
|
* @param meta - The updated metadata.
|
|
3735
4125
|
*/
|
|
3736
4126
|
abstract setMeta(meta: OpenWalletMeta): void;
|
|
4127
|
+
/**
|
|
4128
|
+
* Returns whether the wallet button is currently disabled.
|
|
4129
|
+
* Reads the `aria-disabled` attribute from the container element — set by the
|
|
4130
|
+
* button class via {@link OpenWalletButtons.disable} / {@link OpenWalletButtons.enable}.
|
|
4131
|
+
*
|
|
4132
|
+
* Used to short-circuit click handlers in concrete wallet services for clicks
|
|
4133
|
+
* that bypass the DOM `pointer-events: none` guard (e.g. invoked by the wallet
|
|
4134
|
+
* provider's SDK callback).
|
|
4135
|
+
*
|
|
4136
|
+
* @returns `true` if the container is marked as disabled, `false` otherwise.
|
|
4137
|
+
*/
|
|
4138
|
+
protected isButtonDisabled(): boolean;
|
|
3737
4139
|
/**
|
|
3738
4140
|
* Creates a One-Time Token (OTT) by sending the payment data to the API.
|
|
3739
4141
|
* Emits {@link EVENT.SUCCESS} on success or {@link EVENT.ERROR} on failure.
|
|
@@ -3793,6 +4195,7 @@ declare abstract class OpenWalletButtons<TMeta extends OpenWalletMeta = OpenWall
|
|
|
3793
4195
|
protected meta: TMeta;
|
|
3794
4196
|
protected eventEmitter: EventEmitter;
|
|
3795
4197
|
protected walletService: OpenWalletService | undefined;
|
|
4198
|
+
protected isDisabled: boolean;
|
|
3796
4199
|
private onShippingOptionsChangeHandlerRegistered;
|
|
3797
4200
|
/** @private */
|
|
3798
4201
|
abstract readonly walletType: WalletType;
|
|
@@ -3849,6 +4252,42 @@ declare abstract class OpenWalletButtons<TMeta extends OpenWalletMeta = OpenWall
|
|
|
3849
4252
|
* button.load();
|
|
3850
4253
|
*/
|
|
3851
4254
|
load(): void;
|
|
4255
|
+
/**
|
|
4256
|
+
* Enables the wallet button, restoring interactivity and visual appearance.
|
|
4257
|
+
* If the button was previously disabled via `disable()`, calling this method
|
|
4258
|
+
* re-enables clicks and removes the disabled visual state.
|
|
4259
|
+
*
|
|
4260
|
+
* Idempotent — calling on an already-enabled button has no effect.
|
|
4261
|
+
*
|
|
4262
|
+
* @example
|
|
4263
|
+
* button.enable();
|
|
4264
|
+
*/
|
|
4265
|
+
enable(): void;
|
|
4266
|
+
/**
|
|
4267
|
+
* Disables the wallet button, preventing clicks and applying a visual disabled state.
|
|
4268
|
+
* When disabled, the button appears grayed out (`opacity: 0.5`) and does not
|
|
4269
|
+
* respond to user interaction (`pointer-events: none`). For accessibility, the
|
|
4270
|
+
* `aria-disabled="true"` attribute is also set on the container.
|
|
4271
|
+
*
|
|
4272
|
+
* Programmatic clicks (e.g. invoked by the wallet provider's SDK) are blocked
|
|
4273
|
+
* by an explicit guard inside the click handler — the button's wallet service
|
|
4274
|
+
* checks the disabled state before processing.
|
|
4275
|
+
*
|
|
4276
|
+
* Idempotent — calling on an already-disabled button has no effect.
|
|
4277
|
+
* Safe to call before `load()` (no-throw); the styles are applied once the
|
|
4278
|
+
* container element exists.
|
|
4279
|
+
*
|
|
4280
|
+
* @example
|
|
4281
|
+
* button.disable();
|
|
4282
|
+
*/
|
|
4283
|
+
disable(): void;
|
|
4284
|
+
/**
|
|
4285
|
+
* Applies the disabled / enabled visual state to the container element.
|
|
4286
|
+
* Reads `this.isDisabled` and toggles the corresponding CSS + ARIA attributes.
|
|
4287
|
+
*
|
|
4288
|
+
* @private
|
|
4289
|
+
*/
|
|
4290
|
+
protected applyDisabledStyles(): void;
|
|
3852
4291
|
/**
|
|
3853
4292
|
* Current method can change environment. By default environment = sandbox.
|
|
3854
4293
|
* Also we can change domain alias for this environment. By default domain_alias = paydock.com
|
|
@@ -4628,13 +5067,53 @@ declare global {
|
|
|
4628
5067
|
ApplePaySession: ApplePaySession;
|
|
4629
5068
|
}
|
|
4630
5069
|
}
|
|
5070
|
+
/** Styling configuration for the Apple Pay button. */
|
|
4631
5071
|
interface ApplePayOpenWalletMetaStyles extends OpenWalletMetaStyles {
|
|
5072
|
+
/** Variant displayed on the button (e.g. `'buy'`, `'donate'`, `'plain'`, `'check-out'`). */
|
|
4632
5073
|
button_type?: ApplePayButtonType$1;
|
|
5074
|
+
/** Color scheme: `'black'`, `'white'`, or `'white-outline'`. */
|
|
4633
5075
|
button_style?: ApplePayButtonStyle$1;
|
|
4634
5076
|
}
|
|
4635
|
-
|
|
5077
|
+
/**
|
|
5078
|
+
* Fields that the SDK auto-populates in `adaptMeta()` if not provided by the merchant.
|
|
5079
|
+
* Declared here so we can override them as optional in `ApplePayOpenWalletMeta` while
|
|
5080
|
+
* keeping the strict `ApplePayPaymentRequest` intact for internal consumers.
|
|
5081
|
+
*/
|
|
5082
|
+
type ApplePayAutoFilledFields = 'merchant_capabilities' | 'supported_networks' | 'country_code' | 'currency_code' | 'total';
|
|
5083
|
+
/**
|
|
5084
|
+
* Metadata required to configure an Apple Pay Open Wallet button.
|
|
5085
|
+
* Extends {@link OpenWalletMeta} (amount, currency, country) plus most of the
|
|
5086
|
+
* fields from Apple's `ApplePayPaymentRequest`. Fields that the SDK auto-populates
|
|
5087
|
+
* in `adaptMeta()` are redeclared as optional below.
|
|
5088
|
+
*/
|
|
5089
|
+
interface ApplePayOpenWalletMeta extends OpenWalletMeta, Omit<ApplePayPaymentRequest, ApplePayAutoFilledFields> {
|
|
5090
|
+
/** Label shown next to the total in the Apple Pay sheet (e.g. `'TOTAL'`, `'Order total'`). */
|
|
4636
5091
|
amount_label: string;
|
|
5092
|
+
/** Merchant's store name displayed during payment authorization. */
|
|
4637
5093
|
store_name: string;
|
|
5094
|
+
/**
|
|
5095
|
+
* Auto-populated from `country.toUpperCase()` if not provided.
|
|
5096
|
+
* Only set explicitly when you need a different country code than `country`.
|
|
5097
|
+
*/
|
|
5098
|
+
country_code?: string;
|
|
5099
|
+
/**
|
|
5100
|
+
* Auto-populated from `currency.toUpperCase()` if not provided.
|
|
5101
|
+
* Only set explicitly when you need a different currency code than `currency`.
|
|
5102
|
+
*/
|
|
5103
|
+
currency_code?: string;
|
|
5104
|
+
/**
|
|
5105
|
+
* Auto-populated from `amount` and `amount_label` if not provided.
|
|
5106
|
+
* Set explicitly to customize the total line item (e.g. with a specific `type`).
|
|
5107
|
+
*/
|
|
5108
|
+
total?: ApplePayLineItem;
|
|
5109
|
+
/**
|
|
5110
|
+
* Defaults to `['supports3DS', 'supportsCredit', 'supportsDebit']` if not provided.
|
|
5111
|
+
*/
|
|
5112
|
+
merchant_capabilities?: ApplePayMerchantCapability[];
|
|
5113
|
+
/**
|
|
5114
|
+
* Defaults to `['visa', 'masterCard', 'amex', 'discover']` if not provided.
|
|
5115
|
+
*/
|
|
5116
|
+
supported_networks?: string[];
|
|
4638
5117
|
/** Whether shipping address collection is required. */
|
|
4639
5118
|
request_shipping?: boolean;
|
|
4640
5119
|
/**
|
|
@@ -4643,8 +5122,14 @@ interface ApplePayOpenWalletMeta extends OpenWalletMeta, ApplePayPaymentRequest
|
|
|
4643
5122
|
* Requires `request_shipping` to be `true`.
|
|
4644
5123
|
*/
|
|
4645
5124
|
shipping_options?: IApplePayShippingOption$1[];
|
|
5125
|
+
/** Whether to surface billing address fields in the sheet. When `true` and `required_billing_contact_fields` is unset, the SDK defaults the latter to `['name', 'postalAddress']`. */
|
|
4646
5126
|
show_billing_address?: boolean;
|
|
5127
|
+
/** Visual styling for the Apple Pay button. */
|
|
4647
5128
|
style?: ApplePayOpenWalletMetaStyles;
|
|
5129
|
+
/**
|
|
5130
|
+
* Device capabilities allowed for the wallet button to be considered available.
|
|
5131
|
+
* Used as a relaxation knob for testing — defaults to `['paymentCredentialsAvailable']` only.
|
|
5132
|
+
*/
|
|
4648
5133
|
apple_pay_capabilities?: Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>;
|
|
4649
5134
|
}
|
|
4650
5135
|
|
|
@@ -4722,15 +5207,27 @@ type GooglePayButtonType = 'book' | 'buy' | 'checkout' | 'donate' | 'order' | 'p
|
|
|
4722
5207
|
type GooglePayAuthMethod = 'PAN_ONLY' | 'CRYPTOGRAM_3DS';
|
|
4723
5208
|
type GooglePayCardNetwork = 'AMEX' | 'DISCOVER' | 'ELECTRON' | 'ELO' | 'ELO_DEBIT' | 'INTERAC' | 'JCB' | 'MAESTRO' | 'MASTERCARD' | 'VISA';
|
|
4724
5209
|
type BillingAddressFormat = 'MIN' | 'FULL';
|
|
5210
|
+
/**
|
|
5211
|
+
* Styling configuration for the Google Pay button.
|
|
5212
|
+
*/
|
|
4725
5213
|
interface GooglePayOpenWalletMetaStyles extends OpenWalletMetaStyles {
|
|
5214
|
+
/** Variant displayed on the button (e.g. `'pay'`, `'buy'`, `'checkout'`). */
|
|
4726
5215
|
button_type?: GooglePayButtonType;
|
|
5216
|
+
/** Sizing strategy: `'static'` keeps the intrinsic size; `'fill'` stretches to the container. */
|
|
4727
5217
|
button_size_mode?: GooglePayButtonSizeMode;
|
|
5218
|
+
/** Color scheme: `'default'`, `'black'`, or `'white'`. */
|
|
4728
5219
|
button_color?: GooglePayButtonColor;
|
|
4729
5220
|
}
|
|
5221
|
+
/**
|
|
5222
|
+
* Metadata required to configure a Google Pay Open Wallet button.
|
|
5223
|
+
* Extends {@link OpenWalletMeta} (amount, currency, country) with Google Pay specifics.
|
|
5224
|
+
*/
|
|
4730
5225
|
interface GooglePayOpenWalletMeta extends OpenWalletMeta {
|
|
5226
|
+
/** Display name shown in the Google Pay sheet (e.g. `'Demo Store'`). */
|
|
4731
5227
|
merchant_name?: string;
|
|
4732
5228
|
/** Whether shipping address collection is required. */
|
|
4733
5229
|
request_shipping?: boolean;
|
|
5230
|
+
/** Whether to surface billing address fields in the sheet. */
|
|
4734
5231
|
show_billing_address?: boolean;
|
|
4735
5232
|
/**
|
|
4736
5233
|
* Available shipping options to display in the payment sheet.
|
|
@@ -4738,38 +5235,72 @@ interface GooglePayOpenWalletMeta extends OpenWalletMeta {
|
|
|
4738
5235
|
* Requires `request_shipping` to be `true`.
|
|
4739
5236
|
*/
|
|
4740
5237
|
shipping_options?: IGooglePayShippingOption[];
|
|
5238
|
+
/** Label shown next to the total amount in the sheet (e.g. `'TOTAL'`). */
|
|
4741
5239
|
amount_label?: string;
|
|
5240
|
+
/** Visual styling for the button. */
|
|
4742
5241
|
style?: GooglePayOpenWalletMetaStyles;
|
|
5242
|
+
/** Override the default card configuration (auth methods, allowed networks, tokenization). */
|
|
4743
5243
|
card_config?: GooglePayCardConfig;
|
|
4744
5244
|
}
|
|
5245
|
+
/**
|
|
5246
|
+
* Card configuration passed to Google Pay's `PaymentDataRequest`.
|
|
5247
|
+
* Mirrors Google Pay's
|
|
5248
|
+
* [PaymentMethodSpecification](https://developers.google.com/pay/api/web/reference/request-objects#PaymentMethod)
|
|
5249
|
+
* with snake_case keys.
|
|
5250
|
+
*/
|
|
4745
5251
|
interface GooglePayCardConfig {
|
|
5252
|
+
/** Payment method type Google Pay should display. `'CARD'` for card payments, `'PAYPAL'` for PayPal-via-Google Pay. */
|
|
4746
5253
|
type: 'CARD' | 'PAYPAL';
|
|
5254
|
+
/** Method-specific parameters that filter the cards Google Pay will offer. */
|
|
4747
5255
|
parameters: {
|
|
5256
|
+
/** Allowed authentication methods. `'PAN_ONLY'` for FPAN (server-side decryption); `'CRYPTOGRAM_3DS'` for DPAN (device tokens). */
|
|
4748
5257
|
allowed_auth_methods: GooglePayAuthMethod[];
|
|
5258
|
+
/** Card networks the merchant accepts. */
|
|
4749
5259
|
allowed_card_networks: GooglePayCardNetwork[];
|
|
5260
|
+
/** Whether prepaid cards are allowed. Defaults to Google Pay's default. */
|
|
4750
5261
|
allow_prepaid_cards?: boolean;
|
|
5262
|
+
/** Whether credit cards are allowed. Defaults to Google Pay's default. */
|
|
4751
5263
|
allow_credit_cards?: boolean;
|
|
5264
|
+
/** Request `assuranceDetails` in the payment response (gives risk-signal hints from Google). */
|
|
4752
5265
|
assurance_details_required?: boolean;
|
|
5266
|
+
/** Whether the billing address must be collected. */
|
|
4753
5267
|
billing_address_required?: boolean;
|
|
5268
|
+
/** Billing address collection options. Only honored when `billing_address_required` is `true`. */
|
|
4754
5269
|
billing_address_parameters?: {
|
|
5270
|
+
/** Format of the collected billing address: `'MIN'` (minimal) or `'FULL'`. */
|
|
4755
5271
|
format: BillingAddressFormat;
|
|
5272
|
+
/** Whether to also collect the phone number. */
|
|
4756
5273
|
phone_number_required?: boolean;
|
|
4757
5274
|
};
|
|
5275
|
+
/** Per-network parameters such as acquirer routing hints. */
|
|
4758
5276
|
card_network_parameters?: {
|
|
5277
|
+
/** The card network this entry applies to. */
|
|
4759
5278
|
card_network: GooglePayCardNetwork;
|
|
5279
|
+
/** Acquirer BIN — used by the gateway to route the transaction. */
|
|
4760
5280
|
acquirer_bin?: string;
|
|
5281
|
+
/** Acquirer-assigned merchant identifier. */
|
|
4761
5282
|
acquirer_merchant_id?: string;
|
|
4762
5283
|
}[];
|
|
4763
5284
|
};
|
|
5285
|
+
/**
|
|
5286
|
+
* How Google Pay should tokenize the payment method. Paydock typically configures this server-side
|
|
5287
|
+
* and you should NOT pass it unless you fully understand the implications of overriding the default.
|
|
5288
|
+
*/
|
|
4764
5289
|
tokenization_specification?: {
|
|
5290
|
+
/** Standard payment-gateway tokenization. */
|
|
4765
5291
|
type: 'PAYMENT_GATEWAY';
|
|
5292
|
+
/** Gateway-specific tokenization parameters (e.g. `gateway`, `gatewayMerchantId`). */
|
|
4766
5293
|
parameters: {
|
|
4767
5294
|
[key: string]: string;
|
|
4768
5295
|
};
|
|
4769
5296
|
} | {
|
|
5297
|
+
/** Direct integration where Google encrypts the payload with the merchant's public key. */
|
|
4770
5298
|
type: 'DIRECT';
|
|
5299
|
+
/** Direct-tokenization parameters required by Google's payload encryption. */
|
|
4771
5300
|
parameters: {
|
|
5301
|
+
/** Protocol version expected by the merchant (currently `'ECv2'`). */
|
|
4772
5302
|
protocol_version: string;
|
|
5303
|
+
/** Merchant's public key used to encrypt the payload. */
|
|
4773
5304
|
public_key: string;
|
|
4774
5305
|
};
|
|
4775
5306
|
};
|
|
@@ -5382,48 +5913,102 @@ declare enum EventEnum {
|
|
|
5382
5913
|
ON_WALLET_LOADED = "onWalletLoaded"
|
|
5383
5914
|
}
|
|
5384
5915
|
|
|
5916
|
+
/**
|
|
5917
|
+
* Payload of the `paymentSuccessful` event emitted by `WalletButtons`.
|
|
5918
|
+
* Represents the final charge result returned by the backend.
|
|
5919
|
+
*
|
|
5920
|
+
* For tamper-resistant validation, do a server-to-server fetch using `id`
|
|
5921
|
+
* — never trust this payload alone for fulfillment decisions.
|
|
5922
|
+
*/
|
|
5385
5923
|
interface IWalletPaymentSuccessful {
|
|
5924
|
+
/** Charge identifier returned by the backend. */
|
|
5386
5925
|
id: string;
|
|
5926
|
+
/** Final charge amount as a number. */
|
|
5387
5927
|
amount: number;
|
|
5928
|
+
/** ISO 4217 currency code of the charge. */
|
|
5388
5929
|
currency: string;
|
|
5930
|
+
/** Backend charge status (e.g. `'complete'`, `'pending'`). */
|
|
5389
5931
|
status: string;
|
|
5932
|
+
/** Payer's full name if collected by the wallet. */
|
|
5390
5933
|
payer_name?: string;
|
|
5934
|
+
/** Payer's email if collected by the wallet. */
|
|
5391
5935
|
payer_email?: string;
|
|
5936
|
+
/** Payer's phone number if collected by the wallet. */
|
|
5392
5937
|
payer_phone?: string;
|
|
5393
5938
|
}
|
|
5939
|
+
/**
|
|
5940
|
+
* Payload of the `unavailable` event emitted by `WalletButtons`.
|
|
5941
|
+
* Identifies which wallet became unavailable when more than one is configured.
|
|
5942
|
+
*/
|
|
5394
5943
|
interface IWalletUnavailable {
|
|
5944
|
+
/** The wallet type that is unavailable. Absent when the unavailability is generic. */
|
|
5395
5945
|
wallet?: WALLET_TYPE;
|
|
5396
5946
|
}
|
|
5947
|
+
/**
|
|
5948
|
+
* Payload of the `onClick` event emitted by `WalletButtons`.
|
|
5949
|
+
* Hand back a `Promise<void>` (defer the wallet sheet) or `Promise<boolean>` /
|
|
5950
|
+
* `boolean` (return `false` to abort the flow) via `attachResult`.
|
|
5951
|
+
*/
|
|
5397
5952
|
interface IWalletOnClick {
|
|
5953
|
+
/** Attach the result of an async operation to control the wallet flow. Resolving with `false` aborts; `void`/`true` continues. */
|
|
5398
5954
|
attachResult: (result: Promise<void> | boolean) => void;
|
|
5399
5955
|
}
|
|
5956
|
+
/**
|
|
5957
|
+
* Payload of the `update` event emitted by `WalletButtons` during the wallet flow
|
|
5958
|
+
* (e.g. when the user authorizes the payment in the wallet sheet but before the
|
|
5959
|
+
* server-side capture completes).
|
|
5960
|
+
*/
|
|
5400
5961
|
interface IWalletUpdate {
|
|
5962
|
+
/** Response code from the wallet provider (provider-specific). */
|
|
5401
5963
|
wallet_response_code?: string;
|
|
5964
|
+
/** Wallet provider's order identifier for this transaction. */
|
|
5402
5965
|
wallet_order_id?: string;
|
|
5966
|
+
/** Wallet provider's session identifier for this interaction. */
|
|
5403
5967
|
wallet_session_id?: string;
|
|
5968
|
+
/** Payment source details captured from the wallet. */
|
|
5404
5969
|
payment_source?: {
|
|
5970
|
+
/** Wallet's internal payment method identifier. */
|
|
5405
5971
|
wallet_payment_method_id?: string;
|
|
5972
|
+
/** Last 4 digits of the card. */
|
|
5406
5973
|
card_number_last4?: string;
|
|
5974
|
+
/** Card network/scheme (e.g. `'visa'`, `'mastercard'`). */
|
|
5407
5975
|
card_scheme?: string;
|
|
5408
5976
|
};
|
|
5977
|
+
/** Loyalty account details if the wallet provider supports loyalty. */
|
|
5409
5978
|
wallet_loyalty_account?: {
|
|
5979
|
+
/** Loyalty account identifier. */
|
|
5410
5980
|
id?: string;
|
|
5981
|
+
/** Loyalty account barcode. */
|
|
5411
5982
|
barcode?: string;
|
|
5412
5983
|
};
|
|
5984
|
+
/** Shipping address selected in the wallet sheet. */
|
|
5413
5985
|
shipping?: {
|
|
5986
|
+
/** Street address line 1. */
|
|
5414
5987
|
address_line1?: string;
|
|
5988
|
+
/** Street address line 2. */
|
|
5415
5989
|
address_line2?: string;
|
|
5990
|
+
/** Postal/ZIP code. */
|
|
5416
5991
|
address_postcode?: string;
|
|
5992
|
+
/** City. */
|
|
5417
5993
|
address_city?: string;
|
|
5994
|
+
/** State or administrative area. */
|
|
5418
5995
|
address_state?: string;
|
|
5996
|
+
/** ISO 3166 country code. */
|
|
5419
5997
|
address_country?: string;
|
|
5998
|
+
/** Company name on the address. */
|
|
5420
5999
|
address_company?: string;
|
|
6000
|
+
/** Post office box number. */
|
|
5421
6001
|
post_office_box_number?: string;
|
|
6002
|
+
/** Wallet provider's identifier for this saved address. */
|
|
5422
6003
|
wallet_address_id?: string;
|
|
6004
|
+
/** Display name for this saved address (e.g. `'Home'`). */
|
|
5423
6005
|
wallet_address_name?: string;
|
|
6006
|
+
/** ISO 8601 timestamp of when the address was saved. */
|
|
5424
6007
|
wallet_address_created_timestamp?: string;
|
|
6008
|
+
/** ISO 8601 timestamp of the last update to the address. */
|
|
5425
6009
|
wallet_address_updated_timestamp?: string;
|
|
5426
6010
|
};
|
|
6011
|
+
/** The shipping option the user selected in the wallet sheet. */
|
|
5427
6012
|
selected_shipping_option?: IShippingOption;
|
|
5428
6013
|
}
|
|
5429
6014
|
|
|
@@ -5799,8 +6384,15 @@ declare enum EVENT {
|
|
|
5799
6384
|
ON_SHIPPING_OPTIONS_CHANGE = "onShippingOptionsChange"
|
|
5800
6385
|
}
|
|
5801
6386
|
|
|
6387
|
+
/**
|
|
6388
|
+
* Base metadata required by every Wallet Buttons Express button.
|
|
6389
|
+
* Concrete wallet metas (e.g. `ApplePayWalletMeta`, `PaypalWalletMeta`) extend
|
|
6390
|
+
* this with wallet-specific configuration.
|
|
6391
|
+
*/
|
|
5802
6392
|
interface BaseWalletMeta {
|
|
6393
|
+
/** The payment amount as a number (e.g. `19.99`). */
|
|
5803
6394
|
amount: number;
|
|
6395
|
+
/** The ISO 4217 currency code (e.g. `'AUD'`, `'USD'`). */
|
|
5804
6396
|
currency: string;
|
|
5805
6397
|
}
|
|
5806
6398
|
|
|
@@ -6267,20 +6859,43 @@ interface IApplePayShippingOption {
|
|
|
6267
6859
|
amount?: string;
|
|
6268
6860
|
}
|
|
6269
6861
|
|
|
6862
|
+
/**
|
|
6863
|
+
* Metadata required to configure an `ApplePayWalletButtonExpress` button.
|
|
6864
|
+
* Extends {@link BaseWalletMeta} (`amount`, `currency`) plus Apple Pay specifics.
|
|
6865
|
+
*
|
|
6866
|
+
* The walletToken (JWT) returned from the `onClick` handler authorizes the actual
|
|
6867
|
+
* charge; this meta only configures the button presentation and the Apple Pay sheet.
|
|
6868
|
+
*/
|
|
6270
6869
|
interface ApplePayWalletMeta extends BaseWalletMeta {
|
|
6870
|
+
/** Label shown next to the total in the Apple Pay sheet (e.g. `'TOTAL'`). */
|
|
6271
6871
|
amount_label: string;
|
|
6872
|
+
/** ISO 3166-1 alpha-2 country code (e.g. `'AU'`, `'US'`). Required by Apple Pay. */
|
|
6272
6873
|
country: string;
|
|
6874
|
+
/** Payment capabilities the merchant supports. Must include at least `'supports3DS'`. */
|
|
6273
6875
|
merchant_capabilities?: Array<'supports3DS' | 'supportsEMV' | 'supportsCredit' | 'supportsDebit'>;
|
|
6876
|
+
/** Card networks the merchant accepts. */
|
|
6274
6877
|
supported_networks?: Array<'visa' | 'masterCard' | 'amex' | 'chinaUnionPay' | 'discover' | 'interac' | 'jcb' | 'privateLabel'>;
|
|
6878
|
+
/** Billing contact fields the user must provide. Note: Apple does not currently return `'phone'` or `'email'`. */
|
|
6275
6879
|
required_billing_contact_fields?: Array<'email' | 'name' | 'phone' | 'postalAddress'>;
|
|
6880
|
+
/** Shipping contact fields the user must provide. Include `'postalAddress'` to surface the address fields in the sheet. */
|
|
6276
6881
|
required_shipping_contact_fields?: Array<'email' | 'phone' | 'postalAddress'>;
|
|
6882
|
+
/**
|
|
6883
|
+
* Device capabilities allowed for the wallet button to be considered available.
|
|
6884
|
+
* Used as a relaxation knob for testing — defaults to `['paymentCredentialsAvailable']` only.
|
|
6885
|
+
*/
|
|
6277
6886
|
apple_pay_capabilities?: Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>;
|
|
6887
|
+
/** Restrict the cards Apple Pay offers to those issued in these ISO 3166 country codes. */
|
|
6278
6888
|
supported_countries?: string[];
|
|
6889
|
+
/** Visual styling for the Apple Pay button. */
|
|
6279
6890
|
style?: {
|
|
6891
|
+
/** Variant displayed on the button (e.g. `'buy'`, `'donate'`, `'plain'`). */
|
|
6280
6892
|
button_type?: ApplePayButtonType;
|
|
6893
|
+
/** Color scheme: `'black'`, `'white'`, or `'white-outline'`. */
|
|
6281
6894
|
button_style?: ApplePayButtonStyle;
|
|
6282
6895
|
};
|
|
6896
|
+
/** Pre-filled shipping data to seed the Apple Pay sheet. */
|
|
6283
6897
|
shipping?: AppleShippingType;
|
|
6898
|
+
/** Whether the user can edit the shipping address: `'available'` allows editing; `'store_pickup'` locks it. */
|
|
6284
6899
|
shipping_editing_mode?: ContactShippingEditingMode;
|
|
6285
6900
|
}
|
|
6286
6901
|
|
|
@@ -6341,32 +6956,63 @@ declare class ApplePayWalletButtonExpress extends BaseWalletButton<ApplePayWalle
|
|
|
6341
6956
|
private isUnsuportedBrowser;
|
|
6342
6957
|
}
|
|
6343
6958
|
|
|
6959
|
+
/**
|
|
6960
|
+
* Metadata required to configure a `PaypalWalletButtonExpress` button.
|
|
6961
|
+
* Extends {@link BaseWalletMeta} (`amount`, `currency`) with PayPal-specific options.
|
|
6962
|
+
*
|
|
6963
|
+
* Most PayPal style options mirror the
|
|
6964
|
+
* [PayPal Buttons Style Guide](https://developer.paypal.com/docs/multiparty/checkout/standard/customize/buttons-style-guide/).
|
|
6965
|
+
*/
|
|
6344
6966
|
interface PaypalWalletMeta extends BaseWalletMeta {
|
|
6967
|
+
/** Enable PayPal's Pay Later (Pay in 4) option. Defaults to `false`. */
|
|
6345
6968
|
pay_later?: boolean;
|
|
6969
|
+
/** Hide the Pay Later messaging copy under the button. Defaults to `false`. */
|
|
6346
6970
|
hide_message?: boolean;
|
|
6971
|
+
/** Render the standalone PayPal button instead of the smart button group. Defaults to `false`. */
|
|
6347
6972
|
standalone?: boolean;
|
|
6973
|
+
/** Capture the transaction immediately (`true`) or authorize for later capture (`false`). Defaults to `false`. */
|
|
6348
6974
|
capture?: boolean;
|
|
6975
|
+
/** Visual styling for the PayPal button. Mirrors PayPal's smart button style schema. */
|
|
6349
6976
|
style?: {
|
|
6977
|
+
/** Button layout orientation. */
|
|
6350
6978
|
layout?: 'vertical' | 'horizontal';
|
|
6979
|
+
/** Button color theme. */
|
|
6351
6980
|
color?: 'gold' | 'blue' | 'silver' | 'black' | 'white';
|
|
6981
|
+
/** Button shape. */
|
|
6352
6982
|
shape?: 'rect' | 'pill' | 'sharp';
|
|
6983
|
+
/** Custom border radius in pixels. Overrides `shape` corner roundness. */
|
|
6353
6984
|
borderRadius?: number;
|
|
6985
|
+
/** Button height in pixels. */
|
|
6354
6986
|
height?: number;
|
|
6987
|
+
/** When `true`, removes PayPal's default max-width constraint on the button. */
|
|
6355
6988
|
disableMaxWidth?: boolean;
|
|
6989
|
+
/** Label text displayed on the button. */
|
|
6356
6990
|
label?: 'paypal' | 'checkout' | 'buynow' | 'pay' | 'installment';
|
|
6991
|
+
/** Whether to show the tagline beneath the button. */
|
|
6357
6992
|
tagline?: boolean;
|
|
6993
|
+
/** Pay Later messaging configuration shown alongside the button. */
|
|
6358
6994
|
messages?: {
|
|
6995
|
+
/** Layout type for the messaging block. */
|
|
6359
6996
|
layout?: 'text' | 'flex';
|
|
6997
|
+
/** PayPal logo configuration in the messaging block. */
|
|
6360
6998
|
logo?: {
|
|
6999
|
+
/** Logo variant. `'none'` removes the logo entirely. */
|
|
6361
7000
|
type?: 'primary' | 'alternative' | 'inline' | 'none';
|
|
7001
|
+
/** Logo position relative to the message text. */
|
|
6362
7002
|
position?: 'left' | 'right' | 'top';
|
|
6363
7003
|
};
|
|
7004
|
+
/** Message text styling. */
|
|
6364
7005
|
text?: {
|
|
7006
|
+
/** Text color. */
|
|
6365
7007
|
color?: 'black' | 'white' | 'monochrome' | 'grayscale';
|
|
7008
|
+
/** Font size in pixels (10-16). */
|
|
6366
7009
|
size?: 10 | 11 | 12 | 13 | 14 | 15 | 16;
|
|
7010
|
+
/** Horizontal alignment. */
|
|
6367
7011
|
align?: 'left' | 'center' | 'right';
|
|
6368
7012
|
};
|
|
7013
|
+
/** Background color of the messaging block (used when `layout` is `'flex'`). */
|
|
6369
7014
|
color?: 'blue' | 'black' | 'white' | 'white-no-border' | 'gray' | 'monochrome' | 'grayscale';
|
|
7015
|
+
/** Aspect ratio of the messaging block. */
|
|
6370
7016
|
ratio?: '1x1' | '1x4' | '8x1' | '20x1';
|
|
6371
7017
|
};
|
|
6372
7018
|
};
|
|
@@ -6597,7 +7243,8 @@ declare global {
|
|
|
6597
7243
|
ExternalCheckoutBuilder: typeof Builder$1;
|
|
6598
7244
|
ExternalCheckoutChecker: typeof Checker;
|
|
6599
7245
|
PaymentSourceBuilder: typeof Builder;
|
|
6600
|
-
|
|
7246
|
+
Canvas3ds: typeof Canvas3ds;
|
|
7247
|
+
Checkout: typeof Checkout;
|
|
6601
7248
|
MultiWidget: typeof MultiWidget;
|
|
6602
7249
|
HtmlMultiWidget: typeof HtmlMultiWidget;
|
|
6603
7250
|
HtmlWidget: typeof HtmlWidget;
|
|
@@ -6608,5 +7255,5 @@ declare global {
|
|
|
6608
7255
|
}
|
|
6609
7256
|
}
|
|
6610
7257
|
|
|
6611
|
-
export { AfterpayCheckoutButton, AfterpayOnSiteMessaging, Api, ApplePayOpenWalletButton, ApplePayWalletButtonExpress, CHECKOUT_BUTTON_EVENT, Canvas3ds, Checkout, CheckoutActionCode, ClickToPay, Configuration, ContactShippingEditingMode, ELEMENT, ERROR_OPERATION, EVENT$
|
|
6612
|
-
export type { ApplePayButtonStyle, ApplePayButtonType, ApplePayWalletMeta, AppleShippingType, BaseWalletMeta, Billing, CheckoutResponse, CreateOTTData, CreateOTTRequest, CreateOTTResponse, CreateSessionRequest, CreateSessionResponse, EventTypes, FraudPreventionEvent, FraudPreventionEventType, FraudPreventionProvider, IApplePayShippingOption, ICheckout, IClickToPayMeta, IDetails, IElementStyleInput, IEventAfterLoadData, IEventCheckoutFinishData, IEventData$1 as IEventData, IEventFinishData, IEventMetaData, IEventSizeData, IFormValidation, IOpenWalletProvider, IPayPalMeta, IStyles$1 as IStyles, ITexts, IWalletMeta, IWalletOnClickEvent, IWalletPaymentSuccessfulEvent, IWalletUnavailableEvent, IWalletUpdateData, IWalletUpdateEvent, OTTResponse, OnCancelEventData, OnClickEventData$1 as OnClickEventData, OnCreateOTTErrorEventData, OnCreateOTTErrorPayload, OnCreateOTTSuccessPayload, OnCreateOTTSuccessfulEventData, OnErrorEventData$1 as OnErrorEventData, OnErrorPayload, OnLoadedEventData, OnUnavailableDetails, OnUnavailableEventData$1 as OnUnavailableEventData, OnUnavailablePayload, OpenWalletBaseEvent, OpenWalletDataEvent, OpenWalletEventType, OpenWalletMeta, PaypalWalletMeta, Shipping, VaultDisplayStyle, OnClickEventData as WalletExpressOnClickEventData, OnCloseEventData as WalletExpressOnCloseEventData, OnErrorEventData as WalletExpressOnErrorEventData, OnPaymentErrorEventData as WalletExpressOnPaymentErrorEventData, OnPaymentInReviewEventData as WalletExpressOnPaymentInReviewEventData, OnPaymentSuccessfulEventData as WalletExpressOnPaymentSuccessfulEventData, OnShippingAddressChangeEventData as WalletExpressOnShippingAddressChangeEventData, OnShippingAddressChangeEventResponse as WalletExpressOnShippingAddressChangeEventResponse, OnShippingOptionChangeEventData as WalletExpressOnShippingOptionChangeEventData, OnShippingOptionChangeEventResponse as WalletExpressOnShippingOptionChangeEventResponse, OnUnavailableEventData as WalletExpressOnUnavailableEventData, WalletType, WidgetEventMap, WidgetEventName };
|
|
7258
|
+
export { AfterpayCheckoutButton, AfterpayOnSiteMessaging, Api, ApplePayOpenWalletButton, ApplePayWalletButtonExpress, CANVAS_3DS_EVENT, CHECKOUT_BUTTON_EVENT, EVENT$2 as CHECKOUT_EVENT, Canvas3ds, Canvas3dsTokenFormat, Checkout, CheckoutActionCode, ClickToPay, Configuration, ContactShippingEditingMode, ELEMENT, ERROR_OPERATION, EVENT$3 as EVENT, Builder$1 as ExternalCheckoutBuilder, Checker as ExternalCheckoutChecker, FORM_FIELD, FRAUD_PREVENTION_EVENTS, FraudPreventionService, GooglePayOpenWalletButton, HtmlMultiWidget, HtmlPaymentSourceWidget, HtmlWidget, InstructionDebugger, MultiWidget, OpenWalletButtons, PAYMENT_EXPIRED, PAYMENT_FAILURE, PAYMENT_SUCCESSFUL, PAYMENT_TYPE, PURPOSE, PayPalDataCollector, PayPalSavePaymentSourceWidget, Builder as PaymentSourceBuilder, PaymentSourceWidget, PaypalCheckoutButton, PaypalWalletButtonExpress, STYLABLE_ELEMENT, STYLABLE_ELEMENT_STATE, STYLE, SUPPORTED_CARD_TYPES, TEXT, TOKEN_TYPE, TRIGGER, TYPE, VAULT_DISPLAY_STYLE, VaultDisplayWidget, EVENT as WALLET_BUTTONS_EXPRESS_EVENT, WALLET_TYPES, WalletButtons, ZipmoneyCheckoutButton };
|
|
7259
|
+
export type { ApplePayButtonStyle, ApplePayButtonType, ApplePayOpenWalletMeta, ApplePayWalletMeta, AppleShippingType, BaseWalletMeta, Billing, Canvas3dsAuthPayload, Canvas3dsChargeAuthEventPayload, Canvas3dsErrorEventPayload, Canvas3dsErrorPayload, Canvas3dsEventMap, Canvas3dsEventName, CheckoutIntentTokenPayload, CheckoutPaymentExpiredPayload, CheckoutPaymentFailurePayload, CheckoutPaymentSuccessPayload, CheckoutResponse, CreateOTTData, CreateOTTRequest, CreateOTTResponse, CreateSessionRequest, CreateSessionResponse, EventTypes, FraudPreventionEvent, FraudPreventionEventType, FraudPreventionProvider, GooglePayCardConfig, GooglePayOpenWalletMeta, GooglePayOpenWalletMetaStyles, HandleResponseInterface, IApplePayShippingOption, ICheckout, IClickToPayMeta, IDetails, IElementStyleInput, IEventAfterLoadData, IEventCheckoutFinishData, IEventData$1 as IEventData, IEventError, IEventFinishData, IEventMetaData, IEventSizeData, IFormValidation, IOpenWalletProvider, IPayPalMeta, IStyles$1 as IStyles, ITexts, ITokenStandalone3DS, IWalletMeta, IWalletOnClickEvent, IWalletPaymentSuccessfulEvent, IWalletUnavailableEvent, IWalletUpdateData, IWalletUpdateEvent, OTTResponse, OnCancelEventData, OnClickEventData$1 as OnClickEventData, OnCreateOTTErrorEventData, OnCreateOTTErrorPayload, OnCreateOTTSuccessPayload, OnCreateOTTSuccessfulEventData, OnErrorEventData$1 as OnErrorEventData, OnErrorPayload, OnLoadedEventData, OnUnavailableDetails, OnUnavailableEventData$1 as OnUnavailableEventData, OnUnavailablePayload, OpenWalletBaseEvent, OpenWalletDataEvent, OpenWalletEventType, OpenWalletMeta, PaypalWalletMeta, ProcessAuthenticationResponse, Shipping, VaultDisplayStyle, OnClickEventData as WalletExpressOnClickEventData, OnCloseEventData as WalletExpressOnCloseEventData, OnErrorEventData as WalletExpressOnErrorEventData, OnPaymentErrorEventData as WalletExpressOnPaymentErrorEventData, OnPaymentInReviewEventData as WalletExpressOnPaymentInReviewEventData, OnPaymentSuccessfulEventData as WalletExpressOnPaymentSuccessfulEventData, OnShippingAddressChangeEventData as WalletExpressOnShippingAddressChangeEventData, OnShippingAddressChangeEventResponse as WalletExpressOnShippingAddressChangeEventResponse, OnShippingOptionChangeEventData as WalletExpressOnShippingOptionChangeEventData, OnShippingOptionChangeEventResponse as WalletExpressOnShippingOptionChangeEventResponse, OnUnavailableEventData as WalletExpressOnUnavailableEventData, WalletType, WidgetEventMap, WidgetEventName };
|