From aa59d293cf7602ac7bd38904d112830c8735644f Mon Sep 17 00:00:00 2001 From: Jonathan Bourdon Date: Tue, 22 Apr 2025 15:35:24 -0400 Subject: [PATCH] feat: Enhance donation system with new components and improved dialog --- frontend/src/views/creators/DonationDialog.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/creators/DonationDialog.vue b/frontend/src/views/creators/DonationDialog.vue index a40b7a0..9ef1e61 100644 --- a/frontend/src/views/creators/DonationDialog.vue +++ b/frontend/src/views/creators/DonationDialog.vue @@ -103,9 +103,14 @@ async function handleSubmit({ amount, message }) { isPaymentDialogActive.value = true; const response = await createCheckoutSession(amount, message); - - // Redirect to the Stripe Checkout page - window.location.href = response.stripeCheckoutUrl; + + if (response && response.url) { + // Redirect to the Stripe Checkout page + window.location.href = response.url; + } else { + errorMessage.value = t('creator.donation.errors.payment'); + isPaymentDialogActive.value = false; + } } defineExpose({