Skip to content

Commit

Permalink
fix: headers update & warnings removed (#457)
Browse files Browse the repository at this point in the history
Co-authored-by: Arush <[email protected]>
  • Loading branch information
PritishBudhiraja and ArushKapoorJuspay authored Jun 25, 2024
1 parent dc9b9db commit a4b653b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/Payments/GPay.res
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ let make = (~sessionObj: option<SessionsType.token>, ~thirdPartySessionObj: opti

let areOneClickWalletsRendered = Recoil.useSetRecoilState(RecoilAtoms.areOneClickWalletsRendered)

let isGuestCustomer = UtilityHooks.useIsGuestCustomer()

let googlePayPaymentMethodType = switch PaymentMethodsRecord.getPaymentMethodTypeFromList(
~paymentMethodListValue,
~paymentMethod="wallet",
Expand Down
4 changes: 3 additions & 1 deletion src/Utilities/Utils.res
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,9 @@ let getHeaders = (~uri=?, ~token=?, ~headers=Dict.make(), ()) => {
("Content-Type", "application/json"),
("X-Client-Version", Window.version),
("X-Payment-Confirm-Source", "sdk"),
("X-Browser-Name", OrcaLogger.arrayOfNameAndVersion->Array.get(0)->Option.getOr("Others")),
("X-Browser-Version", OrcaLogger.arrayOfNameAndVersion->Array.get(1)->Option.getOr("0")),
("X-Client-Platform", "web"),
]->Dict.fromArray

switch (token, uri) {
Expand Down Expand Up @@ -1328,4 +1331,3 @@ let handleFailureResponse = (~message, ~errorType) =>
]->getJsonFromArrayOfJson,
),
]->getJsonFromArrayOfJson

16 changes: 13 additions & 3 deletions src/orca-loader/PaymentSessionMethods.res
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,12 @@ let getCustomerSavedPaymentMethods = (

PaymentUtils.getStateJson()
->then(stateJson => {
logger.setLogInfo(~value="States Loaded", ~eventName=APPLE_PAY_FLOW, ~paymentMethod="APPLE_PAY", ())
logger.setLogInfo(
~value="States Loaded",
~eventName=APPLE_PAY_FLOW,
~paymentMethod="APPLE_PAY",
(),
)
stateJson->completeApplePayPayment
})
->catch(err => {
Expand Down Expand Up @@ -226,7 +231,12 @@ let getCustomerSavedPaymentMethods = (
PaymentUtils.getStateJson()
->then(
stateJson => {
logger.setLogInfo(~value="States Loaded", ~eventName=GOOGLE_PAY_FLOW, ~paymentMethod="GOOGLE_PAY", ())
logger.setLogInfo(
~value="States Loaded",
~eventName=GOOGLE_PAY_FLOW,
~paymentMethod="GOOGLE_PAY",
(),
)
stateJson->completeGooglePayPayment
},
)
Expand Down Expand Up @@ -423,7 +433,7 @@ let getCustomerSavedPaymentMethods = (
->Identity.anyTypeToJson
->resolve
})
->catch(err => {
->catch(_ => {
updateCustomerPaymentMethodsRef(~isFilterApplePay=true, ~isFilterGooglePay=true)

{
Expand Down

0 comments on commit a4b653b

Please sign in to comment.