Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: payment data filled event logs for few payment methods #467

Merged
merged 11 commits into from
Jul 4, 2024
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")
vsrivatsa-edinburgh marked this conversation as resolved.
Show resolved Hide resolved
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")
vsrivatsa-edinburgh marked this conversation as resolved.
Show resolved Hide resolved
let paypalWrapper = GooglePayType.getElementById(Utils.document, "paypal-button")
paypalWrapper.innerHTML = ""
paypal["Buttons"]({
Expand Down
Loading