@fat-zebra/sdk 2.0.1 → 2.0.2-beta.1
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/dist/logging/instrument.d.ts +1 -0
- package/dist/logging/instrument.js +1 -1
- package/dist/logging/logMethod.js +5 -2
- package/dist/main.js +9 -1
- package/dist/react/useMessage.js +1 -1
- package/dist/sca/index.js +3 -3
- package/dist/three_d_secure/index.d.ts +10 -9
- package/dist/three_d_secure/index.js +15 -2
- package/dist/three_d_secure/utility/index.js +2 -1
- package/package.json +1 -1
|
@@ -17,7 +17,6 @@ function sendLog(endpoint, payload) {
|
|
|
17
17
|
void axios.post(endpoint, payload);
|
|
18
18
|
}
|
|
19
19
|
else {
|
|
20
|
-
// fallback for non-browser or older environments
|
|
21
20
|
void axios.post(endpoint, payload);
|
|
22
21
|
}
|
|
23
22
|
}
|
|
@@ -38,6 +37,7 @@ export function instrumentFunction(methodName, fn, opts = {}) {
|
|
|
38
37
|
const payload = {
|
|
39
38
|
username: getLoggerUsername(),
|
|
40
39
|
reference: getTransactionReference(),
|
|
40
|
+
className: opts.className,
|
|
41
41
|
method: methodName,
|
|
42
42
|
arguments: mapArgs(args),
|
|
43
43
|
timestamp: new Date().toISOString(),
|
|
@@ -31,13 +31,16 @@ import { instrumentFunction } from "./instrument";
|
|
|
31
31
|
// Decorator factory
|
|
32
32
|
export function logMethod(opts = {}) {
|
|
33
33
|
return function (target, propertyKey, descriptor) {
|
|
34
|
-
var _a;
|
|
34
|
+
var _a, _b;
|
|
35
35
|
const original = descriptor.value;
|
|
36
36
|
if (typeof original !== "function") {
|
|
37
37
|
console.error(`@logMethod can only decorate methods (${propertyKey})`);
|
|
38
38
|
return descriptor;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
const className = typeof target === "function"
|
|
41
|
+
? target.name || "UnknownClass"
|
|
42
|
+
: ((_a = target === null || target === void 0 ? void 0 : target.constructor) === null || _a === void 0 ? void 0 : _a.name) || "UnknownClass";
|
|
43
|
+
descriptor.value = instrumentFunction(propertyKey, original, Object.assign(Object.assign({}, opts), { className, mapArgs: (_b = opts.mapArgs) !== null && _b !== void 0 ? _b : ((args) => args.map((a) => {
|
|
41
44
|
if (!a || typeof a !== "object")
|
|
42
45
|
return a;
|
|
43
46
|
return Object.assign(Object.assign({}, a), { js_sdk: true });
|
package/dist/main.js
CHANGED
|
@@ -341,6 +341,7 @@ __decorate([
|
|
|
341
341
|
merchant_username: window.MerchantUsername,
|
|
342
342
|
payment_intent: params === null || params === void 0 ? void 0 : params.paymentIntent,
|
|
343
343
|
payment_method: (_a = params === null || params === void 0 ? void 0 : params.paymentMethod) === null || _a === void 0 ? void 0 : _a.type,
|
|
344
|
+
options: params === null || params === void 0 ? void 0 : params.options,
|
|
344
345
|
},
|
|
345
346
|
];
|
|
346
347
|
},
|
|
@@ -353,12 +354,16 @@ __decorate([
|
|
|
353
354
|
return [
|
|
354
355
|
{
|
|
355
356
|
payment_intent: params.paymentIntent,
|
|
356
|
-
version: params.version
|
|
357
|
+
version: params.version,
|
|
358
|
+
options: params.options
|
|
357
359
|
},
|
|
358
360
|
];
|
|
359
361
|
},
|
|
360
362
|
})
|
|
361
363
|
], FatZebra.prototype, "renderPaymentsPage", null);
|
|
364
|
+
__decorate([
|
|
365
|
+
logMethod()
|
|
366
|
+
], FatZebra.prototype, "renderClickToPay", null);
|
|
362
367
|
__decorate([
|
|
363
368
|
logMethod({
|
|
364
369
|
mapArgs: (args) => {
|
|
@@ -382,4 +387,7 @@ __decorate([
|
|
|
382
387
|
},
|
|
383
388
|
})
|
|
384
389
|
], FatZebra.prototype, "reportRequestThreedsEnabledTimeout", null);
|
|
390
|
+
__decorate([
|
|
391
|
+
logMethod()
|
|
392
|
+
], FatZebra.prototype, "checkout", null);
|
|
385
393
|
export { FatZebra, };
|
package/dist/react/useMessage.js
CHANGED
|
@@ -46,7 +46,7 @@ const useMessage = ({ paymentIntent, options, handlers, sca, config }) => {
|
|
|
46
46
|
cardToken: data.token,
|
|
47
47
|
merchantUsername: config.username,
|
|
48
48
|
test: config.environment !== Environment.production,
|
|
49
|
-
tokenizeOnly:
|
|
49
|
+
tokenizeOnly: true,
|
|
50
50
|
iframe: iframe
|
|
51
51
|
});
|
|
52
52
|
return;
|
package/dist/sca/index.js
CHANGED
|
@@ -236,7 +236,6 @@ __decorate([
|
|
|
236
236
|
{
|
|
237
237
|
message: args[0],
|
|
238
238
|
data: args[1],
|
|
239
|
-
source: 'sca'
|
|
240
239
|
},
|
|
241
240
|
];
|
|
242
241
|
},
|
|
@@ -249,7 +248,6 @@ __decorate([
|
|
|
249
248
|
{
|
|
250
249
|
message: args[0],
|
|
251
250
|
data: args[1],
|
|
252
|
-
source: 'sca'
|
|
253
251
|
},
|
|
254
252
|
];
|
|
255
253
|
},
|
|
@@ -262,7 +260,9 @@ __decorate([
|
|
|
262
260
|
return [
|
|
263
261
|
{
|
|
264
262
|
source: params.source,
|
|
265
|
-
payment_intent: params.paymentIntent
|
|
263
|
+
payment_intent: params.paymentIntent,
|
|
264
|
+
card_token: params.cardToken,
|
|
265
|
+
challenge_window_size: params.challengeWindowSize,
|
|
266
266
|
},
|
|
267
267
|
];
|
|
268
268
|
},
|
|
@@ -9,6 +9,15 @@ interface ThreeDSecureConfig {
|
|
|
9
9
|
bridge: HTMLIFrameElement;
|
|
10
10
|
iframe?: HTMLIFrameElement;
|
|
11
11
|
}
|
|
12
|
+
interface ThreeDSecureRunProps {
|
|
13
|
+
paymentIntent: PaymentIntent;
|
|
14
|
+
cardToken: string;
|
|
15
|
+
merchantUsername: string;
|
|
16
|
+
challengeWindowSize?: ChallengeWindowSize;
|
|
17
|
+
tokenizeOnly?: boolean;
|
|
18
|
+
iframe?: HTMLIFrameElement;
|
|
19
|
+
test: boolean;
|
|
20
|
+
}
|
|
12
21
|
declare class ThreeDSecure {
|
|
13
22
|
private headlessBridge;
|
|
14
23
|
private cybersourceReferenceId;
|
|
@@ -23,15 +32,7 @@ declare class ThreeDSecure {
|
|
|
23
32
|
private tokenizeOnly;
|
|
24
33
|
private iframe?;
|
|
25
34
|
constructor({ successCallback, failureCallback, environment, bridge }: ThreeDSecureConfig);
|
|
26
|
-
run({ paymentIntent, cardToken, merchantUsername, challengeWindowSize, test, tokenizeOnly, iframe }:
|
|
27
|
-
paymentIntent: PaymentIntent;
|
|
28
|
-
cardToken: string;
|
|
29
|
-
merchantUsername: string;
|
|
30
|
-
challengeWindowSize?: ChallengeWindowSize;
|
|
31
|
-
test: boolean;
|
|
32
|
-
tokenizeOnly?: boolean;
|
|
33
|
-
iframe?: HTMLIFrameElement;
|
|
34
|
-
}): void;
|
|
35
|
+
run({ paymentIntent, cardToken, merchantUsername, challengeWindowSize, test, tokenizeOnly, iframe }: ThreeDSecureRunProps): void;
|
|
35
36
|
setupResponse(data: DeviceDataCollectionMessage): void;
|
|
36
37
|
messageHandlers(): {
|
|
37
38
|
[key: string]: (data: any) => void;
|
|
@@ -197,6 +197,21 @@ class ThreeDSecure {
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
+
__decorate([
|
|
201
|
+
logMethod({
|
|
202
|
+
mapArgs: (args) => {
|
|
203
|
+
const params = args[0];
|
|
204
|
+
return [
|
|
205
|
+
{
|
|
206
|
+
payment_intent: params.paymentIntent,
|
|
207
|
+
card_token: params.cardToken,
|
|
208
|
+
challenge_window_size: params.challengeWindowSize,
|
|
209
|
+
tokenize_only: params.tokenizeOnly,
|
|
210
|
+
},
|
|
211
|
+
];
|
|
212
|
+
},
|
|
213
|
+
})
|
|
214
|
+
], ThreeDSecure.prototype, "run", null);
|
|
200
215
|
__decorate([
|
|
201
216
|
logMethod({
|
|
202
217
|
mapArgs: (args) => {
|
|
@@ -204,7 +219,6 @@ __decorate([
|
|
|
204
219
|
{
|
|
205
220
|
message: args[0],
|
|
206
221
|
data: args[1],
|
|
207
|
-
source: 'three_d_secure'
|
|
208
222
|
},
|
|
209
223
|
];
|
|
210
224
|
},
|
|
@@ -217,7 +231,6 @@ __decorate([
|
|
|
217
231
|
{
|
|
218
232
|
message: args[0],
|
|
219
233
|
data: args[1],
|
|
220
|
-
source: 'three_d_secure'
|
|
221
234
|
},
|
|
222
235
|
];
|
|
223
236
|
},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { toFzSli } from "../../sca/eci-mappings";
|
|
2
2
|
const threeDResponseData = (response) => {
|
|
3
|
+
var _a;
|
|
3
4
|
return {
|
|
4
5
|
// CAVV: Visa & Amex only
|
|
5
6
|
// AAV: Mastercard only, known as UCAF
|
|
@@ -8,7 +9,7 @@ const threeDResponseData = (response) => {
|
|
|
8
9
|
sli: toFzSli(response.eci),
|
|
9
10
|
eci: response.eci,
|
|
10
11
|
xid: response.xid,
|
|
11
|
-
ver: response === null || response === void 0 ? void 0 : response.veres,
|
|
12
|
+
ver: (_a = response === null || response === void 0 ? void 0 : response.veres) !== null && _a !== void 0 ? _a : null,
|
|
12
13
|
directoryServerTxnId: response.directory_server_txn_id,
|
|
13
14
|
threedsVersion: response.threeds_version,
|
|
14
15
|
};
|