--- uc_recurring_hosted-new.module 2011-04-24 18:30:06.000000000 +0530 +++ uc_recurring_hosted.module 2010-12-09 04:35:27.000000000 +0530 @@ -555,8 +555,7 @@ uc_order_update_status($order->order_id, 'paypal_pending'); return TRUE; } - //uc_order_update_status($order->order_id, 'paypal_pending'); - return TRUE; + return FALSE; } /** @@ -570,46 +569,15 @@ * same trick to alter the paypal form, its a messy hack but works for now. */ function uc_recurring_hosted_form_uc_paypal_wps_form_alter(&$form, $form_state) { - /** - Hack code for proper working of paypal wps recurring - START - **/ - unset($form['no_note']); - unset($form['no_shipping']); - unset($form['rm']); - unset($form['handling_cart']); - unset($form['invoice']); - unset($form['tax_cart']); - unset($form['upload']); - unset($form['lc']); - unset($form['address1']); - unset($form['city']); - unset($form['country']); - unset($form['email']); - unset($form['first_name']); - unset($form['last_name']); - unset($form['state']); - unset($form['zip']); - unset($form['night_phone_a']); - unset($form['night_phone_b']); - unset($form['night_phone_c']); - unset($form['address_override']); - unset($form['amount_1']); - unset($form['item_name_1']); - unset($form['on0_1']); - unset($form['os0_1']); - /** - END - **/ $order = $form['#parameters'][2]; $recurring_fees = array(); // if recurring fees exist in the order if (module_exists('uc_recurring_product')) { // uc_recurring_products support - $order->paypal_wps_recurring = TRUE; $recurring_fees = uc_recurring_product_get_recurring_products_in_order($order); } + if (count($recurring_fees) > 0) { // TODO: what do we do if someone tries to order more then one subscription?? // we will just process the first for now @@ -617,6 +585,7 @@ if (count($recurring_fees) > 1) { drupal_set_message(t('Sorry recurring payments can only be setup for one product at a time when paying via paypal, only the first recurring payment will be setup when you click on Submit order.'), 'warning'); } + // IPN control notify URL $data['notify_url'] = url('uc_recurring_hosted/paypal/ipn/'. $order->order_id, array('absolute' => TRUE));