@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
|
@@ -0,0 +1,9 @@
|
|
|
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;
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -8,5 +8,5 @@ type RequiredURLValues = {
|
|
|
8
8
|
currency: string;
|
|
9
9
|
};
|
|
10
10
|
type UrlValues = RequiredURLValues & OptionalUrlValues;
|
|
11
|
-
declare const
|
|
12
|
-
export {
|
|
11
|
+
declare const generateApplePayUrl: (values: UrlValues, environment?: Environment) => string;
|
|
12
|
+
export { generateApplePayUrl };
|
|
@@ -0,0 +1,19 @@
|
|
|
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 };
|