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