@fat-zebra/sdk 1.5.4 → 1.5.5
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/local/fatzebra.js.map +1 -1
- package/dist/paypal/paypal-button.d.ts +31 -0
- package/dist/paypal/paypal-button.js +199 -0
- package/dist/paypal/paypal-checkout.d.ts +21 -0
- package/dist/paypal/paypal-checkout.js +100 -0
- package/dist/paypal/types.d.ts +188 -0
- package/dist/paypal/types.js +5 -0
- package/dist/paypal/validation.d.ts +4 -0
- package/dist/paypal/validation.js +65 -0
- package/dist/production/fatzebra.js.LICENSE.txt +1 -0
- package/dist/react/{applePayUrl.d.ts → url.d.ts} +2 -2
- package/dist/react/url.js +33 -0
- package/dist/scripts/release-package.js +324 -0
- package/dist/scripts/release-package.js.map +1 -0
- package/dist/src/applepay/applepay.js +198 -0
- package/dist/src/applepay/applepay.js.map +1 -0
- package/dist/src/applepay/clients/apple-pay-client.js +66 -0
- package/dist/src/applepay/clients/apple-pay-client.js.map +1 -0
- package/dist/src/applepay/clients/paynow-client.js +96 -0
- package/dist/src/applepay/clients/paynow-client.js.map +1 -0
- package/dist/src/applepay/index.js +6 -0
- package/dist/src/applepay/index.js.map +1 -0
- package/dist/src/click_to_pay/clicktopay.test.js +131 -0
- package/dist/src/click_to_pay/clicktopay.test.js.map +1 -0
- package/dist/src/click_to_pay/index.js +135 -0
- package/dist/src/click_to_pay/index.js.map +1 -0
- package/dist/src/click_to_pay/types.js +3 -0
- package/dist/src/click_to_pay/types.js.map +1 -0
- package/dist/src/hpp/hpp.js +230 -0
- package/dist/src/hpp/hpp.js.map +1 -0
- package/dist/src/hpp/hpp.test.js +137 -0
- package/dist/src/hpp/hpp.test.js.map +1 -0
- package/dist/src/hpp/index.js +6 -0
- package/dist/src/hpp/index.js.map +1 -0
- package/dist/src/index.js +15 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/main.js +229 -0
- package/dist/src/main.js.map +1 -0
- package/dist/src/main.test.js +236 -0
- package/dist/src/main.test.js.map +1 -0
- package/dist/src/paypal/paypal-button.js +311 -0
- package/dist/src/paypal/paypal-button.js.map +1 -0
- package/dist/src/paypal/paypal-button.test.js +41 -0
- package/dist/src/paypal/paypal-button.test.js.map +1 -0
- package/dist/src/paypal/paypal-checkout.js +111 -0
- package/dist/src/paypal/paypal-checkout.js.map +1 -0
- package/dist/src/paypal/paypal-checkout.test.js +167 -0
- package/dist/src/paypal/paypal-checkout.test.js.map +1 -0
- package/dist/src/paypal/types.js +9 -0
- package/dist/src/paypal/types.js.map +1 -0
- package/dist/src/paypal/validation.js +73 -0
- package/dist/src/paypal/validation.js.map +1 -0
- package/dist/src/react/VerifyCard.js +29 -0
- package/dist/src/react/VerifyCard.js.map +1 -0
- package/dist/src/react/VerifyExistingCard.js +30 -0
- package/dist/src/react/VerifyExistingCard.js.map +1 -0
- package/dist/src/react/index.js +13 -0
- package/dist/src/react/index.js.map +1 -0
- package/dist/src/react/paymentUrl.js +60 -0
- package/dist/src/react/paymentUrl.js.map +1 -0
- package/dist/src/react/paymentUrl.test.js +88 -0
- package/dist/src/react/paymentUrl.test.js.map +1 -0
- package/dist/src/react/submitForm.js +13 -0
- package/dist/src/react/submitForm.js.map +1 -0
- package/dist/src/react/url.js +60 -0
- package/dist/src/react/url.js.map +1 -0
- package/dist/src/react/url.test.js +88 -0
- package/dist/src/react/url.test.js.map +1 -0
- package/dist/src/react/useFatZebra.js +119 -0
- package/dist/src/react/useFatZebra.js.map +1 -0
- package/dist/src/react/verifyUrl.js +49 -0
- package/dist/src/react/verifyUrl.js.map +1 -0
- package/dist/src/sca/cardinal.js +145 -0
- package/dist/src/sca/cardinal.js.map +1 -0
- package/dist/src/sca/cardinal.test.js +77 -0
- package/dist/src/sca/cardinal.test.js.map +1 -0
- package/dist/src/sca/eci-mappings.js +63 -0
- package/dist/src/sca/eci-mappings.js.map +1 -0
- package/dist/src/sca/eci-mappings.test.js +31 -0
- package/dist/src/sca/eci-mappings.test.js.map +1 -0
- package/dist/src/sca/index.js +382 -0
- package/dist/src/sca/index.js.map +1 -0
- package/dist/src/sca/index.test.js +624 -0
- package/dist/src/sca/index.test.js.map +1 -0
- package/dist/src/sca/scenarios/enrollment.js +161 -0
- package/dist/src/sca/scenarios/enrollment.js.map +1 -0
- package/dist/src/sca/scenarios/index.js +8 -0
- package/dist/src/sca/scenarios/index.js.map +1 -0
- package/dist/src/sca/scenarios/validation.js +139 -0
- package/dist/src/sca/scenarios/validation.js.map +1 -0
- package/dist/src/sca/types.js +57 -0
- package/dist/src/sca/types.js.map +1 -0
- package/dist/src/shared/api-gateway-client.js +148 -0
- package/dist/src/shared/api-gateway-client.js.map +1 -0
- package/dist/src/shared/bridge-client.js +24 -0
- package/dist/src/shared/bridge-client.js.map +1 -0
- package/dist/src/shared/constants.js +19 -0
- package/dist/src/shared/constants.js.map +1 -0
- package/dist/src/shared/env.development.js +12 -0
- package/dist/src/shared/env.development.js.map +1 -0
- package/dist/src/shared/env.js +50 -0
- package/dist/src/shared/env.js.map +1 -0
- package/dist/src/shared/envs/local.js +12 -0
- package/dist/src/shared/envs/local.js.map +1 -0
- package/dist/src/shared/envs/production.js +12 -0
- package/dist/src/shared/envs/production.js.map +1 -0
- package/dist/src/shared/envs/sandbox.js +12 -0
- package/dist/src/shared/envs/sandbox.js.map +1 -0
- package/dist/src/shared/envs/staging.js +12 -0
- package/dist/src/shared/envs/staging.js.map +1 -0
- package/dist/src/shared/event-manager.js +24 -0
- package/dist/src/shared/event-manager.js.map +1 -0
- package/dist/src/shared/post-message-client.js +127 -0
- package/dist/src/shared/post-message-client.js.map +1 -0
- package/dist/src/shared/post-message-client.test.js +58 -0
- package/dist/src/shared/post-message-client.test.js.map +1 -0
- package/dist/src/shared/types.js +36 -0
- package/dist/src/shared/types.js.map +1 -0
- package/dist/src/shared/types.test.js +55 -0
- package/dist/src/shared/types.test.js.map +1 -0
- package/dist/src/shared/util.js +96 -0
- package/dist/src/shared/util.js.map +1 -0
- package/dist/src/shared/util.test.js +148 -0
- package/dist/src/shared/util.test.js.map +1 -0
- package/dist/src/validation/index.js +12 -0
- package/dist/src/validation/index.js.map +1 -0
- package/dist/src/validation/schemas/click-to-pay/load-params.json +34 -0
- package/dist/src/validation/schemas/click-to-pay/options.json +23 -0
- package/dist/src/validation/schemas/click-to-pay/payment-intent.json +42 -0
- package/dist/src/validation/schemas/customer.json +38 -0
- package/dist/src/validation/schemas/hpp-load-params.json +40 -0
- package/dist/src/validation/schemas/hpp-options.json +48 -0
- package/dist/src/validation/schemas/payment-intent.json +48 -0
- package/dist/src/validation/schemas/payment-method.json +83 -0
- package/dist/src/validation/schemas/verify-card-options.json +15 -0
- package/dist/src/validation/schemas/verify-card-params.json +24 -0
- package/dist/src/validation/validation-helper.js +10 -0
- package/dist/src/validation/validation-helper.js.map +1 -0
- package/dist/src/validation/validation-helper.test.js +34 -0
- package/dist/src/validation/validation-helper.test.js.map +1 -0
- package/dist/src/validation/validators/click-to-pay-load-params-validator.js +19 -0
- package/dist/src/validation/validators/click-to-pay-load-params-validator.js.map +1 -0
- package/dist/src/validation/validators/hpp-load-params-validator.js +21 -0
- package/dist/src/validation/validators/hpp-load-params-validator.js.map +1 -0
- package/dist/src/validation/validators/hpp-load-params-validator.test.js +56 -0
- package/dist/src/validation/validators/hpp-load-params-validator.test.js.map +1 -0
- package/dist/src/validation/validators/verify-card-params-validator.js +23 -0
- package/dist/src/validation/validators/verify-card-params-validator.js.map +1 -0
- package/dist/src/version.js +5 -0
- package/dist/src/version.js.map +1 -0
- package/dist/tests/helpers/api-gateway-mock.js +37 -0
- package/dist/tests/helpers/api-gateway-mock.js.map +1 -0
- package/package.json +11 -5
- package/tsconfig.json +1 -0
- package/.idea/fatzebra-js.iml +0 -12
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/dist/applepay/applepaymanager.d.ts +0 -28
- package/dist/applepay/applepaymanager.js +0 -115
- package/dist/fatzebra.css +0 -91
- package/dist/local/fatzebra.js +0 -18991
- package/dist/react/ApplePay.d.ts +0 -9
- package/dist/react/ApplePay.js +0 -11
- package/dist/react/ApplePayButton.d.ts +0 -10
- package/dist/react/ApplePayButton.js +0 -33
- package/dist/react/applePayUrl.js +0 -19
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,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import * as FatZebra from "../shared/types";
|
|
3
|
-
type FrameProps = {
|
|
4
|
-
handlers: FatZebra.Handlers;
|
|
5
|
-
config: FatZebra.PaymentConfig;
|
|
6
|
-
username: string;
|
|
7
|
-
token: string;
|
|
8
|
-
};
|
|
9
|
-
declare const ApplePayButton: ({ handlers, config, username, token }: FrameProps) => React.JSX.Element;
|
|
10
|
-
export default ApplePayButton;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React, { useEffect } from "react";
|
|
2
|
-
import ApplePayManager from "../applepay/applepaymanager";
|
|
3
|
-
import useFatZebra from "./useFatZebra";
|
|
4
|
-
const ApplePayButton = ({ handlers, config, username, token }) => {
|
|
5
|
-
const ref = React.createRef();
|
|
6
|
-
// construct apple pay url
|
|
7
|
-
const { applePayUrl } = useFatZebra({
|
|
8
|
-
config: Object.assign(Object.assign({}, config), { options: Object.assign(Object.assign({}, config.options), { applepay: true }) }),
|
|
9
|
-
handlers: handlers,
|
|
10
|
-
});
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
const iframe = ref.current;
|
|
13
|
-
const handleLoad = () => {
|
|
14
|
-
// this registers events
|
|
15
|
-
// fires off a message to paynow to display the apple button
|
|
16
|
-
// listens for click on paynow side
|
|
17
|
-
new ApplePayManager({
|
|
18
|
-
iframe: ref.current,
|
|
19
|
-
fzPayNowDomain: 'https://paynow.test',
|
|
20
|
-
username,
|
|
21
|
-
token
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
// Add event listener for load event
|
|
25
|
-
iframe.addEventListener('load', handleLoad);
|
|
26
|
-
return () => {
|
|
27
|
-
iframe.removeEventListener('load', handleLoad);
|
|
28
|
-
};
|
|
29
|
-
}, [ref]);
|
|
30
|
-
// this is the size of the button
|
|
31
|
-
return React.createElement("iframe", { ref: ref, src: applePayUrl, allow: "payment", style: { height: '30px', width: '100px' } });
|
|
32
|
-
};
|
|
33
|
-
export default ApplePayButton;
|
|
@@ -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 };
|