Payment completion notification method in stripe plugin

I am trying to make a payment with the stripe plugin using the following template(Freelance Platform like Fiverr Template | Bubble).

The current process during payment is as follows.
Click the “Pay” button → popup for credit card payment by stripe → return to the original screen after successful payment.
image

With the current process, the conditional is such that after the “Pay” button is clicked, a notification or email is sent to the user to inform them that the purchase has been completed. However, if the credit card transaction was not processed successfully, this notification will be a mistake.

Therefore, I would like to change the conditional so that these notifications and e-mails are sent after the payment is completed in stripe.
Could you please let me know if there is a way to solve this problem?