@fat-zebra/sdk 1.5.8-beta.3 → 1.5.8

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +9 -3
  3. package/dist/applepay/applepay.js +6 -31
  4. package/dist/applepay/clients/paynow-client.js +1 -1
  5. package/dist/main.js +3 -3
  6. package/dist/production/fatzebra.js +7 -1
  7. package/dist/production/fatzebra.js.LICENSE.txt +1 -3
  8. package/dist/react/useNotification.d.ts +11 -0
  9. package/dist/react/useNotification.js +26 -0
  10. package/dist/sandbox/fatzebra.js +7 -1
  11. package/dist/sandbox/fatzebra.js.LICENSE.txt +1 -1
  12. package/dist/sca/index.js +2 -2
  13. package/dist/sca/scenarios/enrollment.js +2 -2
  14. package/dist/sca/scenarios/validation.js +3 -3
  15. package/dist/staging/fatzebra.js +198 -89
  16. package/dist/staging/fatzebra.js.map +1 -1
  17. package/dist/validation/schemas/click-to-pay/load-params.json +2 -2
  18. package/dist/validation/schemas/hpp-load-params.json +2 -2
  19. package/dist/validation/schemas/payment-intent.json +0 -3
  20. package/dist/validation/schemas/payment-method.json +17 -49
  21. package/dist/validation/validation-helper.js +2 -1
  22. package/dist/validation/validators/apple-pay-load-params-button-validator.d.ts +1 -2
  23. package/dist/validation/validators/apple-pay-load-params-button-validator.js +1 -2
  24. package/dist/validation/validators/click-to-pay-load-params-validator.d.ts +1 -2
  25. package/dist/validation/validators/click-to-pay-load-params-validator.js +1 -2
  26. package/dist/validation/validators/hpp-load-params-validator.d.ts +1 -2
  27. package/dist/validation/validators/hpp-load-params-validator.js +5 -4
  28. package/dist/validation/validators/verify-card-params-validator.d.ts +1 -2
  29. package/dist/validation/validators/verify-card-params-validator.js +5 -4
  30. package/dist/version.d.ts +1 -1
  31. package/dist/version.js +1 -1
  32. package/package.json +5 -4
@@ -1,3 +1 @@
1
- /*! Axios v1.8.2 Copyright (c) 2025 Matt Zabriskie and contributors */
2
-
3
- /** @license URI.js v4.2.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
1
+ /*! Axios v1.9.0 Copyright (c) 2025 Matt Zabriskie and contributors */
@@ -0,0 +1,11 @@
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;
@@ -0,0 +1,26 @@
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;