Skip to content

Commit

Permalink
fix: payment data filled event logs for few payment methods
Browse files Browse the repository at this point in the history
  • Loading branch information
vsrivatsa-juspay committed Jul 1, 2024
1 parent aa7f73a commit 9b50b1e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Payments/KlarnaSDK.res
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions src/Payments/PayPal.res
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/Payments/PaypalSDKHelpers.res
Original file line number Diff line number Diff line change
Expand Up @@ -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"]({
Expand Down

0 comments on commit 9b50b1e

Please sign in to comment.