Skip to content

Commit

Permalink
add logging to order-payment-confirmation page
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMolcik committed Dec 30, 2024
1 parent a7ed5bc commit ce29a06
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions storefront/pages/order-payment-confirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,39 @@ const OrderPaymentConfirmationPage: FC<ServerSidePropsType> = () => {
variables: { urlHash },
});
const order = orderData?.order;
// eslint-disable-next-line no-console
console.log('🚀 -> file: order-payment-confirmation.tsx:27 -> order:', order);

const [{ data: failedContentData, fetching: isOrderPaymentFailedContentFetching, error: orderPaymentFailedError }] =
useOrderPaymentFailedContentQuery({
variables: { orderUuid },
pause: !order || order.isPaid,
});

// eslint-disable-next-line no-console
console.log('🚀 -> file: order-payment-confirmation.tsx:35 -> failedContentData:', failedContentData);
// eslint-disable-next-line no-console
console.log('🚀 -> file: order-payment-confirmation.tsx:36 -> orderPaymentFailedError:', orderPaymentFailedError);

const [
{ data: failedContentData, fetching: isOrderPaymentFailedContentFetching, error: isOrderPaymentFailedError },
] = useOrderPaymentFailedContentQuery({
variables: { orderUuid },
pause: !order || order.isPaid,
});
const [
{
data: successContentData,
fetching: isOrderPaymentSuccessfulContentFetching,
error: isOrderPaymentSuccessError,
error: orderPaymentSuccessError,
},
] = useOrderPaymentSuccessfulContentQuery({
variables: { orderUuid },
pause: !order || !order.isPaid,
});
// eslint-disable-next-line no-console
console.log('🚀 -> file: order-payment-confirmation.tsx:48 -> successContentData:', successContentData);
// eslint-disable-next-line no-console
console.log('🚀 -> file: order-payment-confirmation.tsx:49 -> orderPaymentSuccessError:', orderPaymentSuccessError);

const paymentSessionExpiredErrorMessage = getPaymentSessionExpiredErrorMessage(
t,
isOrderPaymentFailedError,
isOrderPaymentSuccessError,
orderPaymentFailedError,
orderPaymentSuccessError,
);

const isFetchingData =
Expand Down

0 comments on commit ce29a06

Please sign in to comment.