Formal request to change the comment status that is recorded from "Completed" to "Payment Received".
The motivation is that customers login to the website, view their order and see that the order has been "Completed", then call or email wondering why their order was completed but is no longer completed. It is a customer service nightmare of mis-information.
As discussed in: #3076614-7: Customer Order Comment gets Overwritten by Payment Comment.
Change line 667 (as of v3.3):
uc_order_comment_save($order_id, $user->uid, $result['message'], 'order', 'completed', FALSE);
to
uc_order_comment_save($order_id, $user->uid, $result['message'], 'order', 'payment_received', FALSE);
I have been running the code change in the previous issue comment for roughly 6 months and haven't noticed any ill effects from it.
Comments
Comment #2
philsward commentedAttempt to fix the link using the d.o token system.
Comment #3
philsward commentedAttempt #2 at fixing the link... (Huzza! Success)
Comment #4
mar4ehk0 commentedHello philsward.
I believe that you are not working correctly with ubercart. You want to leave comments for the order, but it should to change the status of the order. function uc_order_comment_save() not related to change of order status, and this function does not allow changing the order status.
You can see all order's status on page example.com/admin/store/settings/orders/workflow.
PS. I had same problem with customers, then i added webhook to code. I will add path for it in over issue
Comment #5
philsward commented@mar4ehk0 why is uc_stripe completing the order as outlined in 667? "payment_received" is a core order status and makes the most sense.
I am not using UC incorrectly as far as I know, uc_stripe is incorrectly setting the order status.
To top it off, why is uc_stripe even setting an order status? It is providing the exact same information in the admin comments, giving double redundancy of information, but also setting the status. If anything, uc_stripe should move the status to "pending" after the payment has been received.
There's a major disconnect with uc_stripe and comments in general, hence the issue #3076614: Customer Order Comment gets Overwritten by Payment Comment.. Customer Order comments have never worked for me when output as an email. The order screen shows customer comments, but that never gets passed through to the email that is generated. Instead I am presented with the stripe payment token.
At least the proposed change in 667 gets rid of the massive customer calls and emails where they are trying to figure out why their order was completed but hasn't shipped yet...
Comment #6
philsward commented@mar4ehk0 Ok, I see what you're saying about "uc_stripe isn't setting the status".
The problem is that uc_stripe is generating a comment that is viewable by the customer, which is incorrect.
The problem isn't a status change, the problem is the information in the comment that is generated which by default shows the order was "Completed". Maybe the workflow status hasn't changed, but the customer doesn't know that. As far as they know, the order was completed.
See attached
On a side note, yes, my own workflow of "Fully Completed and Shipped" is what has generated a lot of my customer issues... However, we still end up right back where we stared of "Why is uc_stripe telling the customer an order has been completed"?
Either the comment needs to be changed to something other than "completed", OR uc_stripe needs to pull out that code altogether and not generate an Order Comment at all since uc_stripe is ALSO generating an Admin Comment.
Comment #7
mar4ehk0 commentedfunction uc_stripe_charge
if stripe doesn't return Exception then function return array from line 659
property 'success' => TRUE is Important!
Function uc_stripe_charge is declared in uc_stripe_uc_payment_gateway. This hook calls from function _uc_payment_gateway_list file uc_payment.module. Function _uc_payment_gateway_list() calls from frunction uc_payment_process_payment().
Important part code for us from uc_payment_process_payment().
This line
uc_payment_enter($order_id, $method, $amount, empty($result['uid']) ? 0 : $result['uid'], empty($result['data']) ? '' : $result['data'], empty($result['comment']) ? '' : $result['comment']);
confirms the payment. Enters payment for an order to your store. and then ubercart changes status of order to "Payment received".
Comment does not enter payment into order.
Comment #8
mar4ehk0 commentedI saw images, got it.
Then I suggest patch.
Comment #9
philsward commented@mar4ehk0 awesome!
Patch applied cleanly for me. I'll monitor and try to remember to update the status.
Comment #10
philsward commentedAlright, so now the order comments go from:
payment_received -> completed -> processing
We still have a problem with the workflow.
Should we introduce the idea of having uc_stripe create a new workflow of "stripe_complete" titled as "Payment Complete" with the "Completed" workflow?
I don't understand the code enough to know if "completed" is the requirement or if a completed workflow is all that's necessary. I'm also still not sure why the order comment needs to be updated to make this work? Stripe is the only module I know of that is adding an order comment. All others (Paypal, Authorize etc) are simply adding it to the Admin comments.
So, as it sits, the current patch is still going to cause problems with customers not understanding the order comment.
Comment #11
andraeray commented@philsward
Honestly, I believe you can just remove
uc_order_comment_save($order_id, $user->uid, $result['message'], 'order', 'completed', FALSE);And be fine.
From my recollection ubercart has a rule to check if balance is 0, and if the order doesn't require shipping. If both those conditions are good then it sets it to complete. Otherwise, the site owners can modify the status manually when ready.
Please test it and let us know. Based on version 3.3 version, it's the one at line 667.
Comment #12
andraeray commentedI can see why it caused a lot of confusion. I wasn't quite getting the point before, sorry about that. There is no reason to confuse the customers by setting a comment saying "completed" when uc_stripe only collects payment.
I think changing
uc_order_comment_save($order_id, $user->uid, $result['message'], 'order', 'completed', FALSE);to
uc_order_comment_save($order_id, $user->uid, $result['message'], 'order', 'payment_received', FALSE);is the best solution.
It doesn't interfere with any of the normal behavior of ubercart or uc_stripe.
Comment #15
andraeray commentedI can fast track this since you have tested it for 6 months already.
Also this works fine for non-shippable orders as well. It sets the comment status to payment received and the default ubercart rules will do the rest.
Comment #16
andraeray commentedTo give some clarification Philsward, I believe you were using the module correctly.
After a payment is successful, this file has a rule that sets the overall order status to payment received if balance is 0, or to completed if balance is 0 and there is nothing to ship.
ubercart/payment/uc_payment/uc_payment.rules_defaults.incThe
uc_order_comment_savefunction simply adds a comment to the order comments or admin order comments database and that status indicates the status the comment is related to.Comment #17
andraeray commentedComment #18
andraeray commentedComment #19
philsward commentedAdding a user comment after payment interferes with how Ubercart usually works,
Therefore in the following issue it is suggested to remove those lines completely and a patch is attached in #16:
#3076614: Customer Order Comment gets Overwritten by Payment Comment.