From e52ced9854f7139ad4940e9f1bfa23973fb67f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Castillo?= Date: Fri, 5 Jun 2026 13:02:16 -0300 Subject: [PATCH] fix: redirect cart payment to purchase details MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Castillo --- src/actions/sponsor-cart-actions.js | 3 ++- .../tabs/sponsor-cart-tab/components/payment-view.js | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/actions/sponsor-cart-actions.js b/src/actions/sponsor-cart-actions.js index 40deafcc6..c1c100878 100644 --- a/src/actions/sponsor-cart-actions.js +++ b/src/actions/sponsor-cart-actions.js @@ -661,12 +661,13 @@ export const confirmPayment = () => async (dispatch, getState) => { `${window.PURCHASES_API_URL}/api/v1/summits/${currentSummit.id}/sponsors/${sponsor.id}/payments/${paymentIntent.id}/confirm`, {}, snackbarErrorHandler - )(params)(dispatch).then(() => { + )(params)(dispatch).then(({ response }) => { dispatch( snackbarSuccessHandler({ title: T.translate("general.success"), html: T.translate("edit_sponsor.cart_tab.payment_view.payment_success") }) ); + return response; }); }; diff --git a/src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/payment-view.js b/src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/payment-view.js index 692e4f8c4..2e8b0178f 100644 --- a/src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/payment-view.js +++ b/src/pages/sponsors/sponsor-page/tabs/sponsor-cart-tab/components/payment-view.js @@ -59,11 +59,11 @@ const PaymentView = ({ ) return null; - const redirectUrl = `/app/summits/${currentSummit.id}/sponsors/${sponsor.id}/cart`; + const redirectUrl = `/app/summits/${currentSummit.id}/sponsors/${sponsor.id}/purchases`; const handlePaymentSuccess = () => - confirmPayment().then(() => { - history.push(redirectUrl); + confirmPayment().then((purchase) => { + history.push(`${redirectUrl}/${purchase.purchase_id}`); }); const handlePaymentError = (error) => {