@fat-zebra/sdk 1.5.16-beta.3 → 1.5.16-beta.6

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.
@@ -12,6 +12,7 @@ import * as FatZebra from "../shared/types";
12
12
  import ThreeDSecure from "../three_d_secure";
13
13
  import * as bridge from "../shared/bridge-client";
14
14
  import env, { Environment } from "../shared/env";
15
+ import { BridgeEvent } from "../shared/types";
15
16
  const useMessage = ({ paymentIntent, options, handlers, sca, config }) => {
16
17
  const [threeDSecureEnabled, setThreeDSecureEnabled] = useState(false);
17
18
  const threeDSecureRef = useRef(null);
@@ -107,6 +108,19 @@ const useMessage = ({ paymentIntent, options, handlers, sca, config }) => {
107
108
  yield handleTokenizeCardResponse(event.data.data);
108
109
  }
109
110
  });
111
+ useEffect(() => {
112
+ const message = {
113
+ channel: 'sca',
114
+ subject: BridgeEvent.READY,
115
+ data: {}
116
+ };
117
+ const iframe = document.querySelector('[name="renderIframe"]');
118
+ if (!iframe)
119
+ return;
120
+ iframe.onload = () => {
121
+ iframe.contentWindow.postMessage(message, '*');
122
+ };
123
+ }, []);
110
124
  useEffect(() => {
111
125
  window.addEventListener("message", messageHandler);
112
126
  return () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fat-zebra/sdk",
3
- "version": "1.5.16-beta.3",
3
+ "version": "1.5.16-beta.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {