Problem/Motivation
When viewing a view listing order and payments, if I want to exclude voided payments, canceled payment from the paybox.up2pay page which have been canceled (user clicked on return to the store instead of filling his credit card number) are still displayed.
Steps to reproduce
Alter the backoffice order view to add payment information (using a view relation ship to the payment entities)
EXclude voided payments from the display.
On the front site, fill a cart, go to the up2pay form but do not fill card info, instead, click back using the return button.
Payment entity will be set to canceled and you will see it in the view, despite the filter on payment state.
That's because payment state should be set to voided instead of canceled.
Proposed resolution
This is actually a state machine field, so state_id is not arbitrary, it must be declared as a state from a workflow (payment workflows are defined in the commerce submodule called Commerce Payment (see docroot/modules/contrib/commerce/modules/payment/commerce_payment.workflows.yml)
Remaining tasks
Review and merge.
Also, in the same idea, failure is not a payment state (in src/Controller/PaymentController.php), but I am not sure the best way to handle this one :
- either we replace it with voided
- either we alter the 2 payments workflows to add a failed state and use this new state (failed, as an adjective, seems more legit than failure which is a noun)
User interface changes
API changes
Data model changes
Issue fork commerce_paybox_payment-3292333
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
owilliwoComment #4
owilliwoComment #5
adelgado12 commentedComment #6
owilliwoComment #7
adelgado12 commented