@fat-zebra/sdk 1.4.8 → 1.4.10
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/.jest/setup-env-vars.js +1 -1
- package/dist/local/fatzebra.js.map +1 -1
- package/dist/main.js +1 -0
- package/dist/react/index.d.ts +1 -2
- package/dist/react/index.js +1 -2
- package/dist/react/url.js +3 -3
- package/dist/sca/index.d.ts +1 -1
- package/dist/sca/index.js +7 -5
- package/dist/shared/api-gateway-client.js +6 -1
- package/dist/shared/types.d.ts +1 -2
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -24,6 +24,7 @@ export default class FatZebra {
|
|
|
24
24
|
this.gatewayClient = new GatewayClient({
|
|
25
25
|
accessToken: window.localStorage.getItem(LocalStorageAccessTokenKey),
|
|
26
26
|
username: config.username,
|
|
27
|
+
environment: process.env.API_ENV,
|
|
27
28
|
});
|
|
28
29
|
this.sca = new Sca({
|
|
29
30
|
gatewayClient: this.gatewayClient,
|
package/dist/react/index.d.ts
CHANGED
package/dist/react/index.js
CHANGED
package/dist/react/url.js
CHANGED
|
@@ -8,7 +8,9 @@ const generatePaymentURL = (values, environment) => {
|
|
|
8
8
|
"iframe",
|
|
9
9
|
"postmessage",
|
|
10
10
|
"hide_card_holder",
|
|
11
|
-
"
|
|
11
|
+
"return_path",
|
|
12
|
+
"card_types",
|
|
13
|
+
"surcharge_enabled",
|
|
12
14
|
"sca_enabled",
|
|
13
15
|
];
|
|
14
16
|
const environmentConfig = env[environment || Environment.sandbox];
|
|
@@ -25,8 +27,6 @@ const generatePaymentURL = (values, environment) => {
|
|
|
25
27
|
iframe: true,
|
|
26
28
|
postmessage: true,
|
|
27
29
|
tokenize_only: values.tokenize_only,
|
|
28
|
-
hide_card_holder: values.hide_card_holder,
|
|
29
|
-
hide_button: values.hide_button,
|
|
30
30
|
});
|
|
31
31
|
return url;
|
|
32
32
|
};
|
package/dist/sca/index.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ declare class Sca {
|
|
|
33
33
|
loadScript(): void;
|
|
34
34
|
get cardinal(): CardinalManager;
|
|
35
35
|
set cardinal(cardinal: CardinalManager);
|
|
36
|
-
reportFailure(message: string): void;
|
|
36
|
+
reportFailure(message: string, data?: any): void;
|
|
37
37
|
reportSuccess(message: string, data: any): void;
|
|
38
38
|
run(config: ScaRunProps): Promise<void>;
|
|
39
39
|
createCardinalJWT(): Promise<string>;
|
package/dist/sca/index.js
CHANGED
|
@@ -40,13 +40,13 @@ class Sca {
|
|
|
40
40
|
set cardinal(cardinal) {
|
|
41
41
|
this._cardinal = cardinal;
|
|
42
42
|
}
|
|
43
|
-
reportFailure(message) {
|
|
43
|
+
reportFailure(message, data) {
|
|
44
44
|
if (this.failureCallback) {
|
|
45
|
-
const event = new CustomEvent(PublicEvent.SCA_ERROR, { detail: { errors: [message] } });
|
|
45
|
+
const event = new CustomEvent(PublicEvent.SCA_ERROR, { detail: { errors: [message], data: data } });
|
|
46
46
|
this.failureCallback(event);
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
|
-
emit(PublicEvent.SCA_ERROR, { errors: [message], data:
|
|
49
|
+
emit(PublicEvent.SCA_ERROR, { errors: [message], data: data });
|
|
50
50
|
}
|
|
51
51
|
console.log(message);
|
|
52
52
|
}
|
|
@@ -116,7 +116,9 @@ class Sca {
|
|
|
116
116
|
this.reportSuccess(`FatZebra.3DS: 3DS success - ${scenario.description}.`, threedsData);
|
|
117
117
|
}
|
|
118
118
|
else {
|
|
119
|
-
this.reportFailure(`FatZebra.3DS: 3DS error - ${scenario.description} - ${scenario.outcome.errorCode}
|
|
119
|
+
this.reportFailure(`FatZebra.3DS: 3DS error - ${scenario.description} - ${scenario.outcome.errorCode}`, {
|
|
120
|
+
errorCode: scenario.outcome.errorCode,
|
|
121
|
+
});
|
|
120
122
|
}
|
|
121
123
|
}));
|
|
122
124
|
}
|
|
@@ -198,7 +200,7 @@ class Sca {
|
|
|
198
200
|
this.reportSuccess(`FatZebra.3DS: 3DS success - ${scenario.description}.`, threedsData);
|
|
199
201
|
}
|
|
200
202
|
else {
|
|
201
|
-
this.reportFailure(`FatZebra.3DS: 3DS error - ${scenario.description} - ${scenario.outcome.errorCode}
|
|
203
|
+
this.reportFailure(`FatZebra.3DS: 3DS error - ${scenario.description} - ${scenario.outcome.errorCode}`, { errorCode: scenario.outcome.errorCode });
|
|
202
204
|
}
|
|
203
205
|
}
|
|
204
206
|
}
|
|
@@ -45,7 +45,12 @@ class GatewayClient {
|
|
|
45
45
|
}
|
|
46
46
|
enrolSCA(data) {
|
|
47
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
return this.client.post("/sca/enrollment", data)
|
|
48
|
+
return this.client.post("/sca/enrollment", data).then((response) => response).catch(err => {
|
|
49
|
+
if (err.response && err.response.status == 422) {
|
|
50
|
+
return err.response;
|
|
51
|
+
}
|
|
52
|
+
throw err;
|
|
53
|
+
});
|
|
49
54
|
});
|
|
50
55
|
}
|
|
51
56
|
validateSCA(data) {
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -97,8 +97,7 @@ export type PaymentConfig = {
|
|
|
97
97
|
options: OptionalUrlValues;
|
|
98
98
|
};
|
|
99
99
|
export type OptionalUrlValues = {
|
|
100
|
-
hide_card_holder?:
|
|
101
|
-
hide_button?: boolean;
|
|
100
|
+
hide_card_holder?: string;
|
|
102
101
|
return_path?: string;
|
|
103
102
|
card_types?: Array<string>;
|
|
104
103
|
surcharge_enabled?: string;
|