@fat-zebra/sdk 1.5.6 → 1.5.7-beta.0
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/.idea/fatzebra-js.iml +12 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/dist/applepay/applepaymanager.d.ts +28 -0
- package/dist/applepay/applepaymanager.js +115 -0
- package/dist/click_to_pay/index.js +5 -3
- package/dist/hpp/hpp.d.ts +4 -0
- package/dist/hpp/hpp.js +26 -6
- package/dist/local/fatzebra.js +19684 -0
- package/dist/local/fatzebra.js.map +1 -1
- package/dist/main.js +3 -3
- package/dist/production/fatzebra.css +91 -0
- package/dist/production/fatzebra.js +2 -0
- package/dist/react/ApplePay.d.ts +9 -0
- package/dist/react/ApplePay.js +11 -0
- package/dist/react/{url.d.ts → applePayUrl.d.ts} +2 -2
- package/dist/react/applePayUrl.js +19 -0
- package/dist/sandbox/fatzebra.js +1 -1
- package/dist/sandbox/fatzebra.js.LICENSE.txt +1 -1
- package/dist/sca/cardinal.d.ts +2 -11
- package/dist/sca/cardinal.js +4 -10
- package/dist/sca/index.d.ts +11 -1
- package/dist/sca/index.js +3 -40
- package/dist/sca/scenarios/enrollment.js +14 -2
- package/dist/sca/scenarios/validation.js +3 -3
- package/dist/sca/types/cardinal_types.d.ts +61 -0
- package/dist/sca/types/cardinal_types.js +11 -0
- package/dist/sca/types.d.ts +2 -1
- package/dist/sca/types.js +1 -0
- package/dist/sca/utility/index.d.ts +7 -0
- package/dist/sca/utility/index.js +39 -0
- package/dist/shared/bridge-client.d.ts +5 -1
- package/dist/shared/bridge-client.js +19 -1
- package/dist/shared/envs/local.d.ts +1 -1
- package/dist/shared/envs/local.js +1 -1
- package/dist/shared/types.d.ts +5 -15
- package/dist/shared/types.js +2 -2
- package/dist/src/applepay/applepaymanager.js +279 -0
- package/dist/src/applepay/applepaymanager.js.map +1 -0
- package/dist/src/react/ApplePayButton.js +56 -0
- package/dist/src/react/ApplePayButton.js.map +1 -0
- package/dist/src/react/{url.js → applePayUrl.js} +7 -21
- package/dist/src/react/applePayUrl.js.map +1 -0
- package/dist/src/react/applePayUrl.test.js +57 -0
- package/dist/src/react/applePayUrl.test.js.map +1 -0
- package/dist/src/react/useFatZebra.js +7 -56
- package/dist/src/react/useFatZebra.js.map +1 -1
- package/dist/src/react/useMessage.js +140 -0
- package/dist/src/react/useMessage.js.map +1 -0
- package/dist/src/react/useMessage.test.js +222 -0
- package/dist/src/react/useMessage.test.js.map +1 -0
- package/dist/src/validation/validators/apple-pay-load-params-button-validator.js +19 -0
- package/dist/src/validation/validators/apple-pay-load-params-button-validator.js.map +1 -0
- package/dist/staging/fatzebra.css +91 -0
- package/dist/staging/fatzebra.js +19684 -0
- package/dist/staging/fatzebra.js.map +1 -0
- package/dist/staging/index.html +247 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/tsconfig.json +1 -1
- package/dist/paypal/paypal-button.d.ts +0 -31
- package/dist/paypal/paypal-button.js +0 -199
- package/dist/paypal/paypal-checkout.d.ts +0 -21
- package/dist/paypal/paypal-checkout.js +0 -100
- package/dist/paypal/types.d.ts +0 -188
- package/dist/paypal/types.js +0 -5
- package/dist/paypal/validation.d.ts +0 -4
- package/dist/paypal/validation.js +0 -65
- package/dist/react/url.js +0 -33
- package/dist/src/paypal/paypal-button.js +0 -311
- package/dist/src/paypal/paypal-button.js.map +0 -1
- package/dist/src/paypal/paypal-button.test.js +0 -41
- package/dist/src/paypal/paypal-button.test.js.map +0 -1
- package/dist/src/paypal/paypal-checkout.js +0 -111
- package/dist/src/paypal/paypal-checkout.js.map +0 -1
- package/dist/src/paypal/paypal-checkout.test.js +0 -167
- package/dist/src/paypal/paypal-checkout.test.js.map +0 -1
- package/dist/src/paypal/types.js +0 -9
- package/dist/src/paypal/types.js.map +0 -1
- package/dist/src/paypal/validation.js +0 -73
- package/dist/src/paypal/validation.js.map +0 -1
- package/dist/src/react/url.js.map +0 -1
- package/dist/src/react/url.test.js +0 -88
- package/dist/src/react/url.test.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
/** @license URI.js v4.
|
|
1
|
+
/** @license URI.js v4.2.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
|
package/dist/sca/cardinal.d.ts
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
sessionId: string;
|
|
3
|
-
modules: {
|
|
4
|
-
module: string;
|
|
5
|
-
loaded: boolean;
|
|
6
|
-
}[];
|
|
7
|
-
}
|
|
8
|
-
interface PaymentValidatedDTO {
|
|
9
|
-
processorTransactionId: string;
|
|
10
|
-
jwt: string;
|
|
11
|
-
}
|
|
1
|
+
import { CardinalSetupCompleteResponseData, PaymentValidatedDTO } from "./types/cardinal_types";
|
|
12
2
|
export declare const defaultConfig: {
|
|
13
3
|
timeout: number;
|
|
14
4
|
maxRequestRetries: number;
|
|
@@ -24,6 +14,7 @@ export default class CardinalManager {
|
|
|
24
14
|
onPaymentValidated(handler: (data: PaymentValidatedDTO, error: string) => void): void;
|
|
25
15
|
onPaymentSetupComplete(callback: (data: CardinalSetupCompleteResponseData) => void): void;
|
|
26
16
|
processBin(bin: string): Promise<any>;
|
|
17
|
+
trigger(event: string, bin: string): Promise<void>;
|
|
27
18
|
continue(acsUrl: string, pareq: string, transactionId: string): void;
|
|
28
19
|
}
|
|
29
20
|
export { CardinalManager, };
|
package/dist/sca/cardinal.js
CHANGED
|
@@ -7,16 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
(function (CardinalWorkflow) {
|
|
12
|
-
CardinalWorkflow["CCA"] = "cca";
|
|
13
|
-
CardinalWorkflow["INIT"] = "init";
|
|
14
|
-
})(CardinalWorkflow || (CardinalWorkflow = {}));
|
|
15
|
-
var CardinalPaymentEvent;
|
|
16
|
-
(function (CardinalPaymentEvent) {
|
|
17
|
-
CardinalPaymentEvent["SETUP_COMPLETE"] = "payments.setupComplete";
|
|
18
|
-
CardinalPaymentEvent["VALIDATED"] = "payments.validated";
|
|
19
|
-
})(CardinalPaymentEvent || (CardinalPaymentEvent = {}));
|
|
10
|
+
import { CardinalPaymentEvent, CardinalWorkflow } from "./types/cardinal_types";
|
|
20
11
|
export const defaultConfig = {
|
|
21
12
|
timeout: 8000,
|
|
22
13
|
maxRequestRetries: 3,
|
|
@@ -77,6 +68,9 @@ export default class CardinalManager {
|
|
|
77
68
|
yield window.Cardinal.trigger('bin.process', bin);
|
|
78
69
|
});
|
|
79
70
|
}
|
|
71
|
+
trigger(event, bin) {
|
|
72
|
+
return window.Cardinal.trigger('bin.process', bin);
|
|
73
|
+
}
|
|
80
74
|
continue(acsUrl, pareq, transactionId) {
|
|
81
75
|
window.Cardinal.continue(CardinalWorkflow.CCA, {
|
|
82
76
|
AcsUrl: acsUrl,
|
package/dist/sca/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as t from './types';
|
|
2
|
-
import { EventCallback, Customer,
|
|
2
|
+
import { EventCallback, Customer, PaymentIntent } from '../shared/types';
|
|
3
3
|
import { CardinalManager } from './cardinal';
|
|
4
4
|
import GatewayClient from '../shared/api-gateway-client';
|
|
5
5
|
import { Environment } from "../shared/env";
|
|
@@ -10,6 +10,16 @@ export interface ScaRunProps {
|
|
|
10
10
|
bin: string;
|
|
11
11
|
challengeWindowSize?: t.ChallengeWindowSize;
|
|
12
12
|
}
|
|
13
|
+
interface CustomerSnakeCase {
|
|
14
|
+
first_name?: string;
|
|
15
|
+
last_name?: string;
|
|
16
|
+
email?: string;
|
|
17
|
+
address?: string;
|
|
18
|
+
city?: string;
|
|
19
|
+
state?: string;
|
|
20
|
+
postcode?: string;
|
|
21
|
+
country?: string;
|
|
22
|
+
}
|
|
13
23
|
export interface ScaConfig {
|
|
14
24
|
gatewayClient: GatewayClient;
|
|
15
25
|
successCallback?: EventCallback | null;
|
package/dist/sca/index.js
CHANGED
|
@@ -8,14 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import * as t from './types';
|
|
11
|
-
import { enrollmentScenarios, validationScenarios, } from './scenarios';
|
|
12
11
|
import { PublicEvent, } from '../shared/types';
|
|
13
12
|
import { CardinalManager, } from './cardinal';
|
|
14
13
|
import { emit, } from '../shared/event-manager';
|
|
15
|
-
import { toFzSli } from './eci-mappings';
|
|
16
14
|
import env, { Environment } from "../shared/env";
|
|
17
|
-
import {
|
|
18
|
-
import { failedValidationRequestScenario } from './scenarios/validation';
|
|
15
|
+
import { getEnrollmentResult, getValidationResult, threedsResponseData } from "./utility";
|
|
19
16
|
class Sca {
|
|
20
17
|
constructor({ gatewayClient, successCallback, failureCallback }) {
|
|
21
18
|
this.gatewayClient = gatewayClient;
|
|
@@ -93,8 +90,8 @@ class Sca {
|
|
|
93
90
|
this._cardinal.setup(cardinalJwt);
|
|
94
91
|
});
|
|
95
92
|
}
|
|
96
|
-
perform3DS(
|
|
97
|
-
return __awaiter(this,
|
|
93
|
+
perform3DS({ sessionID }) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
95
|
this.sessionId = sessionID;
|
|
99
96
|
// Register handler. Called after OTP is entered on challenge prompt.
|
|
100
97
|
this._cardinal.onPaymentValidated((data, error) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -223,38 +220,4 @@ class Sca {
|
|
|
223
220
|
}
|
|
224
221
|
}
|
|
225
222
|
}
|
|
226
|
-
const threedsResponseData = (response) => {
|
|
227
|
-
return {
|
|
228
|
-
// CAVV: Visa & Amex only
|
|
229
|
-
// AAV: Mastercard only, known as UCAF
|
|
230
|
-
cavv: response.cavv || response.aav,
|
|
231
|
-
par: response.pares,
|
|
232
|
-
sli: toFzSli(response.eci),
|
|
233
|
-
xid: response.xid,
|
|
234
|
-
ver: response.enrolled,
|
|
235
|
-
directoryServerTxnId: response.directory_server_txn_id,
|
|
236
|
-
threedsVersion: response.version,
|
|
237
|
-
};
|
|
238
|
-
};
|
|
239
|
-
const getEnrollmentResult = (enrollment) => {
|
|
240
|
-
const result = enrollmentScenarios.find((item) => {
|
|
241
|
-
return item.reasonCode === enrollment.reason_code &&
|
|
242
|
-
item.veresEnrolled === enrollment.enrolled &&
|
|
243
|
-
item.pares === enrollment.pares &&
|
|
244
|
-
item.threedsVersion === getMajor3dsVersion(enrollment.version);
|
|
245
|
-
});
|
|
246
|
-
return result || failedEnrollmentRequestScenario;
|
|
247
|
-
};
|
|
248
|
-
const getValidationResult = (validation) => {
|
|
249
|
-
const result = validationScenarios.find((item) => {
|
|
250
|
-
return item.reasonCode === validation.reason_code &&
|
|
251
|
-
item.pares === validation.pares &&
|
|
252
|
-
item.threedsVersion === getMajor3dsVersion(validation.version);
|
|
253
|
-
});
|
|
254
|
-
return result || failedValidationRequestScenario;
|
|
255
|
-
};
|
|
256
|
-
// 3DS versioning follows SEMVER format. The first charactor is the major version number.
|
|
257
|
-
const getMajor3dsVersion = (original) => {
|
|
258
|
-
return original === null || original === void 0 ? void 0 : original[0];
|
|
259
|
-
};
|
|
260
223
|
export default Sca;
|
|
@@ -21,7 +21,7 @@ const enrollmentScenarios = [
|
|
|
21
21
|
veresEnrolled: VEResEnrolled.BYPASSED,
|
|
22
22
|
pares: null,
|
|
23
23
|
outcome: {
|
|
24
|
-
success: false,
|
|
24
|
+
success: false,
|
|
25
25
|
authenticationType: 'bypass',
|
|
26
26
|
errorCode: ScaErrorCode.BYPASSED_AUTHENTICATION
|
|
27
27
|
},
|
|
@@ -34,7 +34,7 @@ const enrollmentScenarios = [
|
|
|
34
34
|
veresEnrolled: VEResEnrolled.UNABLE,
|
|
35
35
|
pares: null,
|
|
36
36
|
outcome: {
|
|
37
|
-
success: false,
|
|
37
|
+
success: false,
|
|
38
38
|
errorCode: ScaErrorCode.AUTHENTICATION_NOT_AVAILABLE_ON_LOOKUP
|
|
39
39
|
}
|
|
40
40
|
},
|
|
@@ -87,6 +87,18 @@ const enrollmentScenarios = [
|
|
|
87
87
|
success: true
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
|
+
{
|
|
91
|
+
// Challenge. Continue with OTP prompt
|
|
92
|
+
description: 'Challenge. Continue with OTP prompt',
|
|
93
|
+
threedsVersion: '2',
|
|
94
|
+
reasonCode: '475',
|
|
95
|
+
veresEnrolled: VEResEnrolled.ENROLLED,
|
|
96
|
+
pares: PARes.CHALLENGED,
|
|
97
|
+
outcome: {
|
|
98
|
+
authenticationType: 'challenge',
|
|
99
|
+
success: true
|
|
100
|
+
}
|
|
101
|
+
},
|
|
90
102
|
{
|
|
91
103
|
// Unsuccessful Frictionless Authentication
|
|
92
104
|
description: 'Unsuccessful Frictionless Authentication',
|
|
@@ -34,7 +34,7 @@ const validationScenarios = [
|
|
|
34
34
|
pares: PARes.CANCELED,
|
|
35
35
|
outcome: {
|
|
36
36
|
authenticationType: 'challenge',
|
|
37
|
-
success: false,
|
|
37
|
+
success: false,
|
|
38
38
|
errorCode: ScaErrorCode.UNSUCCESSFUL_STEPUP_AUTHENTICATION
|
|
39
39
|
}
|
|
40
40
|
},
|
|
@@ -47,7 +47,7 @@ const validationScenarios = [
|
|
|
47
47
|
pares: PARes.NOT_COMPLETED,
|
|
48
48
|
outcome: {
|
|
49
49
|
authenticationType: 'challenge',
|
|
50
|
-
success: false,
|
|
50
|
+
success: false,
|
|
51
51
|
errorCode: ScaErrorCode.UNAVAILABLE_STEPUP_AUTHENTICATION
|
|
52
52
|
}
|
|
53
53
|
},
|
|
@@ -126,7 +126,7 @@ const validationScenarios = [
|
|
|
126
126
|
pares: null,
|
|
127
127
|
outcome: {
|
|
128
128
|
authenticationType: 'challenge',
|
|
129
|
-
success: false,
|
|
129
|
+
success: false,
|
|
130
130
|
errorCode: ScaErrorCode.UNSUCCESSFUL_STEPUP_AUTHENTICATION
|
|
131
131
|
}
|
|
132
132
|
},
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
interface CardinalConfig {
|
|
2
|
+
timeout?: number;
|
|
3
|
+
maxRequestRetries?: number;
|
|
4
|
+
logging?: {
|
|
5
|
+
level: 'on' | 'off' | 'verbose';
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
interface CardinalContinueObject {
|
|
9
|
+
AcsUrl: string;
|
|
10
|
+
Payload: string;
|
|
11
|
+
}
|
|
12
|
+
interface CardinalOrderObject {
|
|
13
|
+
OrderDetails: {
|
|
14
|
+
TransactionId: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
interface CardinalSetupCompleteResponseData {
|
|
18
|
+
sessionId: string;
|
|
19
|
+
modules: {
|
|
20
|
+
module: string;
|
|
21
|
+
loaded: boolean;
|
|
22
|
+
}[];
|
|
23
|
+
}
|
|
24
|
+
interface PaymentValidatedResponseData {
|
|
25
|
+
Validated: boolean;
|
|
26
|
+
ErrorNumber: number;
|
|
27
|
+
ErrorDescription: string;
|
|
28
|
+
ActionCode: 'SUCCESS' | 'NOACTION' | 'FAILURE' | 'ERROR';
|
|
29
|
+
Payment: {
|
|
30
|
+
OrderId: string;
|
|
31
|
+
OrderNumber: string;
|
|
32
|
+
ProcessorTransactionId: string;
|
|
33
|
+
ReasonDescription: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
interface PaymentValidatedDTO {
|
|
37
|
+
processorTransactionId: string;
|
|
38
|
+
jwt: string;
|
|
39
|
+
}
|
|
40
|
+
interface Cardinal {
|
|
41
|
+
configure(config: CardinalConfig): void;
|
|
42
|
+
continue(workflow: CardinalWorkflow, data: CardinalContinueObject, order: CardinalOrderObject): void;
|
|
43
|
+
on(event: string, callback: (...data: any[]) => void): void;
|
|
44
|
+
setup(workflow: CardinalWorkflow, data: any): void;
|
|
45
|
+
trigger(event: string, cardBin: string): Promise<any>;
|
|
46
|
+
}
|
|
47
|
+
interface ScaResult {
|
|
48
|
+
success: boolean;
|
|
49
|
+
type: 'frictionless' | 'challenge' | 'none';
|
|
50
|
+
error: string;
|
|
51
|
+
}
|
|
52
|
+
declare enum CardinalWorkflow {
|
|
53
|
+
CCA = "cca",
|
|
54
|
+
INIT = "init"
|
|
55
|
+
}
|
|
56
|
+
declare enum CardinalPaymentEvent {
|
|
57
|
+
SETUP_COMPLETE = "payments.setupComplete",
|
|
58
|
+
VALIDATED = "payments.validated"
|
|
59
|
+
}
|
|
60
|
+
export { CardinalWorkflow, CardinalPaymentEvent };
|
|
61
|
+
export type { CardinalConfig, CardinalContinueObject, CardinalOrderObject, CardinalSetupCompleteResponseData, PaymentValidatedResponseData, PaymentValidatedDTO, Cardinal, ScaResult, };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var CardinalWorkflow;
|
|
2
|
+
(function (CardinalWorkflow) {
|
|
3
|
+
CardinalWorkflow["CCA"] = "cca";
|
|
4
|
+
CardinalWorkflow["INIT"] = "init";
|
|
5
|
+
})(CardinalWorkflow || (CardinalWorkflow = {}));
|
|
6
|
+
var CardinalPaymentEvent;
|
|
7
|
+
(function (CardinalPaymentEvent) {
|
|
8
|
+
CardinalPaymentEvent["SETUP_COMPLETE"] = "payments.setupComplete";
|
|
9
|
+
CardinalPaymentEvent["VALIDATED"] = "payments.validated";
|
|
10
|
+
})(CardinalPaymentEvent || (CardinalPaymentEvent = {}));
|
|
11
|
+
export { CardinalWorkflow, CardinalPaymentEvent };
|
package/dist/sca/types.d.ts
CHANGED
package/dist/sca/types.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as t from "../types";
|
|
2
|
+
import { ThreedsData } from "../types";
|
|
3
|
+
import { EnrollmentScenario, ValidationScenario } from "../scenarios";
|
|
4
|
+
declare const threedsResponseData: (response: t.EnrollSCAResponse | t.ValidateSCAResponse) => ThreedsData;
|
|
5
|
+
declare const getEnrollmentResult: (enrollment: t.EnrollSCAResponse) => EnrollmentScenario;
|
|
6
|
+
declare const getValidationResult: (validation: t.ValidateSCAResponse) => ValidationScenario;
|
|
7
|
+
export { threedsResponseData, getValidationResult, getEnrollmentResult };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { toFzSli } from "../eci-mappings";
|
|
2
|
+
import { enrollmentScenarios, validationScenarios } from "../scenarios";
|
|
3
|
+
import { failedEnrollmentRequestScenario } from "../scenarios/enrollment";
|
|
4
|
+
import { failedValidationRequestScenario } from "../scenarios/validation";
|
|
5
|
+
const threedsResponseData = (response) => {
|
|
6
|
+
return {
|
|
7
|
+
// CAVV: Visa & Amex only
|
|
8
|
+
// AAV: Mastercard only, known as UCAF
|
|
9
|
+
cavv: response.cavv || response.aav,
|
|
10
|
+
par: response.pares,
|
|
11
|
+
sli: toFzSli(response.eci),
|
|
12
|
+
xid: response.xid,
|
|
13
|
+
ver: response.enrolled,
|
|
14
|
+
directoryServerTxnId: response.directory_server_txn_id,
|
|
15
|
+
threedsVersion: response.version,
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
const getEnrollmentResult = (enrollment) => {
|
|
19
|
+
const result = enrollmentScenarios.find((item) => {
|
|
20
|
+
return item.reasonCode === enrollment.reason_code &&
|
|
21
|
+
item.veresEnrolled === enrollment.enrolled &&
|
|
22
|
+
item.pares === enrollment.pares &&
|
|
23
|
+
item.threedsVersion === getMajor3dsVersion(enrollment.version);
|
|
24
|
+
});
|
|
25
|
+
return result || failedEnrollmentRequestScenario;
|
|
26
|
+
};
|
|
27
|
+
const getValidationResult = (validation) => {
|
|
28
|
+
const result = validationScenarios.find((item) => {
|
|
29
|
+
return item.reasonCode === validation.reason_code &&
|
|
30
|
+
item.pares === validation.pares &&
|
|
31
|
+
item.threedsVersion === getMajor3dsVersion(validation.version);
|
|
32
|
+
});
|
|
33
|
+
return result || failedValidationRequestScenario;
|
|
34
|
+
};
|
|
35
|
+
// 3DS versioning follows SEMVER format. The first charactor is the major version number.
|
|
36
|
+
const getMajor3dsVersion = (original) => {
|
|
37
|
+
return original === null || original === void 0 ? void 0 : original[0];
|
|
38
|
+
};
|
|
39
|
+
export { threedsResponseData, getValidationResult, getEnrollmentResult };
|
|
@@ -17,4 +17,22 @@ const load = (url) => {
|
|
|
17
17
|
document.body.appendChild(headless);
|
|
18
18
|
return headless;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
const load2 = (url) => {
|
|
21
|
+
const existing = document.getElementById(headlessIframeId);
|
|
22
|
+
if (existing) {
|
|
23
|
+
return { el: existing, isExisting: true };
|
|
24
|
+
}
|
|
25
|
+
const headless = document.createElement('iframe');
|
|
26
|
+
headless.style.visibility = 'hidden';
|
|
27
|
+
headless.style.position = 'absolute';
|
|
28
|
+
headless.style.left = '0px';
|
|
29
|
+
headless.style.top = '0px';
|
|
30
|
+
headless.style.height = '0px';
|
|
31
|
+
headless.style.width = '0px';
|
|
32
|
+
headless.style.border = 'none';
|
|
33
|
+
headless.setAttribute('src', url);
|
|
34
|
+
headless.setAttribute('id', headlessIframeId);
|
|
35
|
+
document.body.appendChild(headless);
|
|
36
|
+
return { el: headless, isExisting: false };
|
|
37
|
+
};
|
|
38
|
+
export { load, load2 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const bridgeUrl = "https://paynow.test";
|
|
2
|
-
declare const apiUrl = "https://api.test
|
|
2
|
+
declare const apiUrl = "https://api.test/sdk";
|
|
3
3
|
declare const payNowUrl = "https://paynow.test";
|
|
4
4
|
declare const songbirdUrl = "https://songbirdstag.cardinalcommerce.com/edge/v1/songbird.js";
|
|
5
5
|
export { bridgeUrl, apiUrl, payNowUrl, songbirdUrl };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const bridgeUrl = "https://paynow.test";
|
|
2
|
-
const apiUrl = "https://api.test
|
|
2
|
+
const apiUrl = "https://api.test/sdk";
|
|
3
3
|
const payNowUrl = "https://paynow.test";
|
|
4
4
|
const songbirdUrl = "https://songbirdstag.cardinalcommerce.com/edge/v1/songbird.js";
|
|
5
5
|
export { bridgeUrl, apiUrl, payNowUrl, songbirdUrl };
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -19,7 +19,9 @@ declare enum PublicEvent {
|
|
|
19
19
|
CLICK_TO_PAY_TOKENIZATION_ERROR = "fz.click_to_pay.tokenization.error",
|
|
20
20
|
CLICK_TO_PAY_RESIZE = "fz.click_to_pay.resize",
|
|
21
21
|
CLICK_TO_PAY_DCF_LOADED = "fz.click_to_pay.dcf",
|
|
22
|
-
CLICK_TO_PAY_MRT = "fz.click_to_pay.mrt"
|
|
22
|
+
CLICK_TO_PAY_MRT = "fz.click_to_pay.mrt",
|
|
23
|
+
CLICK_TO_PAY_INITIAL_MRT_REQUEST = "fz.click_to_pay.initial_mrt_req",
|
|
24
|
+
CLICK_TO_PAY_INITIAL_MRT_RESPONSE = "fz.click_to_pay.initial_mrt_res"
|
|
23
25
|
}
|
|
24
26
|
declare enum BridgeEvent {
|
|
25
27
|
TOKENIZE_CARD_REQUEST = "fzi.tc_req",
|
|
@@ -30,9 +32,7 @@ declare enum BridgeEvent {
|
|
|
30
32
|
FORM_VALIDATION_ERROR = "fzi.form_validation_error",
|
|
31
33
|
FORM_VALIDATION_SUCCESS = "fzi.form_validation_success",
|
|
32
34
|
BIN_LOOKUP = "fzi.bin_lookup",
|
|
33
|
-
CLICK_TO_PAY_TOKENIZATION = "fzi.c2p.tc_res"
|
|
34
|
-
CLICK_TO_PAY_REQUEST_MRT = "fzi.c2p.mrt_req",
|
|
35
|
-
CLICK_TO_PAY_RETURN_MRT = "fzi.c2p.mrt_ret"
|
|
35
|
+
CLICK_TO_PAY_TOKENIZATION = "fzi.c2p.tc_res"
|
|
36
36
|
}
|
|
37
37
|
declare enum PaymentMethodType {
|
|
38
38
|
CARD = "card",
|
|
@@ -58,16 +58,6 @@ interface Customer {
|
|
|
58
58
|
state?: string;
|
|
59
59
|
country?: string;
|
|
60
60
|
}
|
|
61
|
-
interface CustomerSnakeCase {
|
|
62
|
-
first_name?: string;
|
|
63
|
-
last_name?: string;
|
|
64
|
-
email?: string;
|
|
65
|
-
address?: string;
|
|
66
|
-
city?: string;
|
|
67
|
-
state?: string;
|
|
68
|
-
postcode?: string;
|
|
69
|
-
country?: string;
|
|
70
|
-
}
|
|
71
61
|
interface Payment {
|
|
72
62
|
amount: number;
|
|
73
63
|
currency: string;
|
|
@@ -163,4 +153,4 @@ type ApplePayPaymentResponse = {
|
|
|
163
153
|
data?: string;
|
|
164
154
|
};
|
|
165
155
|
export { Channel, BridgeEvent, PublicEvent, PaymentMethodType, };
|
|
166
|
-
export type { PaymentMethod, PaymentIntent, Payment, Card, CardOnFile,
|
|
156
|
+
export type { PaymentMethod, PaymentIntent, Payment, Card, CardOnFile, Customer, Handlers, ValidationResult, TokenizeCardResponse, ApplePayPaymentResponse };
|
package/dist/shared/types.js
CHANGED
|
@@ -20,6 +20,8 @@ var PublicEvent;
|
|
|
20
20
|
PublicEvent["CLICK_TO_PAY_RESIZE"] = "fz.click_to_pay.resize";
|
|
21
21
|
PublicEvent["CLICK_TO_PAY_DCF_LOADED"] = "fz.click_to_pay.dcf";
|
|
22
22
|
PublicEvent["CLICK_TO_PAY_MRT"] = "fz.click_to_pay.mrt";
|
|
23
|
+
PublicEvent["CLICK_TO_PAY_INITIAL_MRT_REQUEST"] = "fz.click_to_pay.initial_mrt_req";
|
|
24
|
+
PublicEvent["CLICK_TO_PAY_INITIAL_MRT_RESPONSE"] = "fz.click_to_pay.initial_mrt_res";
|
|
23
25
|
})(PublicEvent || (PublicEvent = {}));
|
|
24
26
|
var BridgeEvent;
|
|
25
27
|
(function (BridgeEvent) {
|
|
@@ -32,8 +34,6 @@ var BridgeEvent;
|
|
|
32
34
|
BridgeEvent["FORM_VALIDATION_SUCCESS"] = "fzi.form_validation_success";
|
|
33
35
|
BridgeEvent["BIN_LOOKUP"] = "fzi.bin_lookup";
|
|
34
36
|
BridgeEvent["CLICK_TO_PAY_TOKENIZATION"] = "fzi.c2p.tc_res";
|
|
35
|
-
BridgeEvent["CLICK_TO_PAY_REQUEST_MRT"] = "fzi.c2p.mrt_req";
|
|
36
|
-
BridgeEvent["CLICK_TO_PAY_RETURN_MRT"] = "fzi.c2p.mrt_ret";
|
|
37
37
|
})(BridgeEvent || (BridgeEvent = {}));
|
|
38
38
|
var PaymentMethodType;
|
|
39
39
|
(function (PaymentMethodType) {
|