We have been having problems in that we have a variable recurring fee, that is sometimes $0. This creates errors and unnecessary calls to authorize.net. I could find no way to address this without hacking the module. Possible fixes: a) an option to automatically process $0 fees as successful without hitting authorize.net, b) a value in the $fee, such as $fee->succeed that can be set in the existing hook_recurring_renewal_pending , that would be read by uc_recurring_charge_profile to return true without processing, or c) a hook somewhere else, perhaps in uc_recurring_charge_profile, to intervene in the system, perhaps coupled with an $op. This could also be very useful for purposes of debugging.
Here is my hack for this issue:
function uc_recurring_charge_profile(&$fee, &$order = NULL) {
if (!isset($order)) {
$order = uc_recurring_create_renewal_order($fee);
}
if ($fee->fee_amount == 0) { // you could couple this with ' && variable_get('uc_recurring_succeed_0_fees', FALSE) '
return TRUE;
}
return uc_recurring_invoke($fee->fee_handler, 'renew callback', array($order, &$fee));
}
Comments
Comment #1
mattcasey commentedThis looks like a duplicate of #600324where the conclusion seems to be that this code should be part of the payment gateway. You could also put your code in uc_recurring.uc_authorize.net.inc. If you don't want to hack anything, you can create a custom recurring fee handler and there's some info in the README. If you're using Authorize.net CIM, you can also try an update to Ubercart that I posted here.