Skip to content

Commit

Permalink
fix: HS-158: AB testing for third party ApplePay (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArushKapoorJuspay authored Nov 11, 2023
1 parent 2546cb8 commit 4853f2a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
8 changes: 1 addition & 7 deletions src/Payments/ApplePay.res
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let default = (props: props) => {
let setIsShowOrPayUsing = Recoil.useSetRecoilState(RecoilAtoms.isShowOrPayUsing)
let (showApplePay, setShowApplePay) = React.useState(() => false)
let (showApplePayLoader, setShowApplePayLoader) = React.useState(() => false)
let intent = PaymentHelpers.usePaymentIntent(Some(loggerState), Applepay)
let intent = PaymentHelpers.usePaymentIntent(None, Applepay)
let sync = PaymentHelpers.usePaymentSync(Some(loggerState), Applepay)
let options = Recoil.useRecoilValueFromAtom(RecoilAtoms.optionAtom)
let (applePayClicked, setApplePayClicked) = React.useState(_ => false)
Expand Down Expand Up @@ -196,12 +196,6 @@ let default = (props: props) => {
}`

let onApplePayButtonClicked = () => {
loggerState.setLogInfo(
~value="Apple Pay Button Clicked",
~eventName=APPLE_PAY_FLOW,
~paymentMethod="APPLE_PAY",
(),
)
setApplePayClicked(_ => true)

if isInvokeSDKFlow {
Expand Down
29 changes: 0 additions & 29 deletions src/orca-loader/Elements.res
Original file line number Diff line number Diff line change
Expand Up @@ -474,14 +474,6 @@ let make = (
->Belt.Option.getWithDefault(false)

if isDelayedSessionToken {
logger.setLogInfo(
~value="Delayed Session Token Flow",
~eventName=APPLE_PAY_FLOW,
~paymentMethod="APPLE_PAY",
~logType=DEBUG,
(),
)

let applePayPresent =
dict
->Js.Dict.get("applePayPresent")
Expand All @@ -497,13 +489,6 @@ let make = (

switch connector {
| "trustpay" =>
logger.setLogInfo(
~value="TrustPay Connector Flow",
~eventName=APPLE_PAY_FLOW,
~paymentMethod="APPLE_PAY",
~logType=DEBUG,
(),
)
let secrets =
applePayPresent
->Js.Dict.get("session_token_data")
Expand All @@ -530,21 +515,7 @@ let make = (
->Belt.Option.getWithDefault("")

try {
logger.setLogInfo(
~value="Creating TrustpayApi instance",
~eventName=APPLE_PAY_FLOW,
~paymentMethod="APPLE_PAY",
~logType=DEBUG,
(),
)
let trustpay = trustPayApi(secrets)
logger.setLogInfo(
~value="TrustpayApi instance created",
~eventName=APPLE_PAY_FLOW,
~paymentMethod="APPLE_PAY",
~logType=DEBUG,
(),
)
trustpay.finishApplePaymentV2(. payment, paymentRequest)
->then(res => {
logger.setLogInfo(
Expand Down

0 comments on commit 4853f2a

Please sign in to comment.