- Issue created by @dlevchik
This addition addresses several checkout flow issues and edge cases that can occur during the Stripe payment process.
1. Auto-redirect for already completed payments. Check $intent->status and if succeeded - redirect to commerce_payment.checkout.return (StripePaymentElement onReturn)
2. If order is locked (another payment is in the process) output info to the user and disable checkout complete button.
3. Add customer to PaymentIntent::update along with payment_method. Prevents authentication_required, payment_intent_authentication_failure errors and avoids orphaned PaymentMethods.
4. If $intent->amount !== $order_total perform PaymentIntent::update right on the Review Pane. We know this is also done on OrderPaymentIntentSubscriber, but added it just in case because we may sometimes have errors on OrderPaymentIntentSubscriber.
Needs review
2.0
Payment Element