Skip to content
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

[PW-6021] Add 'maintain state' option on payment confirmation #1390

Merged
merged 10 commits into from Mar 28, 2022
Merged

Conversation

tnaber
Copy link
Contributor

@tnaber tnaber commented Mar 14, 2022

Description
In #1276 it was suggested to implement a 'No status change' option on payment confirmation to allow for different flows (e.g. capturing after POD, see discussion). This was already possible in 7.2.0 by not setting any status (leaving it to '-- Please Select --'), however this feature disappeared for later versions. This PR adds the option to select 'Maintain status' in the Order status: payment confirmed dropdown. The '-- Please Select --' option has been removed to prevent confusion to which status will be selected, the default is 'Processing'.

The state will be maintained only in the Manual Capture flow.

image

Tested scenarios

  • Manual capture
  • Immediate capture
  • Verified by community

Fixed issue:
Closes #1276

@tnaber tnaber changed the title Added status to webhook [PW-6021] Add 'maintain state' option on payment confirmation Mar 14, 2022
Helper/Webhook.php Outdated Show resolved Hide resolved
Helper/Webhook.php Outdated Show resolved Hide resolved
Helper/Webhook.php Show resolved Hide resolved
Model/Config/Source/Status/ProcessingMaintain.php Outdated Show resolved Hide resolved
@tnaber tnaber requested a review from Morerice March 17, 2022 09:46
@sonarcloud
Copy link

sonarcloud bot commented Mar 28, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@tnaber tnaber merged commit 9e9911c into develop Mar 28, 2022
@tnaber tnaber deleted the PW-6021 branch March 28, 2022 07:20
@Morerice Morerice mentioned this pull request Mar 28, 2022
@sheppeybrian
Copy link

@tnaber
Just upgraded to 8.2.0 this solution corrects the status/state issue but creates a pending invoice not a paid one.

Processing flow:
Order placed and payment authorized. (Manual Capture)

Invoice created at a later date via magento backend as online payment.

Capture notification received however the invoice is generated with invoice status "Pending" and not "Paid".

This makes the invoice worthless and if further status changes are attempted, like shipping it will cancel the order down completely.

Back to 7.2.0 which works no issues.

@tnaber
Copy link
Contributor Author

tnaber commented Apr 12, 2022

Hi @sheppeybrian,

Sad to hear that you had to go back to 7.2.0 again. I don't completely understand what you mean so I'll write down the steps I'm taking, can you point out where your flow differs from mine?

My setup:
image

  1. Place order, order in Payment Review
  2. Authorization notification received, order in Pending
  3. Invoice created, order in Pending
  4. Capture notification received, order in Pending
  5. Ship order, order Complete

When testing the flow where we ship before creating the invoice I notice some strange behaviour

  1. Place order, order in Payment Review
  2. Authorization notification received, order in Pending
  3. Order shipped, order in Processing
  4. Invoice created, order Closed
  5. Capture notification received but not processed, order in Closed

Am I correct in assuming that you are using the second flow?
If so, do you mean that an invoice should be directly opened as a 'Paid' invoice? As far as I understand it, the capture notification has not been received at that point

If this is not the flow you mean, would you able to provide your flow in a similar format?

Cheers,
Titus

@sheppeybrian
Copy link

sheppeybrian commented Apr 12, 2022 via email

@tnaber
Copy link
Contributor Author

tnaber commented Apr 12, 2022

Hi Brian,
I did not expect this behaviour to occur and will be diving back into this :)

@sheppeybrian
Copy link

sheppeybrian commented Apr 12, 2022 via email

@jordanvector
Copy link

@tnaber was there ever a follow up ticket created to track the fix for the invoice status issue referenced above?

@tnaber
Copy link
Contributor Author

tnaber commented Apr 19, 2022

Hi @jordanvector,
A follow up ticket has been created and the investigation is in progress.
The issue is not necessarily caused by this PR, the problem exists since orders are pushed to the Processing state after an invoice in order to allow for multiple invoices. If an order is shipped before being captured, it will move to Closed. We are currently figuring out the correct flow.

Cheers,
Titus

@jordanvector
Copy link

@tnaber understood thank you for the update.

@tnaber
Copy link
Contributor Author

tnaber commented May 23, 2022

Hi @jordanvector and @sheppeybrian,

In #1533 you can view our proposed solution. Let me know what you think!
Also let me know whether you think the 'Maintain state' option has become redundant due to this (as the shipping before capture flow can be used without it)

Cheers,
Titus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[PW-6021] Forced order status change for Capture notifications
5 participants