If "Enable triggered renewals" is checked, the system creates new orders as recurring orders for the original order. It actually not only creates them, it creates it 5 times per single order. The description says that you can uncheck this to disable triggered renewals for recurring payments handled by uc_recurring. So I think with it checked and a payment set up to ARB, it should still do nothing.

A similar issue with this is that the ARB does the Silent Post back and it is logged, but the order does not reflect this. The next payment is always the initial X days after the initial order.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

univate’s picture

Component: Code » Gateway Integration
Issue tags: +Authorize ARB

Triggered renewals only apply's to payments gateway where uc_recurring triggers the payments. So that gateways like Auth ARB where they control the payments payments will continue to happen.

That settings only relates to gateways like Auth CIM where you (the website) control the payments.

shazar’s picture

univate - That is my point. Wouldn't that mean that with the check box checked that it should not handle the payments with the cron job? It seems I should not have to uncheck the box as it shouldn't trigger in the first place.

univate’s picture

I don't personally use ARB so can't really suggest anything else - just that if you are using ARB it won't matter what you do to that box.

shazar’s picture

Any thoughts on the other issue here? ARB is working fine on the ARB side, and I do get the silent post. Nothing is done besides being logged.

shazar’s picture

function uc_recurring_hosted_authorizenet_arb_renew($order, $fee) is the root of the problem.

What I did for a work around is to change the last few lines of that function to:

#uc_payment_enter($order->order_id, $order->payment_method, $_POST['x_amount'], $fee->uid, NULL, t('Authorize.net ARB subsription ID: @subscription_id', array('@subscription_id' => $_POST['x_subscription_id'])));
$KEYS = array_keys($order->data['cc_txns']['references']);
$subscription_id = $KEYS[0];
uc_payment_enter($order->order_id, $order->payment_method, $fee->fee_amount, $fee->uid, NULL, t('Authorize.net ARB subsription ID: @subscription_id', array('@subscription_id' => $subscription_id)));

I don't think this is truly correct as it does not get the payment info directly from Authorize.NET, but at least it updates the records to look good.

univate’s picture

just php tags around the code so we can try and read it...

#uc_payment_enter($order->order_id, $order->payment_method, $_POST['x_amount'], $fee->uid, NULL, t('Authorize.net ARB subsription ID: @subscription_id', array('@subscription_id' => $_POST['x_subscription_id'])));
$KEYS = array_keys($order->data['cc_txns']['references']);
$subscription_id = $KEYS[0];
uc_payment_enter($order->order_id, $order->payment_method, $fee->fee_amount, $fee->uid, NULL, t('Authorize.net ARB subsription ID: @subscription_id', array('@subscription_id' => $subscription_id)));
ShaunDychko’s picture

Status: Needs work » Active

The issue with cron triggering ARB is that the own_handler value in the uc_recurring_users table is not correctly set to TRUE. The function uc_recurring_hosted_recurring_info() in uc_recurring_hosted.module does set own_handler to TRUE, but this setting is lost somewhere down the line when the recurring order is saved (probably around line 396 of uc_recurring_product.module).

A hack, which appears to work well enough on a dev site, is to change line 891 of uc_recurring.module from

  $result = db_query("SELECT * FROM {uc_recurring_users} WHERE remaining_intervals <> 0 AND next_charge <= %d AND own_handler = 0 ORDER BY order_id DESC", time());

to

  $result = db_query("SELECT * FROM {uc_recurring_users} WHERE remaining_intervals <> 0 AND next_charge <= %d AND own_handler = 0 AND fee_handler <> 'authorizenet_arb' ORDER BY order_id DESC", time());

I won't bother putting up a patch for this, since a patch really should solve the issue of why the own_handler value is not TRUE for orders placed via ARB, but maybe this puts someone else on the right track?

This code applies to uc_recurring 6.x-2.0-beta1

ShaunDychko’s picture

Status: Active » Needs work
ShaunDychko’s picture

Here's a patch anyway, just to make applying this change easier between module updates. The patch is unlikely to get committed for the reasons mentioned above, and also because the module maintainer understandably doesn't want gateway specific code in the main module.

EDIT: use the next patch. This one needs authorizenet_arb as a string.

ShaunDychko’s picture

Status: Active » Needs work
FileSize
771 bytes
duckzland’s picture

Got the same issue with paypal handler, anybody got fixes for this?