Skip to content

Commit

Permalink
fix: HS-154: Added loggerState for ApplePay intent and sync (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
vsrivatsa-edinburgh authored Nov 17, 2023
1 parent e3c6efb commit ed4b09e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Payments/ApplePay.res
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ type props = {sessionObj: option<Js.Json.t>, list: PaymentMethodsRecord.list}
let default = (props: props) => {
let loggerState = Recoil.useRecoilValueFromAtom(RecoilAtoms.loggerAtom)
let {publishableKey} = Recoil.useRecoilValueFromAtom(RecoilAtoms.keys)
let setIsShowOrPayUsing = Recoil.useSetRecoilState(RecoilAtoms.isShowOrPayUsing)
let (showApplePay, setShowApplePay) = React.useState(() => false)
let (showApplePayLoader, setShowApplePayLoader) = React.useState(() => false)
let intent = PaymentHelpers.usePaymentIntent(None, Applepay)
let sync = PaymentHelpers.usePaymentSync(None, Applepay)
let intent = PaymentHelpers.usePaymentIntent(Some(loggerState), Applepay)
let sync = PaymentHelpers.usePaymentSync(Some(loggerState), Applepay)
let options = Recoil.useRecoilValueFromAtom(RecoilAtoms.optionAtom)
let (applePayClicked, setApplePayClicked) = React.useState(_ => false)
let isApplePaySDKFlow = props.sessionObj->Belt.Option.isSome
Expand Down Expand Up @@ -226,12 +227,6 @@ let default = (props: props) => {
let bodyDict = PaymentBody.applePayRedirectBody(~connectors)
processPayment(bodyDict)
}
loggerState.setLogInfo(
~value="",
~eventName=PAYMENT_DATA_FILLED,
~paymentMethod="APPLE_PAY",
(),
)
}

React.useEffect1(() => {
Expand Down Expand Up @@ -274,6 +269,11 @@ let default = (props: props) => {
)
}, [isInvokeSDKFlow])

React.useEffect0(() => {
setIsShowOrPayUsing(.prev => prev || showApplePay)
None
})

<div>
<style> {React.string(css)} </style>
{if showApplePay {
Expand Down

0 comments on commit ed4b09e

Please sign in to comment.