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
[Enhancement proposal] Free orders customizations #11927
Comments
Simple solution could be to make a service deciding if it's a paymentless order or not : if ($this->orderPaymentlessResolver->resolve($order)) {
// delete payments with state === 'cart'
} |
Hi @Prometee |
Hi @NoResponseMate |
If it eases customization then it is worth it. |
@NoResponseMate that's exactly what I though too. I add this to my other tasks and will see if I can manage to create a PR within a month. |
Hey @Prometee, This is a friendly reminder in case you forgot about it 😆 Best wishes, |
Hello @Rafikooo, I'm very sorry, I'm afraid I won't have enough time to create the PR this time. Are you able to create it ? |
When a free order is done sometime it could be require to have a payment to handle a subscription through a payment gateway for exemple.
Today when you create a free order in Sylius a service is removing all payments records (state === cart) thanks to the service
sylius.order_processing.order_payment_processor.checkout
. If you want to have a payment anyway you will need to re-add a new payment thanks to a newsylius.order_processor
tagged service with a priority less than 0.Then when you will have to add a state machine callback or to decorate the service
sylius.order_processing.order_payment_processor.after_checkout
which is using the same classSylius\Component\Core\OrderProcessing\OrderPaymentProcessor
to allow having payment record when a payment fail or is canceled.What I propose is to :
sylius.order_processor
tagged service to allow developper to disable or modify more easily the behaviour of a free order.sylius_payment
state machine to make the same thing.I'm open to another better idea or enhancement then I will make a PR to handle this particular case.
The text was updated successfully, but these errors were encountered: