@paydock/client-sdk 1.119.0-beta → 1.119.2
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 +69 -19
- package/bundles/index.cjs +112 -60
- package/bundles/index.cjs.d.ts +2060 -2050
- package/bundles/index.mjs +106 -53
- package/bundles/index.mjs.d.ts +2060 -2050
- package/bundles/types/checkout/instructions/v1/instruction.card_form.show.d.ts.map +1 -1
- package/bundles/types/components/iframe-event.d.ts +39 -29
- package/bundles/types/components/iframe-event.d.ts.map +1 -1
- package/bundles/types/helper/custom-error.d.ts +8 -0
- package/bundles/types/helper/custom-error.d.ts.map +1 -0
- package/bundles/types/shared/services/configuration-validation/configuration-validation.d.ts +1 -1
- package/bundles/types/shared/services/configuration-validation/configuration-validation.d.ts.map +1 -1
- package/bundles/types/widget/configuration.d.ts +7 -7
- package/bundles/types/widget/configuration.d.ts.map +1 -1
- package/bundles/types/widget/html-multi-widget.d.ts +1 -2
- package/bundles/types/widget/html-multi-widget.d.ts.map +1 -1
- package/bundles/types/widget/html-widget.d.ts +2 -1
- package/bundles/types/widget/html-widget.d.ts.map +1 -1
- package/bundles/types/widget/multi-widget.d.ts +4 -1
- package/bundles/types/widget/multi-widget.d.ts.map +1 -1
- package/bundles/widget.umd.js +112 -60
- package/bundles/widget.umd.js.d.ts +2060 -2050
- package/bundles/widget.umd.js.min.d.ts +2060 -2050
- package/bundles/widget.umd.min.js +1 -1
- package/docs/api-widget.md +21 -16
- package/docs/widget-examples.md +48 -3
- package/examples/multi-html-widget/extend.html +5 -0
- package/package.json +1 -1
- package/slate.md +48 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instruction.card_form.show.d.ts","sourceRoot":"","sources":["../../../../src/checkout/instructions/v1/instruction.card_form.show.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"instruction.card_form.show.d.ts","sourceRoot":"","sources":["../../../../src/checkout/instructions/v1/instruction.card_form.show.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAW,MAAM,iBAAiB,CAAC;AAOtD,qBACa,uBAAwB,SAAQ,kBAAkB;IAC7D,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC;IAC7B,OAAO,CAAC,SAAS,CAAM;IAEhB,MAAM,CAAC,OAAO,EAAE;QACrB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,OAAO,EAAE;YACP,aAAa,CAAC,EAAE;gBAAE,IAAI,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;YAClC,WAAW,EAAE;gBAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAA;aAAE,CAAC;SACnE,CAAC;KACH,GAAG,IAAI;IAkFD,OAAO;CAIf"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PURPOSE } from "../widget";
|
|
1
2
|
/**
|
|
2
3
|
* Contains basic information associated with the event.
|
|
3
4
|
*
|
|
@@ -14,42 +15,51 @@
|
|
|
14
15
|
export interface IEventData {
|
|
15
16
|
event: string;
|
|
16
17
|
message_source: string;
|
|
17
|
-
purpose:
|
|
18
|
+
purpose: PURPOSE;
|
|
18
19
|
widget_id: string;
|
|
19
20
|
data?: any;
|
|
20
21
|
ref_id?: string;
|
|
21
22
|
}
|
|
22
23
|
export declare const EVENT: {
|
|
23
|
-
AFTER_LOAD:
|
|
24
|
-
SUBMIT:
|
|
25
|
-
FINISH:
|
|
26
|
-
VALIDATION_ERROR:
|
|
27
|
-
SYSTEM_ERROR:
|
|
24
|
+
readonly AFTER_LOAD: "afterLoad";
|
|
25
|
+
readonly SUBMIT: "submit";
|
|
26
|
+
readonly FINISH: "finish";
|
|
27
|
+
readonly VALIDATION_ERROR: "validationError";
|
|
28
|
+
readonly SYSTEM_ERROR: "systemError";
|
|
29
|
+
readonly ERROR: "error";
|
|
28
30
|
/** @deprecated */
|
|
29
|
-
CHECKOUT_SUCCESS:
|
|
30
|
-
CHECKOUT_READY:
|
|
31
|
-
CHECKOUT_ERROR:
|
|
32
|
-
CHECKOUT_COMPLETED:
|
|
33
|
-
CHECKOUT_POPUP_OPEN:
|
|
34
|
-
CHECKOUT_POPUP_CLOSE:
|
|
35
|
-
RECOGNITION_TOKEN_REQUESTED:
|
|
36
|
-
RECOGNITION_TOKEN_DROPPED:
|
|
37
|
-
VALIDATION:
|
|
38
|
-
SELECT:
|
|
39
|
-
UNSELECT:
|
|
40
|
-
NEXT:
|
|
41
|
-
PREV:
|
|
42
|
-
META_CHANGE:
|
|
43
|
-
RESIZE:
|
|
44
|
-
CHARGE_AUTH_SUCCESS:
|
|
45
|
-
CHARGE_AUTH_REJECT:
|
|
46
|
-
CHARGE_AUTH_CANCELLED:
|
|
47
|
-
ADDITIONAL_DATA_SUCCESS:
|
|
48
|
-
ADDITIONAL_DATA_REJECT:
|
|
49
|
-
CHARGE_AUTH:
|
|
50
|
-
DISPATCH_SUCCESS:
|
|
51
|
-
DISPATCH_ERROR:
|
|
31
|
+
readonly CHECKOUT_SUCCESS: "checkoutSuccess";
|
|
32
|
+
readonly CHECKOUT_READY: "checkoutReady";
|
|
33
|
+
readonly CHECKOUT_ERROR: "checkoutError";
|
|
34
|
+
readonly CHECKOUT_COMPLETED: "checkoutCompleted";
|
|
35
|
+
readonly CHECKOUT_POPUP_OPEN: "checkoutPopupOpen";
|
|
36
|
+
readonly CHECKOUT_POPUP_CLOSE: "checkoutPopupClose";
|
|
37
|
+
readonly RECOGNITION_TOKEN_REQUESTED: "recognitionTokenRequested";
|
|
38
|
+
readonly RECOGNITION_TOKEN_DROPPED: "recognitionTokenDropped";
|
|
39
|
+
readonly VALIDATION: "validation";
|
|
40
|
+
readonly SELECT: "select";
|
|
41
|
+
readonly UNSELECT: "unselect";
|
|
42
|
+
readonly NEXT: "next";
|
|
43
|
+
readonly PREV: "prev";
|
|
44
|
+
readonly META_CHANGE: "metaChange";
|
|
45
|
+
readonly RESIZE: "resize";
|
|
46
|
+
readonly CHARGE_AUTH_SUCCESS: "chargeAuthSuccess";
|
|
47
|
+
readonly CHARGE_AUTH_REJECT: "chargeAuthReject";
|
|
48
|
+
readonly CHARGE_AUTH_CANCELLED: "chargeAuthCancelled";
|
|
49
|
+
readonly ADDITIONAL_DATA_SUCCESS: "additionalDataCollectSuccess";
|
|
50
|
+
readonly ADDITIONAL_DATA_REJECT: "additionalDataCollectReject";
|
|
51
|
+
readonly CHARGE_AUTH: "chargeAuth";
|
|
52
|
+
readonly DISPATCH_SUCCESS: "dispatchSuccess";
|
|
53
|
+
readonly DISPATCH_ERROR: "dispatchError";
|
|
52
54
|
};
|
|
55
|
+
export type EventTypes = typeof EVENT[keyof typeof EVENT];
|
|
56
|
+
export interface IErrorEvent {
|
|
57
|
+
event: EventTypes;
|
|
58
|
+
status?: number;
|
|
59
|
+
data: {
|
|
60
|
+
_message: string;
|
|
61
|
+
} & Record<string, any>;
|
|
62
|
+
}
|
|
53
63
|
export interface Listener {
|
|
54
64
|
event: string;
|
|
55
65
|
listener: (event: any) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iframe-event.d.ts","sourceRoot":"","sources":["../../src/components/iframe-event.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"iframe-event.d.ts","sourceRoot":"","sources":["../../src/components/iframe-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,UAAU;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,CA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E,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG;CAMzD"}
|
package/bundles/types/shared/services/configuration-validation/configuration-validation.d.ts
CHANGED
|
@@ -7,6 +7,6 @@ interface ValidatedConfiguration extends IGeneral {
|
|
|
7
7
|
};
|
|
8
8
|
handle_cvv?: boolean;
|
|
9
9
|
}
|
|
10
|
-
export declare function validateConfiguration(configuration: IGeneral
|
|
10
|
+
export declare function validateConfiguration(configuration: IGeneral): ValidatedConfiguration | undefined;
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=configuration-validation.d.ts.map
|
package/bundles/types/shared/services/configuration-validation/configuration-validation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration-validation.d.ts","sourceRoot":"","sources":["../../../../src/shared/services/configuration-validation/configuration-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EACL,qBAAqB,EAMtB,MAAM,SAAS,CAAC;AAGjB,UAAU,sBAAuB,SAAQ,QAAQ;IAC/C,qBAAqB,EAAE;QACrB,KAAK,EAAE,qBAAqB,EAAE,CAAC;QAC/B,GAAG,EAAE,MAAM,EAAE,CAAC;KACf,CAAC;IACF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AACD,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"configuration-validation.d.ts","sourceRoot":"","sources":["../../../../src/shared/services/configuration-validation/configuration-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EACL,qBAAqB,EAMtB,MAAM,SAAS,CAAC;AAGjB,UAAU,sBAAuB,SAAQ,QAAQ;IAC/C,qBAAqB,EAAE;QACrB,KAAK,EAAE,qBAAqB,EAAE,CAAC;QAC/B,GAAG,EAAE,MAAM,EAAE,CAAC;KACf,CAAC;IACF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AACD,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,QAAQ,GACtB,sBAAsB,GAAG,SAAS,CA2BpC"}
|
|
@@ -22,13 +22,13 @@ export declare const PAYMENT_TYPE: {
|
|
|
22
22
|
* @param {string} CARD_PAYMENT_SOURCE_WITH_CVV=card_payment_source_with_cvv
|
|
23
23
|
* @param {string} CARD_PAYMENT_SOURCE_WITHOUT_CVV=card_payment_source_without_cvv
|
|
24
24
|
* */
|
|
25
|
-
export declare
|
|
26
|
-
PAYMENT_SOURCE
|
|
27
|
-
CARD_PAYMENT_SOURCE_WITH_CVV
|
|
28
|
-
CARD_PAYMENT_SOURCE_WITHOUT_CVV
|
|
29
|
-
}
|
|
25
|
+
export declare enum PURPOSE {
|
|
26
|
+
PAYMENT_SOURCE = "payment_source",
|
|
27
|
+
CARD_PAYMENT_SOURCE_WITH_CVV = "card_payment_source_with_cvv",
|
|
28
|
+
CARD_PAYMENT_SOURCE_WITHOUT_CVV = "card_payment_source_without_cvv"
|
|
29
|
+
}
|
|
30
30
|
export interface IGeneral {
|
|
31
|
-
purpose:
|
|
31
|
+
purpose: PURPOSE;
|
|
32
32
|
predefined_fields: IPredefinedFields;
|
|
33
33
|
defined_form_fields?: string[];
|
|
34
34
|
webhook_destination?: string;
|
|
@@ -64,7 +64,7 @@ declare class Configuration {
|
|
|
64
64
|
private env;
|
|
65
65
|
static createEachToken(accessToken: string, configs: Configuration[]): Promise<string[]>;
|
|
66
66
|
private static addTokenInBase64;
|
|
67
|
-
/** @constructs */ constructor(gatewayID?: string, paymentType?: string, purpose?:
|
|
67
|
+
/** @constructs */ constructor(gatewayID?: string, paymentType?: string, purpose?: PURPOSE);
|
|
68
68
|
/**
|
|
69
69
|
* Destination, where customer will receive all successful responses.
|
|
70
70
|
* Response will contain “data” object with “payment_source” or other parameters, in depending on 'purpose'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/widget/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,aAAa,EAErB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAe,iBAAiB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAKhF;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY;;;;;;CAMxB,CAAA;AAED;;;;;;KAMK;AACL,
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/widget/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,aAAa,EAErB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAe,iBAAiB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAKhF;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY;;;;;;CAMxB,CAAA;AAED;;;;;;KAMK;AACL,oBAAY,OAAO;IACf,cAAc,mBAAmB;IACjC,4BAA4B,iCAAiC;IAC7D,+BAA+B,oCAAoC;CACtE;AAKD,MAAM,WAAW,QAAQ;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,iBAAiB;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IAC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,CAAC,IAAI;IAqBL,UAAU,IAAI,QAAQ;IAK7B,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,oBAAoB;IAIrB,qBAAqB,CAAC,cAAc,KAAA,EAAE,iBAAiB,KAAA;CAWjE;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Container } from "../components/container";
|
|
2
2
|
import { IFrame } from "../components/iframe";
|
|
3
|
-
import { type IEventData
|
|
3
|
+
import { type IEventData } from "../components/iframe-event";
|
|
4
4
|
import { type IFormValidation, type IFormValues, type ValidatorFieldsMapKey } from '../components/param';
|
|
5
5
|
import { type ITriggerData, Trigger } from "../components/trigger";
|
|
6
6
|
import { MultiWidget } from "./multi-widget";
|
|
@@ -127,7 +127,6 @@ declare class HtmlMultiWidget extends MultiWidget {
|
|
|
127
127
|
protected container: Container;
|
|
128
128
|
protected iFrame: IFrame;
|
|
129
129
|
protected triggerElement: Trigger;
|
|
130
|
-
protected event: IFrameEvent;
|
|
131
130
|
protected validationData: IFormValidation;
|
|
132
131
|
/** @constructs */ constructor(selector: string, publicKey: string, conf: any);
|
|
133
132
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-multi-widget.d.ts","sourceRoot":"","sources":["../../src/widget/html-multi-widget.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"html-multi-widget.d.ts","sourceRoot":"","sources":["../../src/widget/html-multi-widget.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAQ,KAAK,UAAU,EAAe,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAsB,KAAK,eAAe,EAAE,KAAK,WAAW,EAA0C,KAAK,qBAAqB,EAAC,MAAM,qBAAqB,CAAC;AACpK,OAAO,EAAE,KAAK,YAAY,EAAW,OAAO,EA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{ PURPOSE } from "./configuration";
|
|
1
2
|
import { HtmlMultiWidget } from "./html-multi-widget";
|
|
2
3
|
import { IBamboraMeta, IFormElement, IPayPalMeta } from "../components/param";
|
|
3
4
|
/**
|
|
@@ -20,7 +21,7 @@ import { IBamboraMeta, IFormElement, IPayPalMeta } from "../components/param";
|
|
|
20
21
|
* @param {string} [purpose=payment_source] - Purpose of widget form. Available parameters: ‘payment_source’, ‘card_payment_source_with_cvv’, ‘card_payment_source_without_cvv’
|
|
21
22
|
*/
|
|
22
23
|
declare class HtmlWidget extends HtmlMultiWidget {
|
|
23
|
-
/** @constructs */ constructor(selector: string, publicKey: string, gatewayID?: string, paymentType?: string, purpose?:
|
|
24
|
+
/** @constructs */ constructor(selector: string, publicKey: string, gatewayID?: string, paymentType?: string, purpose?: PURPOSE);
|
|
24
25
|
/**
|
|
25
26
|
* Destination, where customer will receive all successful responses.
|
|
26
27
|
* Response will contain “data” object with “payment_source” or other parameters, in depending on 'purpose'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-widget.d.ts","sourceRoot":"","sources":["../../src/widget/html-widget.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"html-widget.d.ts","sourceRoot":"","sources":["../../src/widget/html-widget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAG5E;;;;;;;;;;;;;;;;;;GAkBG;AACH,cAAM,UAAW,SAAQ,eAAe;IAEpC,kBAAkB,aACN,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,SAAY,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO;IAM/G;;;;;;;;OAQG;IACI,qBAAqB,CAAC,GAAG,EAAE,MAAM;IAIxC;;;;;;;OAOG;IACI,qBAAqB,CAAC,GAAG,EAAE,MAAM;IAKxC;;;;;;;OAOG;IACI,mBAAmB,CAAC,GAAG,EAAE,MAAM;IAKtC;;;;;;;;OAQG;IACI,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE;IAKvC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACM,eAAe,CAAC,QAAQ,EAAE,YAAY,EAAE;IAKxC,cAAc,CAAC,OAAO,EAAE,YAAY;IAK3C;;;;;;;;;;;OAWG;IACI,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,YAAY;IAKxC,iBAAiB,CAAC,cAAc,KAAA,EAAE,iBAAiB,KAAA;CAG7D;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { Link } from '../components/link';
|
|
|
2
2
|
import { Configuration } from './configuration';
|
|
3
3
|
import { IStyles, ITexts, IFormValues, IIcons, ICountryPhoneMask, IFormLabels, IFormPlaceholders, IFormElement } from '../components/param';
|
|
4
4
|
import { IElementStyleInput, IElementStyleLabel, IElementStyleSubmitButton, IElementStyleTitle, IElementStyleTitleDescription } from "./style";
|
|
5
|
+
import { IErrorEvent, IFrameEvent } from '../components/iframe-event';
|
|
5
6
|
/**
|
|
6
7
|
*
|
|
7
8
|
* Class MultiWidget include method for for creating iframe url
|
|
@@ -27,6 +28,7 @@ declare class MultiWidget {
|
|
|
27
28
|
protected configs: Configuration[];
|
|
28
29
|
protected configTokens: string[];
|
|
29
30
|
protected accessToken: string;
|
|
31
|
+
protected event: IFrameEvent;
|
|
30
32
|
constructor(accessToken: string, confTokens: string[]);
|
|
31
33
|
constructor(accessToken: string, confToken: string);
|
|
32
34
|
constructor(accessToken: string, configs: Configuration[]);
|
|
@@ -215,7 +217,7 @@ declare class MultiWidget {
|
|
|
215
217
|
* console.log(errors);
|
|
216
218
|
* });
|
|
217
219
|
*/
|
|
218
|
-
loadIFrameUrl(cb: (url: string) => void, errorCb?: (
|
|
220
|
+
loadIFrameUrl(cb: (url: string) => void, errorCb?: (error: any) => void): void;
|
|
219
221
|
/**
|
|
220
222
|
* Method for setting a custom language code
|
|
221
223
|
*
|
|
@@ -225,6 +227,7 @@ declare class MultiWidget {
|
|
|
225
227
|
*/
|
|
226
228
|
setLanguage(code: any): void;
|
|
227
229
|
getLink(): Link;
|
|
230
|
+
protected handleErrorEvent(err: IErrorEvent): void;
|
|
228
231
|
}
|
|
229
232
|
export { MultiWidget };
|
|
230
233
|
//# sourceMappingURL=multi-widget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-widget.d.ts","sourceRoot":"","sources":["../../src/widget/multi-widget.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAe,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,OAAO,EACP,MAAM,EAMN,WAAW,EAEX,MAAM,EACN,iBAAiB,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAChE,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,6BAA6B,EAEhC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"multi-widget.d.ts","sourceRoot":"","sources":["../../src/widget/multi-widget.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAe,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,OAAO,EACP,MAAM,EAMN,WAAW,EAEX,MAAM,EACN,iBAAiB,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAChE,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,6BAA6B,EAEhC,MAAM,SAAS,CAAC;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n) {
|
|
26
26
|
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
27
27
|
}
|
|
28
|
+
function _construct(t, e, r) {
|
|
29
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
30
|
+
var o = [null];
|
|
31
|
+
o.push.apply(o, e);
|
|
32
|
+
var p = new (t.bind.apply(t, o))();
|
|
33
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
|
34
|
+
}
|
|
28
35
|
function _defineProperties(e, r) {
|
|
29
36
|
for (var t = 0; t < r.length; t++) {
|
|
30
37
|
var o = r[t];
|
|
@@ -127,6 +134,13 @@
|
|
|
127
134
|
writable: !1
|
|
128
135
|
}), e && _setPrototypeOf(t, e);
|
|
129
136
|
}
|
|
137
|
+
function _isNativeFunction(t) {
|
|
138
|
+
try {
|
|
139
|
+
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
140
|
+
} catch (n) {
|
|
141
|
+
return "function" == typeof t;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
130
144
|
function _isNativeReflectConstruct() {
|
|
131
145
|
try {
|
|
132
146
|
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
@@ -528,6 +542,28 @@
|
|
|
528
542
|
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
529
543
|
}
|
|
530
544
|
}
|
|
545
|
+
function _wrapNativeSuper(t) {
|
|
546
|
+
var r = "function" == typeof Map ? new Map() : void 0;
|
|
547
|
+
return _wrapNativeSuper = function (t) {
|
|
548
|
+
if (null === t || !_isNativeFunction(t)) return t;
|
|
549
|
+
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
|
550
|
+
if (void 0 !== r) {
|
|
551
|
+
if (r.has(t)) return r.get(t);
|
|
552
|
+
r.set(t, Wrapper);
|
|
553
|
+
}
|
|
554
|
+
function Wrapper() {
|
|
555
|
+
return _construct(t, arguments, _getPrototypeOf(this).constructor);
|
|
556
|
+
}
|
|
557
|
+
return Wrapper.prototype = Object.create(t.prototype, {
|
|
558
|
+
constructor: {
|
|
559
|
+
value: Wrapper,
|
|
560
|
+
enumerable: !1,
|
|
561
|
+
writable: !0,
|
|
562
|
+
configurable: !0
|
|
563
|
+
}
|
|
564
|
+
}), _setPrototypeOf(Wrapper, t);
|
|
565
|
+
}, _wrapNativeSuper(t);
|
|
566
|
+
}
|
|
531
567
|
|
|
532
568
|
var Browser = /*#__PURE__*/function () {
|
|
533
569
|
function Browser() {
|
|
@@ -893,7 +929,7 @@
|
|
|
893
929
|
version: 'x-sdk-version',
|
|
894
930
|
type: 'x-sdk-type'
|
|
895
931
|
});
|
|
896
|
-
SDK._version = 'v1.119.
|
|
932
|
+
SDK._version = 'v1.119.2';
|
|
897
933
|
|
|
898
934
|
/******************************************************************************
|
|
899
935
|
Copyright (c) Microsoft Corporation.
|
|
@@ -4155,8 +4191,8 @@
|
|
|
4155
4191
|
var params = {
|
|
4156
4192
|
enabled: 'true',
|
|
4157
4193
|
accountId: '974691',
|
|
4158
|
-
agentId: '
|
|
4159
|
-
applicationId: '
|
|
4194
|
+
agentId: '1386157152',
|
|
4195
|
+
applicationId: '1386157152',
|
|
4160
4196
|
licenseKey: '4848a32285',
|
|
4161
4197
|
trustKey: '974691'
|
|
4162
4198
|
};
|
|
@@ -4961,6 +4997,7 @@
|
|
|
4961
4997
|
FINISH: 'finish',
|
|
4962
4998
|
VALIDATION_ERROR: 'validationError',
|
|
4963
4999
|
SYSTEM_ERROR: 'systemError',
|
|
5000
|
+
ERROR: 'error',
|
|
4964
5001
|
/** @deprecated */
|
|
4965
5002
|
CHECKOUT_SUCCESS: 'checkoutSuccess',
|
|
4966
5003
|
CHECKOUT_READY: 'checkoutReady',
|
|
@@ -12822,12 +12859,12 @@
|
|
|
12822
12859
|
PAYMENT_SOURCE_TYPE["CHECKOUT"] = "checkout";
|
|
12823
12860
|
PAYMENT_SOURCE_TYPE["BANK_ACCOUNT"] = "bank_account";
|
|
12824
12861
|
})(PAYMENT_SOURCE_TYPE || (PAYMENT_SOURCE_TYPE = {}));
|
|
12825
|
-
var PURPOSE
|
|
12862
|
+
var PURPOSE;
|
|
12826
12863
|
(function (PURPOSE) {
|
|
12827
12864
|
PURPOSE["PAYMENT_SOURCE"] = "payment_source";
|
|
12828
12865
|
PURPOSE["CARD_PAYMENT_SOURCE_WITH_CVV"] = "card_payment_source_with_cvv";
|
|
12829
12866
|
PURPOSE["CARD_PAYMENT_SOURCE_WITHOUT_CVV"] = "card_payment_source_without_cvv";
|
|
12830
|
-
})(PURPOSE
|
|
12867
|
+
})(PURPOSE || (PURPOSE = {}));
|
|
12831
12868
|
var ALLOWED_RESPONSE_DATA;
|
|
12832
12869
|
(function (ALLOWED_RESPONSE_DATA) {
|
|
12833
12870
|
ALLOWED_RESPONSE_DATA["PAYMENT_SOURCE_TOKEN"] = "payment_source";
|
|
@@ -13000,11 +13037,11 @@
|
|
|
13000
13037
|
}
|
|
13001
13038
|
function getHandleCvv(configuration) {
|
|
13002
13039
|
switch (configuration.purpose) {
|
|
13003
|
-
case PURPOSE
|
|
13040
|
+
case PURPOSE.CARD_PAYMENT_SOURCE_WITH_CVV:
|
|
13004
13041
|
{
|
|
13005
13042
|
return true;
|
|
13006
13043
|
}
|
|
13007
|
-
case PURPOSE
|
|
13044
|
+
case PURPOSE.CARD_PAYMENT_SOURCE_WITHOUT_CVV:
|
|
13008
13045
|
{
|
|
13009
13046
|
return false;
|
|
13010
13047
|
}
|
|
@@ -13015,6 +13052,22 @@
|
|
|
13015
13052
|
}
|
|
13016
13053
|
}
|
|
13017
13054
|
|
|
13055
|
+
var CustomError = /*#__PURE__*/function (_Error) {
|
|
13056
|
+
function CustomError(message, status, data) {
|
|
13057
|
+
var _this;
|
|
13058
|
+
_classCallCheck(this, CustomError);
|
|
13059
|
+
_this = _callSuper(this, CustomError, [message]);
|
|
13060
|
+
_this.status = status;
|
|
13061
|
+
_this.data = _extends({
|
|
13062
|
+
_message: message
|
|
13063
|
+
}, data);
|
|
13064
|
+
Object.setPrototypeOf(_this, CustomError.prototype);
|
|
13065
|
+
return _this;
|
|
13066
|
+
}
|
|
13067
|
+
_inherits(CustomError, _Error);
|
|
13068
|
+
return _createClass(CustomError);
|
|
13069
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
13070
|
+
|
|
13018
13071
|
/**
|
|
13019
13072
|
* List of available payment source types
|
|
13020
13073
|
*
|
|
@@ -13037,11 +13090,12 @@
|
|
|
13037
13090
|
* @param {string} CARD_PAYMENT_SOURCE_WITH_CVV=card_payment_source_with_cvv
|
|
13038
13091
|
* @param {string} CARD_PAYMENT_SOURCE_WITHOUT_CVV=card_payment_source_without_cvv
|
|
13039
13092
|
* */
|
|
13040
|
-
|
|
13041
|
-
|
|
13042
|
-
|
|
13043
|
-
|
|
13044
|
-
|
|
13093
|
+
exports.PURPOSE = void 0;
|
|
13094
|
+
(function (PURPOSE) {
|
|
13095
|
+
PURPOSE["PAYMENT_SOURCE"] = "payment_source";
|
|
13096
|
+
PURPOSE["CARD_PAYMENT_SOURCE_WITH_CVV"] = "card_payment_source_with_cvv";
|
|
13097
|
+
PURPOSE["CARD_PAYMENT_SOURCE_WITHOUT_CVV"] = "card_payment_source_without_cvv";
|
|
13098
|
+
})(exports.PURPOSE || (exports.PURPOSE = {}));
|
|
13045
13099
|
var CONFIGURATION_LINK = '/v1/remote-action/configs';
|
|
13046
13100
|
var DEFAULT_GATEWAY_LINK = '/v1/gateways/default';
|
|
13047
13101
|
/**
|
|
@@ -13064,11 +13118,11 @@
|
|
|
13064
13118
|
function Configuration() {
|
|
13065
13119
|
var gatewayID = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
|
13066
13120
|
var paymentType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : PAYMENT_TYPE.CARD;
|
|
13067
|
-
var purpose = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : PURPOSE.PAYMENT_SOURCE;
|
|
13121
|
+
var purpose = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : exports.PURPOSE.PAYMENT_SOURCE;
|
|
13068
13122
|
_classCallCheck(this, Configuration);
|
|
13069
13123
|
if (ObjectHelper.values(PAYMENT_TYPE).indexOf(paymentType) === -1) throw new Error('unsupported payment type');
|
|
13070
13124
|
if (paymentType === PAYMENT_TYPE.CHECKOUT) throw new Error('Payment type "checkout" is deprecated. Use CheckoutButton for this type of payments https://www.npmjs.com/package/@paydock/client-sdk#checkout-button');
|
|
13071
|
-
if (ObjectHelper.values(PURPOSE).indexOf(purpose) === -1) throw new Error('unsupported purpose');
|
|
13125
|
+
if (ObjectHelper.values(exports.PURPOSE).indexOf(purpose) === -1) throw new Error('unsupported purpose');
|
|
13072
13126
|
this.env = new Env(API_URL);
|
|
13073
13127
|
this.configs = {
|
|
13074
13128
|
purpose: purpose,
|
|
@@ -13275,7 +13329,7 @@
|
|
|
13275
13329
|
key: "createEachToken",
|
|
13276
13330
|
value: function createEachToken(accessToken, configs) {
|
|
13277
13331
|
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
13278
|
-
var tokens, index, data, validatedConfig
|
|
13332
|
+
var tokens, index, data, validatedConfig;
|
|
13279
13333
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
13280
13334
|
while (1) switch (_context.prev = _context.next) {
|
|
13281
13335
|
case 0:
|
|
@@ -13283,16 +13337,16 @@
|
|
|
13283
13337
|
_context.t0 = _regeneratorRuntime().keys(configs);
|
|
13284
13338
|
case 2:
|
|
13285
13339
|
if ((_context.t1 = _context.t0()).done) {
|
|
13286
|
-
_context.next =
|
|
13340
|
+
_context.next = 18;
|
|
13287
13341
|
break;
|
|
13288
13342
|
}
|
|
13289
13343
|
index = _context.t1.value;
|
|
13290
13344
|
if (!configs.hasOwnProperty(index)) {
|
|
13291
|
-
_context.next =
|
|
13345
|
+
_context.next = 16;
|
|
13292
13346
|
break;
|
|
13293
13347
|
}
|
|
13294
13348
|
if (!(configs[index].configs.predefined_fields.gateway_id === "default")) {
|
|
13295
|
-
_context.next =
|
|
13349
|
+
_context.next = 14;
|
|
13296
13350
|
break;
|
|
13297
13351
|
}
|
|
13298
13352
|
_context.next = 8;
|
|
@@ -13300,39 +13354,23 @@
|
|
|
13300
13354
|
case 8:
|
|
13301
13355
|
data = _context.sent;
|
|
13302
13356
|
if (!(data['status'] !== 200)) {
|
|
13303
|
-
_context.next =
|
|
13357
|
+
_context.next = 13;
|
|
13304
13358
|
break;
|
|
13305
13359
|
}
|
|
13306
13360
|
console.error("--- | gateway: default | ".concat(data['error']['message']));
|
|
13307
|
-
|
|
13308
|
-
|
|
13309
|
-
|
|
13310
|
-
_context.next = 16;
|
|
13311
|
-
break;
|
|
13312
|
-
}
|
|
13361
|
+
data['error']['purpose'] = configs[index].configs.purpose;
|
|
13362
|
+
throw new CustomError('gateway: unexpected error with extract default gateway id', data['status'], data['error']);
|
|
13363
|
+
case 13:
|
|
13313
13364
|
configs[index].configs.predefined_fields.gateway_id = data['resource']['data']['_id'];
|
|
13314
|
-
|
|
13315
|
-
break;
|
|
13316
|
-
case 16:
|
|
13317
|
-
throw new Error('gateway: unexpected error with extract default gateway id');
|
|
13318
|
-
case 17:
|
|
13365
|
+
case 14:
|
|
13319
13366
|
validatedConfig = validateConfiguration(configs[index].configs);
|
|
13320
|
-
if (validatedConfig)
|
|
13321
|
-
|
|
13322
|
-
}
|
|
13323
|
-
_context.next = 23;
|
|
13324
|
-
break;
|
|
13325
|
-
case 21:
|
|
13326
|
-
_validatedConfig = validateConfiguration(configs[index].configs);
|
|
13327
|
-
if (_validatedConfig) {
|
|
13328
|
-
Configuration.addTokenInBase64(tokens, JSON.stringify(_validatedConfig), index);
|
|
13329
|
-
}
|
|
13330
|
-
case 23:
|
|
13367
|
+
if (validatedConfig) Configuration.addTokenInBase64(tokens, JSON.stringify(validatedConfig), index);
|
|
13368
|
+
case 16:
|
|
13331
13369
|
_context.next = 2;
|
|
13332
13370
|
break;
|
|
13333
|
-
case
|
|
13371
|
+
case 18:
|
|
13334
13372
|
return _context.abrupt("return", tokens);
|
|
13335
|
-
case
|
|
13373
|
+
case 19:
|
|
13336
13374
|
case "end":
|
|
13337
13375
|
return _context.stop();
|
|
13338
13376
|
}
|
|
@@ -13578,6 +13616,7 @@
|
|
|
13578
13616
|
this.accessToken = accessToken;
|
|
13579
13617
|
if (!conf || Array.isArray(conf) && !conf.length) throw Error('configuration token is required');
|
|
13580
13618
|
if (typeof conf === 'string') this.configTokens.push(conf);else if (conf instanceof Configuration) this.configs.push(conf);else if (Array.isArray(conf) && typeof conf[0] === 'string') this.configTokens = conf;else if (Array.isArray(conf) && conf[0] instanceof Configuration) this.configs = conf;else throw Error('Unsupported type of configuration token');
|
|
13619
|
+
this.event = new IFrameEvent(window);
|
|
13581
13620
|
}
|
|
13582
13621
|
/**
|
|
13583
13622
|
* Object contain styles for widget
|
|
@@ -13968,16 +14007,15 @@
|
|
|
13968
14007
|
this.link.setParams({
|
|
13969
14008
|
configuration_tokens: this.configTokens.join(',')
|
|
13970
14009
|
});
|
|
13971
|
-
|
|
14010
|
+
cb(this.link.getUrl());
|
|
14011
|
+
} else {
|
|
14012
|
+
Configuration.createEachToken(this.accessToken, this.configs).then(function (tokens) {
|
|
14013
|
+
_this2.link.concatParams({
|
|
14014
|
+
configuration_tokens: tokens.join(',')
|
|
14015
|
+
});
|
|
14016
|
+
cb(_this2.link.getUrl());
|
|
14017
|
+
})["catch"](errorCb);
|
|
13972
14018
|
}
|
|
13973
|
-
Configuration.createEachToken(this.accessToken, this.configs).then(function (tokens) {
|
|
13974
|
-
_this2.link.concatParams({
|
|
13975
|
-
configuration_tokens: tokens.join(',')
|
|
13976
|
-
});
|
|
13977
|
-
return cb(_this2.link.getUrl());
|
|
13978
|
-
}, function (errors) {
|
|
13979
|
-
errorCb(errors);
|
|
13980
|
-
});
|
|
13981
14019
|
}
|
|
13982
14020
|
/**
|
|
13983
14021
|
* Method for setting a custom language code
|
|
@@ -13998,6 +14036,21 @@
|
|
|
13998
14036
|
value: function getLink() {
|
|
13999
14037
|
return this.link;
|
|
14000
14038
|
}
|
|
14039
|
+
}, {
|
|
14040
|
+
key: "handleErrorEvent",
|
|
14041
|
+
value: function handleErrorEvent(err) {
|
|
14042
|
+
if (Object.values(EVENT$4).includes(err.event)) {
|
|
14043
|
+
this.event.emit({
|
|
14044
|
+
event: err.event,
|
|
14045
|
+
message_source: 'widget',
|
|
14046
|
+
purpose: err.data.purpose || '',
|
|
14047
|
+
widget_id: this.link.getParams().widget_id,
|
|
14048
|
+
data: err.data
|
|
14049
|
+
});
|
|
14050
|
+
return;
|
|
14051
|
+
}
|
|
14052
|
+
console.error("Unknown event: ", err);
|
|
14053
|
+
}
|
|
14001
14054
|
}]);
|
|
14002
14055
|
}();
|
|
14003
14056
|
|
|
@@ -14163,7 +14216,6 @@
|
|
|
14163
14216
|
_this.container = new Container(selector);
|
|
14164
14217
|
_this.iFrame = new IFrame(_this.container);
|
|
14165
14218
|
_this.triggerElement = new Trigger(_this.iFrame);
|
|
14166
|
-
_this.event = new IFrameEvent(window);
|
|
14167
14219
|
return _this;
|
|
14168
14220
|
}
|
|
14169
14221
|
/**
|
|
@@ -14183,11 +14235,12 @@
|
|
|
14183
14235
|
title: 'Card details'
|
|
14184
14236
|
});
|
|
14185
14237
|
_this2.afterLoad();
|
|
14186
|
-
}, function (
|
|
14187
|
-
|
|
14188
|
-
|
|
14189
|
-
|
|
14190
|
-
}
|
|
14238
|
+
}, function (error) {
|
|
14239
|
+
if (error instanceof CustomError) _this2.handleErrorEvent({
|
|
14240
|
+
event: EVENT$4.ERROR,
|
|
14241
|
+
data: error.data
|
|
14242
|
+
});
|
|
14243
|
+
console.error('Error when creating a token, widget will not be loaded');
|
|
14191
14244
|
});
|
|
14192
14245
|
}
|
|
14193
14246
|
/**
|
|
@@ -15086,7 +15139,7 @@
|
|
|
15086
15139
|
value: function handle(context) {
|
|
15087
15140
|
var _this = this;
|
|
15088
15141
|
var _a;
|
|
15089
|
-
this.widget = new HtmlWidget(this.formSelector, context === null || context === void 0 ? void 0 : context.instruction_token, 'not_configured', 'card',
|
|
15142
|
+
this.widget = new HtmlWidget(this.formSelector, context === null || context === void 0 ? void 0 : context.instruction_token, 'not_configured', 'card', exports.PURPOSE.CARD_PAYMENT_SOURCE_WITH_CVV);
|
|
15090
15143
|
this.widget.setStyles(_extends({
|
|
15091
15144
|
button_color: DEFAULT_VARIABLES.BTN_COLOR,
|
|
15092
15145
|
background_color: DEFAULT_VARIABLES.BG_COLOR,
|
|
@@ -35426,7 +35479,6 @@
|
|
|
35426
35479
|
exports.InstructionDebugger = InstructionDebugger;
|
|
35427
35480
|
exports.MultiWidget = MultiWidget;
|
|
35428
35481
|
exports.PAYMENT_TYPE = PAYMENT_TYPE;
|
|
35429
|
-
exports.PURPOSE = PURPOSE;
|
|
35430
35482
|
exports.PayPalDataCollector = PayPalDataCollector;
|
|
35431
35483
|
exports.PayPalSavePaymentSourceWidget = PayPalSavePaymentSourceWidget;
|
|
35432
35484
|
exports.PaymentSourceBuilder = Builder;
|