@fat-zebra/sdk 1.5.8 → 1.5.10-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/.github/workflows/ci.yml +226 -0
- package/CHANGELOG.md +9 -0
- package/dist/react/VerifyExistingCard.js +4 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/.idea/fatzebra-js.iml +0 -12
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -6
- package/.idea/vcs.xml +0 -6
- package/dist/applepay/applepaymanager.d.ts +0 -28
- package/dist/applepay/applepaymanager.js +0 -115
- package/dist/local/fatzebra.css +0 -91
- package/dist/local/fatzebra.js +0 -20147
- package/dist/local/fatzebra.js.map +0 -1
- package/dist/local/index.html +0 -247
- package/dist/production/fatzebra.css +0 -91
- package/dist/production/fatzebra.js +0 -8
- package/dist/production/fatzebra.js.LICENSE.txt +0 -1
- package/dist/react/ApplePay.d.ts +0 -9
- package/dist/react/ApplePay.js +0 -11
- package/dist/react/applePayUrl.d.ts +0 -12
- package/dist/react/applePayUrl.js +0 -19
- package/dist/react/useNotification.d.ts +0 -11
- package/dist/react/useNotification.js +0 -26
- package/dist/sandbox/fatzebra.css +0 -91
- package/dist/sandbox/fatzebra.js +0 -8
- package/dist/sandbox/fatzebra.js.LICENSE.txt +0 -1
- package/dist/scripts/release-package.js +0 -324
- package/dist/scripts/release-package.js.map +0 -1
- package/dist/src/applepay/applepay.js +0 -198
- package/dist/src/applepay/applepay.js.map +0 -1
- package/dist/src/applepay/applepaymanager.js +0 -279
- package/dist/src/applepay/applepaymanager.js.map +0 -1
- package/dist/src/applepay/clients/apple-pay-client.js +0 -66
- package/dist/src/applepay/clients/apple-pay-client.js.map +0 -1
- package/dist/src/applepay/clients/paynow-client.js +0 -96
- package/dist/src/applepay/clients/paynow-client.js.map +0 -1
- package/dist/src/applepay/index.js +0 -6
- package/dist/src/applepay/index.js.map +0 -1
- package/dist/src/click_to_pay/clicktopay.test.js +0 -131
- package/dist/src/click_to_pay/clicktopay.test.js.map +0 -1
- package/dist/src/click_to_pay/index.js +0 -135
- package/dist/src/click_to_pay/index.js.map +0 -1
- package/dist/src/click_to_pay/types.js +0 -3
- package/dist/src/click_to_pay/types.js.map +0 -1
- package/dist/src/hpp/hpp.js +0 -230
- package/dist/src/hpp/hpp.js.map +0 -1
- package/dist/src/hpp/hpp.test.js +0 -137
- package/dist/src/hpp/hpp.test.js.map +0 -1
- package/dist/src/hpp/index.js +0 -6
- package/dist/src/hpp/index.js.map +0 -1
- package/dist/src/index.js +0 -15
- package/dist/src/index.js.map +0 -1
- package/dist/src/main.js +0 -229
- package/dist/src/main.js.map +0 -1
- package/dist/src/main.test.js +0 -236
- package/dist/src/main.test.js.map +0 -1
- package/dist/src/react/ApplePayButton.js +0 -56
- package/dist/src/react/ApplePayButton.js.map +0 -1
- package/dist/src/react/VerifyCard.js +0 -29
- package/dist/src/react/VerifyCard.js.map +0 -1
- package/dist/src/react/VerifyExistingCard.js +0 -30
- package/dist/src/react/VerifyExistingCard.js.map +0 -1
- package/dist/src/react/applePayUrl.js +0 -46
- package/dist/src/react/applePayUrl.js.map +0 -1
- package/dist/src/react/applePayUrl.test.js +0 -57
- package/dist/src/react/applePayUrl.test.js.map +0 -1
- package/dist/src/react/index.js +0 -13
- package/dist/src/react/index.js.map +0 -1
- package/dist/src/react/paymentUrl.js +0 -60
- package/dist/src/react/paymentUrl.js.map +0 -1
- package/dist/src/react/paymentUrl.test.js +0 -88
- package/dist/src/react/paymentUrl.test.js.map +0 -1
- package/dist/src/react/submitForm.js +0 -13
- package/dist/src/react/submitForm.js.map +0 -1
- package/dist/src/react/useFatZebra.js +0 -70
- package/dist/src/react/useFatZebra.js.map +0 -1
- package/dist/src/react/useMessage.js +0 -140
- package/dist/src/react/useMessage.js.map +0 -1
- package/dist/src/react/useMessage.test.js +0 -222
- package/dist/src/react/useMessage.test.js.map +0 -1
- package/dist/src/react/verifyUrl.js +0 -49
- package/dist/src/react/verifyUrl.js.map +0 -1
- package/dist/src/sca/cardinal.js +0 -145
- package/dist/src/sca/cardinal.js.map +0 -1
- package/dist/src/sca/cardinal.test.js +0 -77
- package/dist/src/sca/cardinal.test.js.map +0 -1
- package/dist/src/sca/eci-mappings.js +0 -63
- package/dist/src/sca/eci-mappings.js.map +0 -1
- package/dist/src/sca/eci-mappings.test.js +0 -31
- package/dist/src/sca/eci-mappings.test.js.map +0 -1
- package/dist/src/sca/index.js +0 -382
- package/dist/src/sca/index.js.map +0 -1
- package/dist/src/sca/index.test.js +0 -624
- package/dist/src/sca/index.test.js.map +0 -1
- package/dist/src/sca/scenarios/enrollment.js +0 -161
- package/dist/src/sca/scenarios/enrollment.js.map +0 -1
- package/dist/src/sca/scenarios/index.js +0 -8
- package/dist/src/sca/scenarios/index.js.map +0 -1
- package/dist/src/sca/scenarios/validation.js +0 -139
- package/dist/src/sca/scenarios/validation.js.map +0 -1
- package/dist/src/sca/types.js +0 -57
- package/dist/src/sca/types.js.map +0 -1
- package/dist/src/shared/api-gateway-client.js +0 -148
- package/dist/src/shared/api-gateway-client.js.map +0 -1
- package/dist/src/shared/bridge-client.js +0 -24
- package/dist/src/shared/bridge-client.js.map +0 -1
- package/dist/src/shared/constants.js +0 -19
- package/dist/src/shared/constants.js.map +0 -1
- package/dist/src/shared/env.development.js +0 -12
- package/dist/src/shared/env.development.js.map +0 -1
- package/dist/src/shared/env.js +0 -50
- package/dist/src/shared/env.js.map +0 -1
- package/dist/src/shared/envs/local.js +0 -12
- package/dist/src/shared/envs/local.js.map +0 -1
- package/dist/src/shared/envs/production.js +0 -12
- package/dist/src/shared/envs/production.js.map +0 -1
- package/dist/src/shared/envs/sandbox.js +0 -12
- package/dist/src/shared/envs/sandbox.js.map +0 -1
- package/dist/src/shared/envs/staging.js +0 -12
- package/dist/src/shared/envs/staging.js.map +0 -1
- package/dist/src/shared/event-manager.js +0 -24
- package/dist/src/shared/event-manager.js.map +0 -1
- package/dist/src/shared/post-message-client.js +0 -127
- package/dist/src/shared/post-message-client.js.map +0 -1
- package/dist/src/shared/post-message-client.test.js +0 -58
- package/dist/src/shared/post-message-client.test.js.map +0 -1
- package/dist/src/shared/types.js +0 -36
- package/dist/src/shared/types.js.map +0 -1
- package/dist/src/shared/types.test.js +0 -55
- package/dist/src/shared/types.test.js.map +0 -1
- package/dist/src/shared/util.js +0 -96
- package/dist/src/shared/util.js.map +0 -1
- package/dist/src/shared/util.test.js +0 -148
- package/dist/src/shared/util.test.js.map +0 -1
- package/dist/src/validation/index.js +0 -12
- package/dist/src/validation/index.js.map +0 -1
- package/dist/src/validation/schemas/click-to-pay/load-params.json +0 -34
- package/dist/src/validation/schemas/click-to-pay/options.json +0 -23
- package/dist/src/validation/schemas/click-to-pay/payment-intent.json +0 -42
- package/dist/src/validation/schemas/customer.json +0 -38
- package/dist/src/validation/schemas/hpp-load-params.json +0 -40
- package/dist/src/validation/schemas/hpp-options.json +0 -48
- package/dist/src/validation/schemas/payment-intent.json +0 -48
- package/dist/src/validation/schemas/payment-method.json +0 -83
- package/dist/src/validation/schemas/verify-card-options.json +0 -15
- package/dist/src/validation/schemas/verify-card-params.json +0 -24
- package/dist/src/validation/validation-helper.js +0 -10
- package/dist/src/validation/validation-helper.js.map +0 -1
- package/dist/src/validation/validation-helper.test.js +0 -34
- package/dist/src/validation/validation-helper.test.js.map +0 -1
- package/dist/src/validation/validators/apple-pay-load-params-button-validator.js +0 -19
- package/dist/src/validation/validators/apple-pay-load-params-button-validator.js.map +0 -1
- package/dist/src/validation/validators/click-to-pay-load-params-validator.js +0 -19
- package/dist/src/validation/validators/click-to-pay-load-params-validator.js.map +0 -1
- package/dist/src/validation/validators/hpp-load-params-validator.js +0 -21
- package/dist/src/validation/validators/hpp-load-params-validator.js.map +0 -1
- package/dist/src/validation/validators/hpp-load-params-validator.test.js +0 -56
- package/dist/src/validation/validators/hpp-load-params-validator.test.js.map +0 -1
- package/dist/src/validation/validators/verify-card-params-validator.js +0 -23
- package/dist/src/validation/validators/verify-card-params-validator.js.map +0 -1
- package/dist/src/version.js +0 -5
- package/dist/src/version.js.map +0 -1
- package/dist/staging/fatzebra.css +0 -91
- package/dist/staging/fatzebra.js +0 -20423
- package/dist/staging/fatzebra.js.map +0 -1
- package/dist/staging/index.html +0 -247
- package/dist/tests/helpers/api-gateway-mock.js +0 -37
- package/dist/tests/helpers/api-gateway-mock.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! Axios v1.9.0 Copyright (c) 2025 Matt Zabriskie and contributors */
|
package/dist/react/ApplePay.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React, { HTMLProps } from "react";
|
|
2
|
-
import * as FatZebra from "../shared/types";
|
|
3
|
-
type FrameProps = {
|
|
4
|
-
handlers: FatZebra.Handlers;
|
|
5
|
-
config: FatZebra.PaymentConfig;
|
|
6
|
-
iframeProps?: HTMLProps<HTMLIFrameElement>;
|
|
7
|
-
};
|
|
8
|
-
declare const ApplePay: ({ handlers, config, iframeProps }: FrameProps) => React.JSX.Element;
|
|
9
|
-
export default ApplePay;
|
package/dist/react/ApplePay.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import useFatZebra from "./useFatZebra";
|
|
3
|
-
const ApplePay = ({ handlers, config, iframeProps }) => {
|
|
4
|
-
const { applePayUrl } = useFatZebra({
|
|
5
|
-
config: Object.assign(Object.assign({}, config), { options: Object.assign(Object.assign({}, config.options), { applepay: true }) }),
|
|
6
|
-
handlers: handlers,
|
|
7
|
-
});
|
|
8
|
-
return (React.createElement("div", null,
|
|
9
|
-
React.createElement("iframe", Object.assign({ src: applePayUrl, allow: "payment", "data-test-id": "apple-pay", title: "apple-pay-button" }, iframeProps))));
|
|
10
|
-
};
|
|
11
|
-
export default ApplePay;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Environment } from "../shared/env";
|
|
2
|
-
import { OptionalUrlValues } from '../shared/types';
|
|
3
|
-
type RequiredURLValues = {
|
|
4
|
-
merchant: string;
|
|
5
|
-
hash: string;
|
|
6
|
-
reference: string;
|
|
7
|
-
amount: number;
|
|
8
|
-
currency: string;
|
|
9
|
-
};
|
|
10
|
-
type UrlValues = RequiredURLValues & OptionalUrlValues;
|
|
11
|
-
declare const generateApplePayUrl: (values: UrlValues, environment?: Environment) => string;
|
|
12
|
-
export { generateApplePayUrl };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { parseTemplate } from 'url-template';
|
|
2
|
-
import env, { Environment } from "../shared/env";
|
|
3
|
-
const generateApplePayUrl = (values, environment) => {
|
|
4
|
-
const queryParts = [
|
|
5
|
-
"applepay"
|
|
6
|
-
];
|
|
7
|
-
const environmentConfig = env[environment || Environment.sandbox];
|
|
8
|
-
const urlTemplate = parseTemplate(`${environmentConfig.payNowUrl}/sdk/{merchant}/{reference}/{currency}/{amount}/{verification}{?${queryParts.join(",")}}`);
|
|
9
|
-
const url = urlTemplate.expand({
|
|
10
|
-
merchant: values.merchant,
|
|
11
|
-
reference: values.reference,
|
|
12
|
-
currency: values.currency,
|
|
13
|
-
amount: values.amount,
|
|
14
|
-
verification: values.hash,
|
|
15
|
-
applepay: values.applepay
|
|
16
|
-
});
|
|
17
|
-
return url;
|
|
18
|
-
};
|
|
19
|
-
export { generateApplePayUrl };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Environment } from "../shared/env";
|
|
2
|
-
import { PublicEvent } from "../shared/types";
|
|
3
|
-
type UseMessageProps = {
|
|
4
|
-
username: string;
|
|
5
|
-
environment: Environment;
|
|
6
|
-
subscriptions: Array<PublicEvent>;
|
|
7
|
-
};
|
|
8
|
-
declare const useNotification: ({ username, environment, subscriptions }: UseMessageProps) => {
|
|
9
|
-
events: any[];
|
|
10
|
-
};
|
|
11
|
-
export default useNotification;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
import FatZebra from "../main";
|
|
3
|
-
import { Environment } from "../shared/env";
|
|
4
|
-
const useNotification = ({ username, environment, subscriptions }) => {
|
|
5
|
-
const [events, setEvents] = useState([]);
|
|
6
|
-
// Generic handler for all events
|
|
7
|
-
const handleEvent = (event) => {
|
|
8
|
-
console.log("this is the event", event);
|
|
9
|
-
if (event === null || event === void 0 ? void 0 : event.type) {
|
|
10
|
-
setEvents((prev) => [...prev, event]);
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
const fz = new FatZebra({ username, test: environment === Environment.test });
|
|
15
|
-
subscriptions.forEach((event) => {
|
|
16
|
-
fz.on(event, handleEvent);
|
|
17
|
-
});
|
|
18
|
-
return () => {
|
|
19
|
-
subscriptions.forEach((event) => {
|
|
20
|
-
fz.off(event, handleEvent); // if off is supported with a handler ref
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
}, [username, environment, subscriptions]);
|
|
24
|
-
return { events };
|
|
25
|
-
};
|
|
26
|
-
export default useNotification;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
.checkout-button-wrapper {
|
|
2
|
-
display: flex;
|
|
3
|
-
justify-content: center;
|
|
4
|
-
align-items: center;
|
|
5
|
-
height: 200px;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.iframe-checkout {
|
|
9
|
-
flex: 1;
|
|
10
|
-
border: none;
|
|
11
|
-
width: 100%;
|
|
12
|
-
height: 100%;
|
|
13
|
-
min-height: 0;
|
|
14
|
-
overflow: auto;
|
|
15
|
-
-webkit-overflow-scrolling: touch;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.iframe-foreground,
|
|
19
|
-
.iframe-background {
|
|
20
|
-
top: 0;
|
|
21
|
-
left: 0;
|
|
22
|
-
right: 0;
|
|
23
|
-
bottom: 0;
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.iframe-foreground,
|
|
28
|
-
.iframe-background {
|
|
29
|
-
position: fixed;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.iframe-foreground {
|
|
33
|
-
z-index: -1;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.iframe-background {
|
|
37
|
-
background: rgba(0, 0, 0, 0.5);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.iframe-foreground {
|
|
41
|
-
flex-grow: 1;
|
|
42
|
-
top: auto;
|
|
43
|
-
width: 100%;
|
|
44
|
-
max-width: 480px;
|
|
45
|
-
height: 80vh;
|
|
46
|
-
background-color: #ffffff;
|
|
47
|
-
border-radius: 25px 25px 0 0;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.slide-in .iframe-foreground {
|
|
51
|
-
transform: translateY(100vh);
|
|
52
|
-
transition: transform 0.4s ease, z-index 0.3s ease 0.4s;
|
|
53
|
-
z-index: -1;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.slide-in .iframe-background {
|
|
57
|
-
opacity: 0;
|
|
58
|
-
z-index: -1;
|
|
59
|
-
transition: opacity 0.3s ease, z-index 0.3s ease 0.3s;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.slide-in.show .iframe-foreground {
|
|
63
|
-
transform: none;
|
|
64
|
-
transition: transform 0.4s ease;
|
|
65
|
-
z-index: 100;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.slide-in.show .iframe-background {
|
|
69
|
-
opacity: 1;
|
|
70
|
-
z-index: 0;
|
|
71
|
-
transition: opacity 0.3s ease;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
@media only screen and (min-width: 480px) {
|
|
75
|
-
.iframe-foreground {
|
|
76
|
-
margin: 0 auto;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
@media only screen and (min-width: 768px) {
|
|
81
|
-
.iframe-foreground {
|
|
82
|
-
margin: 0;
|
|
83
|
-
width: 400px;
|
|
84
|
-
height: 100vh;
|
|
85
|
-
left: 0;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.slide-in .iframe-foreground {
|
|
89
|
-
transform: translateX(-400px);
|
|
90
|
-
}
|
|
91
|
-
}
|