Currently in uc_recurring_authorizenet_cim_renew(), if the charge fails, the error message ($result['comment']) is thrown out and not logged anywhere. If the renewal fails due to having no reference on the order, there is no error message.

This patch adds a couple of calls to uc_order_comment_save() to assist debugging/customer support.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RSTaylor’s picture

Status: Active » Needs review
FileSize
972 bytes

repatch, may as well log success message too.

univate’s picture

+++ uc_recurring.uc_authorizenet.inc	Thu Jan 21 15:43:45 2010
@@ -83,9 +84,15 @@
+      uc_order_comment_save($order->order_id, $user->uid, $result['message']);
       return TRUE;
     }
+    else {
+      uc_order_comment_save($order->order_id, $result['uid'], $result['comment']);

Why the difference between the use of $user->uid / $result['uid'] and $result['message'] / $result['comment']?

Powered by Dreditor.

RSTaylor’s picture

After looking at it more closely, on success the uc_authorizenet module does actually log a comment in _uc_authorizenet_cim_profile_charge(), it's just on failure that it doesn't, returning the comment instead (in both 'comment' and 'message').

So in this, $user->uid should only be needed for the case where no reference is found and the function call is skipped.

DamienMcKenna’s picture

Version: 6.x-2.0-alpha3 » 6.x-2.x-dev
FileSize
785 bytes

Rerolled.

tinker’s picture

Verified the patch in #4 works great but univate's point from #2 is valid. The order comment's user is the person (or process) that enters the comment. It is not the customer's uid. So in this case it should be global user which will show that it was an automated process that created the comment.

Attached patch can be applied using git am uc_recurring-cim-log-error-691884-5.patch

I would mark this RTBC but since I made a change I will leave it up to someone else.

univate’s picture

Issue summary: View changes
Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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