Closed (fixed)
Project:
Commerce Fraud
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
3 Jul 2020 at 17:23 UTC
Updated:
13 Aug 2020 at 23:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
vishalghyv commentedComment #3
vishalghyv commentedComment #4
derekcresswell commented"Stop fraudulent orders"
And make sure descriptions end with a period.
There are un-needed brackets around the right part of the and statement.
As well, you are called
get('stop_order')many times, why not assign it to a variable once instead.I do not think this is the really the right way to go about this. First, we are adding two warnings despite it really only being one message. It also highly discourages the usage of this feature, even though it is perfectly fine to use. It also implies that there is a double confirmation before activating the feature.
A much better idea is to just add a description to the 'stop_order' option that warns that the feature will not allow any blocked orders to be completed.
Comment #5
vishalghyv commentedI was wondering if it is stopping orders from completing shouldn't there be more than description to set that feature.
It might incur real loss if the feature fails.
Your insight on this?
Comment #6
derekcresswell commentedThe point of the module is to notify and stop fraudulent orders. It seems reasonable to have the ability to block orders that seem fraudulent.
Yes, it is possible for the module to be wrong and stop a good order. But the site owner should have the ability to control which rules to check so they can set up how rigorous the checks should be and therefore have control over this possible loss.
I think there are two things to do :
1. Make the description read :
Or similar.
2. When a order is blocked by this setting (not completed) :
Print a message for the user saying "This order is suspected to be fraudulent and cannot be completed. Contact the administrators for more info and help. {email address}"
This way the users know why they can't complete the order and have a way to sort things out if this is a false positive.
Comment #7
vishalghyv commentedComment #8
vishalghyv commentedComment #10
vishalghyv commentedComment #12
vishalghyv commentedComment #13
vishalghyv commentedComment #15
vishalghyv commentedComment #17
vishalghyv commentedComment #18
derekcresswell commentedThis should add a warning, not message.
When testing this myself I noticed a few things.
1. On the message displayed to the user let's ditch the email part. The site should have contact forms and such so telling them to contact should be ok.
1.1. I think this could open up the idea of making a "fraud appeal contact form" in the future. I am open to an opinion on that. This would than produce a link, or maybe redirect, to a contact form with some default data that gets attached such as order ID. Not for this issue, just for discussion later.
2. While I got the message about the order being fraudulent, I also got the message that a message was sent to the admins. This needs to be removed as the user should not see it. These messages should instead be logged.
The culprit within CommerceFraudSubscriber
Comment #19
vishalghyv commentedComment #20
derekcresswell commentedUse the StringTranslationTrait and
$this->t()for this.These probably are better suited as just normal site logs. The commerce_log is for specifics to the order and while these pertain to the order they feel a little off from what other things are logged here.
If the message fails to send, that is not (shouldn't be) to do with the order, it's a problem with some other configuration in the site.
I guess I'd be ok with the success one being kept on the order if you think it fits there.
Comment #21
vishalghyv commentedComment #23
derekcresswell commentedRemoved some excess logging. Things like the mail system will log errors for us, as for success, I decided that since the admins will be getting an email about it there is not much reason to log it.
Corrected some spelling / grammar as well.