Index: docs/hooks.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ubercart/docs/hooks.php,v
retrieving revision 1.1.2.12
diff -w -r1.1.2.12 hooks.php
659a660,661
>  *   - approved: For processes that run immediately after payment approval,
>  *       or rather a successful invocation of $op=submit
Index: payment/uc_authorizenet/uc_authorizenet.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ubercart/payment/uc_authorizenet/Attic/uc_authorizenet.admin.inc,v
retrieving revision 1.1.2.2
diff -w -r1.1.2.2 uc_authorizenet.admin.inc
10c10,12
< // Displays a form to update a subscriptions's CC info.
---
> /**
>  * Displays a form to update a subscriptions's CC info.
>  */
22c24
<     '#value' => '<div>'. t('Subscription ID: @subscription_id', array('@subscription_id' => $fee['data'])) .'</div>',
---
>     '#value' => '<div>'. t('Authorize.net ARB Subscription ID: @subscription_id', array('@subscription_id' => $fee['data']['subscriptionId'])) .'</div>',
44a47
>   $subscription_id = $fee['data']['subscriptionId'];
55c58
<   $result = uc_authorizenet_arb_update($fee['data'], $updates, $fee['order_id']);
---
>   $result = uc_authorizenet_arb_update($subscription_id, $updates, $fee['order_id']);
68c71,74
< // Displays a confirm form for cancelling a subscription.
---
> 
> /**
>  * Displays a confirm form for cancelling a subscription.
>  */
69a76,77
>   $fee = uc_recurring_fee_load('user', $rfid);
> 
75c83
<   return confirm_form($form, t('Are you sure you wish to cancel this subscription?'), 'admin/store/orders/recurring', NULL, t('Confirm'), t('Cancel'));
---
>   return confirm_form($form, t('Are you sure you wish to cancel this subscription? (ARB ID !subscriptionId)', array('!subscriptionId'=>$fee['data']['subscriptionId'])), 'admin/store/orders/recurring', NULL, t('Confirm'), t('Cancel'));
79a88
>   $subscription_id = $fee['data']['subscriptionId'];
81c90
<   $result = uc_authorizenet_arb_cancel($fee['data'], $fee['order_id'], $fee);
---
>   $result = uc_authorizenet_arb_cancel($subscription_id, $fee['order_id'], $fee);
85c94
<     drupal_set_message(t('Subscription cancelled through Authorize.Net.'));
---
>     drupal_set_message(t('Subscription !subscriptionId cancelled through Authorize.Net.', array('!subscriptionId'=>$subscription_id)));
Index: payment/uc_authorizenet/uc_authorizenet.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ubercart/payment/uc_authorizenet/uc_authorizenet.module,v
retrieving revision 1.4.2.8
diff -w -r1.4.2.8 uc_authorizenet.module
216c216,219
< // Main handler for processing credit card transactions.
---
> 
> /**
>  * Main handler for credit card transactions, usually invoked by uc_payment_process() via uc_credit_order('submit')
>  */
218,219c221,225
<   // Load the order.
<   $order = uc_order_load($order_id);
---
>   $data['amount'] = $amount;
>   $data['order'] = uc_order_load($order_id);
> 
>   // Give modules a chance to alter the nature of this transaction
>   drupal_alter('authorizenet_charge', $data);
225c231
<       return _uc_authorizenet_cim_profile_charge($order, $amount, $data);
---
>       return _uc_authorizenet_cim_profile_charge($data);
230c236
<       if ($message = _uc_authorizenet_cim_profile_create($order)) {
---
>       if ($message = _uc_authorizenet_cim_profile_create($data['order'])) {
239c245
<       return _uc_authorizenet_charge($order, $amount, $data);
---
>       return _uc_authorizenet_charge($data);
298c304
< function _uc_authorizenet_cim_profile_charge($order, $amount, $data) {
---
> function _uc_authorizenet_cim_profile_charge($data) {
300a307,308
>   $order = $data['order'];
>   $amount = $data['amount'];
419c427
< function _uc_authorizenet_charge($order, $amount, $data) {
---
> function _uc_authorizenet_charge($data) {
420a429,430
>   $order = $data['order'];
>   $amount = $data['amount'];
433a444
>     'data' => $data,
542a554,555
>   //drupal_set_message(kpr(array($data, $submit_data, $response), true));
> 
618a632,636
> 
> 
> 
> 
> 
620c638
<  * Implementation of hook_recurring_fee().
---
>  * Callback function for setting up a recurring fee
622c640
< function uc_authorizenet_recurring_fee($order, $fee) {
---
> function uc_recurring_authorizenet_fee($order, &$fee) {
624a643
>     // @todo: is it true then that one can't process recurring fees using authorizenet unless they're enrolled in ARB?
627,628c646,650
< 
<   return uc_authorizenet_arb_create($order, $fee);
---
>   else {
>     if ($result = uc_authorizenet_arb_create($order, $fee)) {
>       $fee->fee_handler = 'authorizenet_arb';
>       return $result;
>     }
629a652,654
> }
> 
> 
632c657
<  * Implementation of hook_recurring_fee_ops().
---
>  * Callback for uc_recurring_fee_ops().
634c659
< function uc_authorizenet_recurring_fee_ops($context, $fee) {
---
> function uc_recurring_authorizenet_arb_fee_ops($context, &$fee) {
657a683,692
> 
> /**
>  * Callback to process a recurring renewal
>  */
> function uc_recurring_authorizenet_arb_renew($order, $fee) {
>   return TRUE; // renewals handled by authorize.net, so we don't need to so anything here
> }
> 
> 
> 
734c769
<   if ($length <= 0 || $unit == 'days' && $length > 365 || $unit == 'months' && $length > 12) {
---
>   if ($length <= 0 || ($unit == 'days' && $length >= 365) || ($unit == 'months' && $length >= 12)) {
792a828
> 
814a851
> 
816a854
>   //drupal_set_message(kpr(array($order,$data,$server,$xml,$response), true));
829a868,869
>   else {
>     $data['order_comment_extra'] = t('Authorize.net subscription ID !subscriptionId', array('!subscriptionId' => $data['subscriptionId']));
831,848c871,872
<   $user_fee = array(
<     'rfid' => 0,
<     'uid' => $order->uid,
<     'fee_handler' => 'uc_authorizenet',
<     'next_charge' => strtotime('+'. $fee->initial_charge),
<     'fee_amount' => $fee->fee_amount,
<     'regular_interval' => $fee->regular_interval,
<     'remaining_intervals' => $fee->number_intervals,
<     'charged_intervals' => 0,
<     'order_id' => $order->order_id,
<     'data' => $data['subscriptionId'],
<   );
< 
<   uc_recurring_fee_save('user', $user_fee);
< 
<   uc_order_comment_save($order->order_id, 0, t('Authorize.Net: Recurring fee setup for @model.<br />Subscription ID: @subscription_id', array('@model' => $fee->model, '@subscription_id' => $data['subscriptionId'])), 'admin');
< 
<   return TRUE;
---
>     return $data;
>   }
871c895
<     'refId' => substr($order->order_id .'-'. time(), 0, 20),
---
>     'refId' => substr($order_id .'-'. time(), 0, 20),
896c920
< 
---
>   else {
899c923,924
<   return TRUE;
---
>     return $data;
>   }
919c944
<     'refId' => substr($order->order_id .'-'. time(), 0, 20),
---
>     'refId' => substr($order_id .'-'. time(), 0, 20),
933a959,960
>   //drupal_set_message(kpr(array($data,$xml,$response),true));
> 
Index: payment/uc_authorizenet/uc_authorizenet.pages.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ubercart/payment/uc_authorizenet/Attic/uc_authorizenet.pages.inc,v
retrieving revision 1.1.2.2
diff -w -r1.1.2.2 uc_authorizenet.pages.inc
33c33
<       $fee = db_fetch_array(db_query("SELECT * FROM {uc_recurring_users} WHERE fee_handler = 'uc_authorizenet' AND data = '%s'", $_POST['x_subscription_id']));
---
>       $fee = uc_recurring_find_fee($fee_handler, $_POST['x_subscription_id']);
35,39c35,36
<       // Only process if the fee actually exists!
<       if (!empty($fee)) {
<         // Update the interval counters.
<         $fee['remaining_intervals'] -= 1;
<         $fee['charged_intervals'] += 1;
---
>       if ($fee) {
>         uc_recurring_renew($fee);
41,45c38,42
<         // Set the next expected charge time.
<         $fee['next_charge'] = strtotime('+'. $fee['regular_interval'], $fee['next_charge']);
< 
<         // Save the new values.
<         uc_recurring_fee_save('user', $fee);
---
>         // enter the payment.
>         $message = t('!amount recurring fee processed by authorize.net.', array('!amount' => $_POST['x_amount']));
>         $data = array('module' => 'uc_authorizenet',
>                       'subscription id' => $_POST['x_subscription_id']);
>         uc_payment_enter($fee['order_id'], 'credit', $_POST['x_amount'], 0, $data, $message);
98a96
>   $subscription_id = $fee['data']['subscriptionId'];
109c107
<   $result = uc_authorizenet_arb_update($fee['data'], $updates, $fee['order_id']);
---
>   $result = uc_authorizenet_arb_update($subscription_id, $updates, $fee['order_id']);
137a136
>   $subscription_id = $fee['data']['subscriptionId'];
139c138
<   $result = uc_authorizenet_arb_cancel($fee['data'], $fee['order_id'], $fee);
---
>   $result = uc_authorizenet_arb_cancel($subscription_id, $fee['order_id'], $fee);
Index: payment/uc_credit/test_gateway.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ubercart/payment/uc_credit/test_gateway.module,v
retrieving revision 1.1.2.6
diff -w -r1.1.2.6 test_gateway.module
69a70,163
> 
> /**
>  * Callback to process a recurring renewal
>  */
> function uc_recurring_test_gateway_renew($order, $fee) {
>   if ($key = uc_credit_encryption_key()) {
>     $crypt = new uc_encryption_class;
>     $fee['data']['payment_details']['cc_number'] = $crypt->decrypt($key, $fee['data']['payment_details']['cc_number']);
>     if (variable_get('uc_credit_debug', FALSE)) {
>       $fee['data']['payment_details']['cc_cvv'] = $crypt->decrypt($key, $fee['data']['payment_details']['cc_cvv']);
>     }
>     $fee['data']['payment_details']['cc_exp_month'] = $crypt->decrypt($key, $fee['data']['payment_details']['cc_exp_month']);
>     $fee['data']['payment_details']['cc_exp_year'] = $crypt->decrypt($key, $fee['data']['payment_details']['cc_exp_year']);
>     uc_store_encryption_errors($crypt, 'uc_recurring');
>   }
> 
>   // Cache the CC details stored by the handler.
>   uc_credit_cache('save', $fee['data']['payment_details'], FALSE);
> 
>   // Run the charge.
>   $result = test_gateway_charge($fee['order_id'], $fee['fee_amount'], NULL);
> 
>   // Handle the result.
>   if ($result['success'] === TRUE) {
>     uc_payment_enter($fee['order_id'], 'credit', $fee['fee_amount'], 0, $result['data'], t('Recurring fee payment.') .'<br />'. $result['comment']);
>   }
>   else {
>   }
> 
>   return $result['success'];
> }
> 
> /**
>  * Callback function for setting up a recurring fee
>  */
> function uc_recurring_test_gateway_fee($order, &$fee) {
>   $data = array(
>     'billing_first_name' => $order->billing_first_name,
>     'billing_last_name' => $order->billing_last_name,
>     'billing_phone' => $order->billing_phone,
>     'billing_company' => $order->billing_company,
>     'billing_street1' => $order->billing_street1,
>     'billing_street2' => $order->billing_street2,
>     'billing_city' => $order->billing_city,
>     'billing_zone' => $order->billing_zone,
>     'billing_postal_code' => $order->billing_postal_code,
>     'billing_country' => $order->billing_country,
>     'payment_details' => $order->payment_details,
>     'model' => $fee->model,
>   );
> 
>   if ($key = uc_credit_encryption_key()) {
>     $crypt = new uc_encryption_class;
>     $data['payment_details']['cc_number'] = $crypt->encrypt($key, $data['payment_details']['cc_number'], 32);
>     if (variable_get('uc_credit_debug', FALSE)) {
>       $data['payment_details']['cc_cvv'] = $crypt->encrypt($key, $data['payment_details']['cc_cvv'], 32);
>     }
>     $data['payment_details']['cc_exp_month'] = $crypt->encrypt($key, $data['payment_details']['cc_exp_month'], 32);
>     $data['payment_details']['cc_exp_year'] = $crypt->encrypt($key, $data['payment_details']['cc_exp_year'], 32);
>     uc_store_encryption_errors($crypt, 'uc_recurring');
> 
>     // need to set gateway specific fee information for renewals
>     $fee->fee_handler = 'test_gateway';
>     $fee->data = $data;
>   }
> 
>   return TRUE;
> }
> 
> /**
>  * Callback for uc_recurring_fee_ops().
>  */
> function uc_recurring_test_gateway_fee_ops($context, $fee) {
>   $ops = array();
> 
>   switch ($context) {
>     case 'fee_admin':
>       if ($fee['remaining_intervals'] > 0) {
>         $ops[] = l(t('edit'), 'admin/store/orders/recurring/'. $fee['rfid'] .'/edit');
>         $ops[] = l(t('cancel'), 'admin/store/orders/recurring/'. $fee['rfid'] .'/cancel');
>       }
>       else {
>         $ops[] = l(t('delete'), 'admin/store/orders/recurring/'. $fee['rfid'] .'/delete');
>       }
>       break;
>     case 'user':
>       $ops[] = l(t('Cancel'), 'user/'. $fee['uid'] .'/recurring/'. $fee['rfid'] .'/cancel');
>       break;
>   }
> 
>   return $ops;
> }
>   
> 
Index: payment/uc_credit/uc_credit.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ubercart/payment/uc_credit/uc_credit.module,v
retrieving revision 1.5.2.14
diff -w -r1.5.2.14 uc_credit.module
369c369
<       $title .= ' <img src="'. $path .'/images/'. $type .'.gif" style="position: relative; top: 5px;">';
---
>       $title .= ' <img src="'. $path .'/images/'. $type .'.gif" alt="'. $type .'" style="position: relative; top: 5px;" />';
385d384
< 
873a873,900
> 
> /**
>  * Callback function for setting up a recurring credit card fee
>  */
> function uc_recurring_credit_fee($order, &$fee) {
>   $handler = uc_credit_default_gateway();
>   $func = 'uc_recurring_'. $handler .'_fee';
>   if (function_exists($func)) {
>     if (!$fee->fee_handler) { $fee->fee_handler = $handler; }
>     return $func($order, $fee);
>   }
>   // no available recurring fee handler for the default credit card gateway
>   return FALSE;
> }
> 
> /**
>  * Callback function for retrieving possible operations for a recurring fee
>  */
> function uc_recurring_credit_fee_ops($context, &$fee) {
>   $handler = 'uc_recurring_'. uc_credit_default_gateway() .'_fee_ops';
>   if (function_exists($handler)) {
>     return $handler($conext, $fee);
>   }
>   // no available recurring fee handler for the default credit card gateway
>   return FALSE;
> }
> 
> 
1092c1119
<                 .' <img src="'. $path .'/images/info.png" onclick="cvv_info_popup();" style="cursor: pointer; position: relative; top: 3px;"> <a style="cursor: pointer; font-weight: normal;" onclick="cvv_info_popup();">'
---
>                 .' <img src="'. $path .'/images/info.png" onclick="cvv_info_popup();" alt="" style="cursor: pointer; position: relative; top: 3px;" /> <a style="cursor: pointer; font-weight: normal;" onclick="cvv_info_popup();">'
Index: payment/uc_payment/uc_payment.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ubercart/payment/uc_payment/uc_payment.module,v
retrieving revision 1.5.2.10
diff -w -r1.5.2.10 uc_payment.module
482a483,485
>     // Helpful: for uc_credit and uc_authorizenet together, this would invoke uc_authorizenet_charge
>     // because $method would be 'credit', and uc_authorizenet_payment_gateway returns 'uc_authorizenet_charge'
>     // for that array key
Index: payment/uc_payment_pack/uc_payment_pack.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ubercart/payment/uc_payment_pack/uc_payment_pack.module,v
retrieving revision 1.6.2.7
diff -w -r1.6.2.7 uc_payment_pack.module
372a373,425
> /**
>  * Callback for setting up a manual recurring fee using check as payment method.
>  */
> function uc_recurring_check_fee($order, &$fee) {
>   $fee->fee_handler = 'manual';
>   return TRUE;
> }
> 
> /**
>  * Callback for setting up a manual recurring fee using cod as payment method.
>  */
> function uc_recurring_cod_fee($order, &$fee) {
>   $fee->fee_handler = 'manual';
>   return TRUE;
> }
> 
> /**
>  * Callback for setting up a manual recurring fee using other as payment method.
>  */
> function uc_recurring_other_fee($order, &$fee) {
>   $fee->fee_handler = 'manual';
>   return TRUE;
> }
> 
> /**
>  * Callback for processing a renewal for recurring fee
>  */
> function uc_recurring_manual_renew($order, &$fee) {
>   return TRUE;
> }
> 
> /**
>  * Callback for processing a renewal for recurring fee
>  */
> function uc_recurring_manual_fee_ops($context, $fee) {
>   $ops = array();
>   switch ($context) {
>     case 'fee_admin':
>       if ($fee['remaining_intervals'] > 0) {
>         $ops[] = l(t('edit'), 'admin/store/orders/recurring/'. $fee['rfid'] .'/edit');
>         $ops[] = l(t('cancel'), 'admin/store/orders/recurring/'. $fee['rfid'] .'/cancel');
>       }
>       else {
>         $ops[] = l(t('delete'), 'admin/store/orders/recurring/'. $fee['rfid'] .'/delete');
>       }
>       break;
>     case 'user':
>       $ops[] = l(t('Cancel'), 'user/'. $fee['uid'] .'/recurring/'. $fee['rfid'] .'/cancel');
>       break;
>   }
> 
>   return $ops;
> }
Index: uc_cart/uc_cart.pages.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ubercart/uc_cart/Attic/uc_cart.pages.inc,v
retrieving revision 1.1.2.12
diff -w -r1.1.2.12 uc_cart.pages.inc
441a442,444
>   // Invoke hook_order first with $op=submit and then if no problems,
>   // again with $op=approved
>   foreach (array('submit', 'approved') as $op) {
444c447
<     $result = module_invoke($module, 'order', 'submit', $order, NULL);
---
>       $result = module_invoke($module, 'order', $op, $order, NULL);
459a463,466
>     if ($error) {
>       break;
>     }
>   }
Index: uc_product/uc_product.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ubercart/uc_product/uc_product.module,v
retrieving revision 1.14.2.25
diff -w -r1.14.2.25 uc_product.module
1419a1420
>   module_load_include('inc', 'uc_store', 'includes/uc_price');
