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: headers update & warnings removed #457

Merged
merged 7 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading