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) => {