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

Command icon 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

OwilliwO created an issue. See original summary.

owilliwo’s picture

Issue summary: View changes

owilliwo’s picture

Title: Payment state on return » Payment state on return should be voided, not canceled
adelgado12’s picture

Status: Needs work » Patch (to be ported)
owilliwo’s picture

Assigned: owilliwo » Unassigned
adelgado12’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.