-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Whenever a payment.intent is processing, the user should be notified whenever the payment intent has succeed.
That means to approach this issue, some sort of checking should be done whenever a booking's status is on awaiting payment. Based on if its failed or succeed, it should be updated and once succeed/failed, should be notified as well towards the user.
switch (paymentIntent.status) {
case "succeeded":
setMessage(`Success! Payment received.`);
ActivateBookingFunction(paymentIntent.id);
navigate(`/bookingconfirmationoverview?&id=${bookingId}&paymentId=${paymentIntent.id}`)
break;
case "processing":
setMessage(`Payment processing. We'll update you when payment is received.`);
navigate(`/bookingconfirmationoverview?&id=${bookingId}&paymentId=${paymentIntent.id}`)
break;
case "requires_payment_method":
DeactivateBooking(paymentIntent.id);
setMessage(`Payment failed. Please try another payment method. No charges have been made.`);
break;
default:
setMessage(`Something went wrong. Please contact support with error ${paymentIntent.status}.`);
break;
]}
Metadata
Metadata
Assignees
Labels
No labels