From 770d0405c98f5e65ad22f9398e57ce6f2315b2f4 Mon Sep 17 00:00:00 2001 From: G Date: Thu, 23 May 2024 16:34:47 +0000 Subject: [PATCH] minor changes --- src/screens/PaymentAmountInputScreen.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/screens/PaymentAmountInputScreen.tsx b/src/screens/PaymentAmountInputScreen.tsx index 166e4da..f70fe54 100644 --- a/src/screens/PaymentAmountInputScreen.tsx +++ b/src/screens/PaymentAmountInputScreen.tsx @@ -61,8 +61,13 @@ const PaymentAmountInputScreen: PaymentStackScreenComponentProps<"paymentAmountI log.info("Ouverture du navigateur sur la page de paiement..."); await handlePaymentUsingBrowser(payment_url); log.info("Verifying transaction status..."); - const response = await transactionsStatusMutation.mutateAsync(order_id); - log.info("result of transactions", JSON.stringify(response, null, 2)); + const { status } = await transactionsStatusMutation.mutateAsync(order_id); + log.info("result of transactions", JSON.stringify(status, null, 2)); + if (status === "SUCCESS") { + log.info("Transaction was a success, navigating to success page"); + } else if (status === "FAILED") { + log.warn("Transaction was a failed, navigating to error page"); + } } catch (error) { log.error("handlePaymentButton |", error); //TODO : handle error -- libgit2 0.27.1