Skip to content

Commit

Permalink
fix: HS-185: Or Pay using fix for GooglePay and ApplePay (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArushKapoorJuspay authored Dec 27, 2023
1 parent df4d7a1 commit 938793b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/Payments/ApplePay.res
Original file line number Diff line number Diff line change
Expand Up @@ -294,16 +294,17 @@ let make = (
)
}, (isInvokeSDKFlow, requiredFieldsBody))

React.useEffect3(() => {
React.useEffect4(() => {
if (
(isInvokeSDKFlow || paymentExperience == PaymentMethodsRecord.RedirectToURL) &&
isApplePayReady
isApplePayReady &&
isWallet
) {
setShowApplePay(_ => true)
setIsShowOrPayUsing(._ => true)
}
None
}, (isApplePayReady, isInvokeSDKFlow, paymentExperience))
}, (isApplePayReady, isInvokeSDKFlow, paymentExperience, isWallet))

let submitCallback = React.useCallback((ev: Window.event) => {
if !isWallet {
Expand Down
3 changes: 1 addition & 2 deletions src/Payments/GPay.res
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ let make = (
paymentExperience == PaymentMethodsRecord.RedirectToURL) &&
isWallet
) {
setIsShowOrPayUsing(._ => true)
addGooglePayButton()
}
None
Expand Down Expand Up @@ -221,8 +222,6 @@ let make = (
paymentExperience == PaymentMethodsRecord.RedirectToURL ||
isDelayedSessionToken) && isWallet

setIsShowOrPayUsing(.prev => prev || isRenderGooglePayButton)

let submitCallback = React.useCallback((ev: Window.event) => {
if !isWallet {
let json = ev.data->Js.Json.parseExn
Expand Down

0 comments on commit 938793b

Please sign in to comment.