From 9b50b1e03b2421638800c09d55bb833e91903bc2 Mon Sep 17 00:00:00 2001 From: vsrivatsa-juspay Date: Mon, 1 Jul 2024 18:11:27 +0530 Subject: [PATCH] fix: payment data filled event logs for few payment methods --- src/Payments/KlarnaSDK.res | 5 +++++ src/Payments/PayPal.res | 1 + src/Payments/PaypalSDKHelpers.res | 1 + 3 files changed, 7 insertions(+) diff --git a/src/Payments/KlarnaSDK.res b/src/Payments/KlarnaSDK.res index 0dbbb1494..5e9e86942 100644 --- a/src/Payments/KlarnaSDK.res +++ b/src/Payments/KlarnaSDK.res @@ -62,6 +62,11 @@ let make = (~sessionObj: SessionsType.token) => { result => { let result = result->JSON.Decode.bool->Option.getOr(false) if result { + UtilityHooks.useHandlePostMessages( + ~complete=true, + ~empty=false, + ~paymentType="klarna", + ) Utils.handlePostMessage([ ("fullscreen", true->JSON.Encode.bool), ("param", "paymentloader"->JSON.Encode.string), diff --git a/src/Payments/PayPal.res b/src/Payments/PayPal.res index b1384a6c0..a3ca1fcca 100644 --- a/src/Payments/PayPal.res +++ b/src/Payments/PayPal.res @@ -48,6 +48,7 @@ let make = () => { ->then(result => { let result = result->JSON.Decode.bool->Option.getOr(false) if result { + UtilityHooks.useHandlePostMessages(~complete=true, ~empty=true, ~paymentType="paypal") let (connectors, _) = paymentMethodListValue->PaymentUtils.getConnectors(Wallets(Paypal(Redirect))) let body = PaymentBody.paypalRedirectionBody(~connectors) diff --git a/src/Payments/PaypalSDKHelpers.res b/src/Payments/PaypalSDKHelpers.res index 3c6db1b01..661ed5358 100644 --- a/src/Payments/PaypalSDKHelpers.res +++ b/src/Payments/PaypalSDKHelpers.res @@ -30,6 +30,7 @@ let loadPaypalSDK = ( ->then(result => { let result = result->JSON.Decode.bool->Option.getOr(false) if result { + UtilityHooks.useHandlePostMessages(~complete=true, ~empty=true, ~paymentType="paypal") let paypalWrapper = GooglePayType.getElementById(Utils.document, "paypal-button") paypalWrapper.innerHTML = "" paypal["Buttons"]({