-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle Orders with Pending Payments #2478
Comments
I. Improve Revise PageSylius always shows a "order" detail page, where as we show either the confirmation page or a revise page. We cannot change how that is done now without a BC break or a feature flag. If we make II. Order ConfirmationWhat are the possible side effects of this? We never had any issue before with that. III. Resolve awaiting payment state in resolverThat is clearly the consequence and a must have when II is implemented. IV. Adjust Payment BundlesLooks rather like a issue in the Stripe Bundle? |
PR? |
Yes, I don't see any side effect either. |
If you're using an payment provider like stripe which allows klarna / sofort, the payment confirmation is a delayed process. In that case, the user will return to coreshop with a payment state of "processing" (
PaymentInterface::STATE_PROCESSING
). For coreshop, this state is not a "success" state:CoreShop/src/CoreShop/Bundle/PayumBundle/Action/ResolveNextRouteAction.php
Lines 44 to 56 in a1a456f
Which means, that a user retrieves the revise page which tells him, that the payment failed, and he needs to choose another payment.
What to do?
I. Improve Revise Page
In Sylius for example, they also render a similar thing to CoreShop's revise process:
src/Sylius/Bundle/ShopBundle/Resources/views/Order/show.html.twig
... but in a smarter way: If the payment state is in
awaiting_payment
state, they're showing a "Pay" button above the order. In my example, the payment would be "processed" so no payment button but a valid ("on-hold") summary page - so no confusion for the customer who's just successfully paid for the order.II. Order Confirmation
The order should get confirmed, if a payment is in
PaymentInterface::STATE_PROCESSING
state.Two checks to extend:
CoreShop/src/CoreShop/Bundle/PayumBundle/Action/ConfirmOrderAction.php
Lines 39 to 42 in a1a456f
CoreShop/src/CoreShop/Bundle/PayumBundle/Extension/UpdateOrderStateExtension.php
Lines 94 to 98 in a1a456f
=> In my tests, the
UpdateOrderStateExtension
never triggered (see next section " Adjust Payment Bundles").III. Resolve awaiting payment state in resolver
Same as here: Sylius/Sylius#11535
IV. Adjust Payment Bundles
Nothing to do in coreshop core, but I had to add an additional
UpdatePaymentStateExtension
extension (see section "Payment State not updating") otherwise the payment state won't get updated: coreshop/PayumStripeBundle#10The text was updated successfully, but these errors were encountered: