@trustpayments/3ds-sdk-js 1.2.133 → 1.2.135
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 +27 -21
- package/dist/index.d.ts +20 -20
- package/dist/index.js +1 -1
- package/package.json +20 -13
package/README.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# 3DS SDK JS
|
|
2
2
|
|
|
3
3
|
## Warning!
|
|
4
|
+
|
|
4
5
|
This package is for internal purposes only.
|
|
5
6
|
|
|
6
7
|
## Config
|
|
8
|
+
|
|
7
9
|
- `challengeDisplayMode` - `POPUP | INLINE`. Default: `POPUP`<br><br>
|
|
8
10
|
|
|
9
11
|
- `challengeDisplayInlineTargetElementId` - `string`. Default: `undefined`.<br>Must be the existing DOM Element when using `challengeDisplayMode` = `INLINE`.<br><br>
|
|
@@ -13,7 +15,7 @@ This package is for internal purposes only.
|
|
|
13
15
|
- `translations` - `{cancel: string; }`. Default: `{ cancel: 'X' }`<br><br>
|
|
14
16
|
|
|
15
17
|
- `processingScreenMode` - `OVERLAY` | `ATTACH_TO_ELEMENT`. Default: `OVERLAY`<br>
|
|
16
|
-
`ATTACH_TO_ELEMENT` requires additional property `processingScreenWrapperElementId`<br><br>
|
|
18
|
+
`ATTACH_TO_ELEMENT` requires additional property `processingScreenWrapperElementId`<br><br>
|
|
17
19
|
|
|
18
20
|
- `processingScreenWrapperElementId` - `string`. Default: `undefined`<br>Must be the existing DOM Element when using `processingScreenMode` = `ATTACH_TO_ELEMENT`.<br><br>
|
|
19
21
|
|
|
@@ -24,8 +26,9 @@ This package is for internal purposes only.
|
|
|
24
26
|
### init$()
|
|
25
27
|
|
|
26
28
|
Initializes the library and returns the Observable with the config.
|
|
29
|
+
|
|
27
30
|
```
|
|
28
|
-
init$(config:
|
|
31
|
+
init$(config: IConfigInterface): Observable<IConfigInterface | never>;
|
|
29
32
|
```
|
|
30
33
|
|
|
31
34
|
Default values for config are:<br>
|
|
@@ -33,20 +36,20 @@ Default values for config are:<br>
|
|
|
33
36
|
`loggingLevel: LoggingLevel.ERROR`
|
|
34
37
|
|
|
35
38
|
```ts
|
|
36
|
-
interface
|
|
39
|
+
interface IConfigInterface {
|
|
37
40
|
challengeDisplayMode?: ChallengeDisplayMode;
|
|
38
41
|
challengeDisplayInlineTargetElementId?: string;
|
|
39
42
|
loggingLevel?: LoggingLevel;
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
enum ChallengeDisplayMode {
|
|
43
|
-
POPUP =
|
|
44
|
-
INLINE =
|
|
46
|
+
POPUP = "POPUP",
|
|
47
|
+
INLINE = "INLINE",
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
enum LoggingLevel {
|
|
48
|
-
ERROR =
|
|
49
|
-
ALL =
|
|
51
|
+
ERROR = "ERROR",
|
|
52
|
+
ALL = "ALL",
|
|
50
53
|
}
|
|
51
54
|
```
|
|
52
55
|
|
|
@@ -55,22 +58,23 @@ enum LoggingLevel {
|
|
|
55
58
|
Runs 3DS method and returns the result.
|
|
56
59
|
|
|
57
60
|
```
|
|
58
|
-
run3DSMethod$(transactionId: string, notificationURL: string, methodURL: string): Observable<
|
|
61
|
+
run3DSMethod$(transactionId: string, notificationURL: string, methodURL: string): Observable<IMethodURLResultInterface | never>;
|
|
59
62
|
```
|
|
63
|
+
|
|
60
64
|
```ts
|
|
61
|
-
interface
|
|
65
|
+
interface IMethodURLResultInterface {
|
|
62
66
|
status: ResultActionCode;
|
|
63
67
|
description: string;
|
|
64
68
|
transactionId: string;
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
enum ResultActionCode {
|
|
68
|
-
SUCCESS =
|
|
69
|
-
FAILURE =
|
|
70
|
-
ERROR =
|
|
71
|
-
NOACTION =
|
|
72
|
-
CANCELLED =
|
|
73
|
-
COMPLETED =
|
|
72
|
+
SUCCESS = "SUCCESS",
|
|
73
|
+
FAILURE = "FAILURE",
|
|
74
|
+
ERROR = "ERROR",
|
|
75
|
+
NOACTION = "NOACTION",
|
|
76
|
+
CANCELLED = "CANCELLED",
|
|
77
|
+
COMPLETED = "COMPLETED",
|
|
74
78
|
}
|
|
75
79
|
```
|
|
76
80
|
|
|
@@ -78,6 +82,7 @@ Possible `ResultActionCode` values are: `SUCCESS`, `FAILURE`, `ERROR`, and `UNCO
|
|
|
78
82
|
`UNCOMPLETED` timeout can be set via config property `threeDSMethodTimeout`. Default values is 10 seconds.
|
|
79
83
|
|
|
80
84
|
### doChallenge$()
|
|
85
|
+
|
|
81
86
|
Initializes the challenge process. This method handles both versions `1.0.0` and `2.1.0 | 2.2.0`.<br>
|
|
82
87
|
For version `1.0.0`, `termURL` and `merchantData` parameters are required.
|
|
83
88
|
|
|
@@ -88,11 +93,11 @@ doChallenge$(
|
|
|
88
93
|
challengeURL: string,
|
|
89
94
|
termURL?: string,
|
|
90
95
|
merchantData?: string,
|
|
91
|
-
): Observable<
|
|
96
|
+
): Observable<IChallengeResultInterface | never>;
|
|
92
97
|
```
|
|
93
98
|
|
|
94
99
|
```
|
|
95
|
-
export interface
|
|
100
|
+
export interface IChallengeResultInterface {
|
|
96
101
|
status: ResultActionCode; // ResultActionCode is shared between challenge and method URL
|
|
97
102
|
description: string;
|
|
98
103
|
transactionId?: string;
|
|
@@ -105,8 +110,9 @@ Possible `ResultActionCode` values are: `SUCCESS`, `FAILURE`, `ERROR`, `CANCELLE
|
|
|
105
110
|
### getBrowserData()
|
|
106
111
|
|
|
107
112
|
- `getBrowserData()` returns an object with the following interface:
|
|
113
|
+
|
|
108
114
|
```ts
|
|
109
|
-
interface
|
|
115
|
+
interface IBrowserDataInterface {
|
|
110
116
|
browserJavaEnabled: boolean;
|
|
111
117
|
browserJavascriptEnabled: boolean;
|
|
112
118
|
browserLanguage: string;
|
|
@@ -124,9 +130,9 @@ interface BrowserDataInterface {
|
|
|
124
130
|
|
|
125
131
|
```ts
|
|
126
132
|
export enum CardType {
|
|
127
|
-
MASTER_CARD =
|
|
128
|
-
VISA =
|
|
129
|
-
}
|
|
133
|
+
MASTER_CARD = "MASTERCARD",
|
|
134
|
+
VISA = "VISA",
|
|
135
|
+
}
|
|
130
136
|
```
|
|
131
137
|
|
|
132
138
|
### hideProcessingScreen()
|
package/dist/index.d.ts
CHANGED
|
@@ -9,23 +9,23 @@ export declare enum ResultActionCode {
|
|
|
9
9
|
COMPLETED = "COMPLETED",
|
|
10
10
|
UNCOMPLETED = "UNCOMPLETED"
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
12
|
+
export interface IMethodURLResultInterface {
|
|
13
13
|
status: ResultActionCode;
|
|
14
14
|
description: string;
|
|
15
15
|
transactionId: string;
|
|
16
16
|
}
|
|
17
|
-
export interface
|
|
17
|
+
export interface IChallengeResultDataInterface {
|
|
18
18
|
cres?: string;
|
|
19
19
|
MD?: string;
|
|
20
20
|
PaRes?: string;
|
|
21
21
|
}
|
|
22
|
-
export interface
|
|
22
|
+
export interface IChallengeResultInterface {
|
|
23
23
|
status: ResultActionCode;
|
|
24
24
|
description: string;
|
|
25
25
|
transactionId?: string;
|
|
26
|
-
data?:
|
|
26
|
+
data?: IChallengeResultDataInterface;
|
|
27
27
|
}
|
|
28
|
-
export interface
|
|
28
|
+
export interface IBrowserDataInterface {
|
|
29
29
|
browserJavaEnabled?: boolean;
|
|
30
30
|
browserJavascriptEnabled?: boolean;
|
|
31
31
|
browserLanguage?: string;
|
|
@@ -37,7 +37,7 @@ export interface BrowserDataInterface {
|
|
|
37
37
|
browserAcceptHeader?: string;
|
|
38
38
|
browserIP?: string;
|
|
39
39
|
}
|
|
40
|
-
export interface
|
|
40
|
+
export interface IRequiredBrowserDataInterface {
|
|
41
41
|
isRequiredBrowserJavaEnabled?: boolean;
|
|
42
42
|
isRequiredBrowserJavascriptEnabled?: boolean;
|
|
43
43
|
isRequiredBrowserLanguage?: boolean;
|
|
@@ -61,7 +61,7 @@ export declare enum ChallengeDisplayMode {
|
|
|
61
61
|
POPUP = "POPUP",
|
|
62
62
|
INLINE = "INLINE"
|
|
63
63
|
}
|
|
64
|
-
export interface
|
|
64
|
+
export interface IConfigInterface {
|
|
65
65
|
challengeDisplayMode?: ChallengeDisplayMode;
|
|
66
66
|
challengeDisplayInlineTargetElementId?: string;
|
|
67
67
|
translations?: Record<string, string>;
|
|
@@ -84,7 +84,7 @@ export declare const enum CardType {
|
|
|
84
84
|
}
|
|
85
85
|
export declare class ThreeDSecureVersion {
|
|
86
86
|
static get V2(): ThreeDSecureVersion;
|
|
87
|
-
private static readonly
|
|
87
|
+
private static readonly versionNumberPattern;
|
|
88
88
|
private major;
|
|
89
89
|
private minor;
|
|
90
90
|
private patch;
|
|
@@ -97,27 +97,27 @@ export declare class ThreeDSecureVersion {
|
|
|
97
97
|
toString(): string;
|
|
98
98
|
}
|
|
99
99
|
declare enum LogType {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
ERROR = "error",
|
|
101
|
+
WARNING = "warning",
|
|
102
|
+
DEBUG = "debug"
|
|
103
103
|
}
|
|
104
|
-
export interface
|
|
104
|
+
export interface ILogInterface {
|
|
105
105
|
type: LogType;
|
|
106
106
|
message: string;
|
|
107
107
|
time: Date;
|
|
108
108
|
}
|
|
109
|
-
export interface
|
|
110
|
-
readonly logs$: Observable<
|
|
111
|
-
init$(config:
|
|
112
|
-
run3DSMethod$(transactionId: string, notificationURL: string, methodURL: string): Observable<
|
|
113
|
-
doChallenge$(version: ThreeDSecureVersion, threedpayload: string, challengeURL: string, cardType: CardType, termURL?: string, merchantData?: string): Observable<
|
|
114
|
-
getBrowserData$(browserDataUrls: string[], requiredData?:
|
|
109
|
+
export interface IThreeDSecureInterface {
|
|
110
|
+
readonly logs$: Observable<ILogInterface>;
|
|
111
|
+
init$(config: IConfigInterface): Observable<IConfigInterface | never>;
|
|
112
|
+
run3DSMethod$(transactionId: string, notificationURL: string, methodURL: string): Observable<IMethodURLResultInterface | never>;
|
|
113
|
+
doChallenge$(version: ThreeDSecureVersion, threedpayload: string, challengeURL: string, cardType: CardType, termURL?: string, merchantData?: string): Observable<IChallengeResultInterface | never>;
|
|
114
|
+
getBrowserData$(browserDataUrls: string[], requiredData?: IRequiredBrowserDataInterface): Observable<IBrowserDataInterface>;
|
|
115
115
|
showProcessingScreen(cardType: CardType, duration: number): void;
|
|
116
116
|
hideProcessingScreen(): void;
|
|
117
|
-
cancelChallenge$(): Observable<
|
|
117
|
+
cancelChallenge$(): Observable<IChallengeResultInterface>;
|
|
118
118
|
}
|
|
119
119
|
export declare class ThreeDSecureFactory {
|
|
120
|
-
create(containerToken?: string):
|
|
120
|
+
create(containerToken?: string): IThreeDSecureInterface;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
export {};
|