I've installed and configured uc_recurring on a drupal 6 site. Version is 6.x-2.0-alpha6.

New transactions are correctly being captured and transmitted to authorize.net ARB.

The problem is the recurring fees cancel function isn't working. Pressing cancel and confirming produces screens that "appear" to be ok. But nothing is being sent to authorize.net ARB.

The log file contains an error with the following content:
'Parameter 2 to uc_recurring_hosted_authorizenet_arb_cancel() expected to be a reference,...'

Message goes on to suggest that the expected parm is not correct from "uc_recurring/uc_recurring.module on line 710".

Comments

ferdinand.bardamu’s picture

I confirm this issue. On version 6.x-2.0-beta1 error is line 761 /uc_recurring/uc_recurring.module

Edit: And the problem is apparently with a target file, not this file. See below.

ferdinand.bardamu’s picture

Version: 6.x-2.0-alpha6 » 6.x-2.0-beta1

If someone has time to try the fix here before I do, please post.

ferdinand.bardamu’s picture

I confirm the fix here worked for 6.x-2.0-beta1. I've updated the line numbers to match 6.x-2.0-beta1 version of uc_recurring/modules/uc_recurring_hosted/uc_recurring_hosted.module:

Fixes:

line 446: function uc_recurring_hosted_authorizenet_arb_cancel($order, $fee) {
line 473: if (!empty($order->order_id)) {
line 474: uc_order_comment_save($order->order_id, 0, t('Authorize.Net: Subscription @subscription_id cancellation failed.
@error - @text', array('@subscription_id' => $subscription_id, '@error' => $data['code'], '@text' => $data['text'])), 'admin');
line 479: uc_order_comment_save($order->order_id, 0, t('Authorize.Net: Subscription @subscription_id cancelled.', array('@subscription_id' => $subscription_id)), 'admin');

Would be nice to pinpoint when this problem arose and get all subsequent appearances.

vmi’s picture

Status: Fixed » Needs review
StatusFileSize
new1.66 KB

I've tested and verified that the above fix works.

PLEASE USE THE MOST CURRENT PATCH BELOW

vmi’s picture

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new1.76 KB
vmi’s picture

Status: Active » Fixed

Accidental post -- ignore

shaundychko’s picture

Status: Fixed » Needs work

Vim, thank you so much for this patch. Line 20 doesn't look quite right, and I think you meant to write what you have in the patch at http://drupal.org/node/1372432. I'm going to test this patch soon.

vmi’s picture

Thanks for catching that Shaun -- you're right about line 20.
Also currently the patch only works when it's run from sites/all/modules/uc_recurring/modules/uc_recurring_hosted
According to drupal standard practice should that be drupal root OR sites/all/modules/module-to-be-patched as well?

shaundychko’s picture

Your patch here: http://drupal.org/node/1372432#comment-5546564 works great. Tested against 6.x-2.0-beta1. Thank you! I had some unhappy customers there...

@ferdinand This problem arose for me when upgrading PHP to 5.3.x which is unforgiving about the pass by reference/value error in the function definition.

@vmi how about just copying your patch at http://drupal.org/node/1372432#comment-5546564 here? It's relative to the contrib module root (.../uc_recurring in this case), as per Drupal standard, so looks good. I'd copy your patch here, but then it might look like I wrote it ;). I'll mark this Reviewed and Tested after you copy over.

vmi’s picture

I thought there was a difference in lines for d6 vs. d7...n/m

shaundychko’s picture

Yep, you're right, but the patch applied anyway with an "offset". If you re-roll for D6, it'll be even better (and not spit out a .orig file).

vmi’s picture

Status: Needs work » Needs review
StatusFileSize
new1.75 KB

Hopefully this patch is better.

shaundychko’s picture

Status: Needs review » Reviewed & tested by the community

good stuff.

univate’s picture

Status: Needs review » Fixed

committed, thanks.

Status: Fixed » Closed (fixed)

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

tmwagner’s picture

I've applied the batch posted Feb 13, 2012 to uc_recurring_hosted.module within the uc_recurring 6.x-2.0-beta1 and confirm that recurring payment cancellations are being transmitted and processed correctly on Authorize.net ARB.

lonehorseend’s picture

Version: 6.x-2.0-beta1 » 6.x-2.x-dev
Status: Closed (fixed) » Active

I remarked this as active because looking at the latest release of 6.x.2.x-dev (released on April 25, 2012), this patch doesn't exist in it. I am about to apply it now for myself.