if (!empty($_SESSION['do_invoice']->authnet_login) && !empty($_SESSION['do_invoice']->authnet_merchant_id)) {
             $payment_mode = true;
         }
     }
 } else {
     if (!empty($_SESSION['do_invoice']->authnet_login) && !empty($_SESSION['do_invoice']->authnet_merchant_id)) {
         $payment_mode = true;
     }
 }
 if ($payment_mode == true) {
     $do_user_detail->free();
     $arr_user_info = $do_contact->getContactInfo_For_Invoice($do_recurrent->idcontact);
     $inv_info_arr = array();
     $inv_info_arr['description'] = $_SESSION['do_invoice']->description;
     $inv_info_arr['inv_num'] = $_SESSION['do_invoice']->num;
     $cc_number = $do_recurrent_cc->CCDecrypt($do_recurrent->cc_num);
     $payment_type = $do_recurrent->cc_type;
     $expire_year = $do_recurrent->cc_exp_year;
     $expire_month = $do_recurrent->cc_exp_mon;
     /* @param true = test mode
          @param false = non test mode i.e live  
        */
     $payment = new Authnet(false, $arr_user_info, $_SESSION['do_invoice']->authnet_login, $_SESSION['do_invoice']->authnet_merchant_id, $inv_info_arr);
     $cc_msg = $payment->validateCreditCard($cc_number, $payment_type, "", $expire_year, $expire_month, false);
     //echo '<br />'.$cc_msg;
     if ($cc_msg == "") {
         $invoice = uniqid('ofuz_', true);
         $expiration = $expire_month . $expire_year;
         $payment->transaction($cc_number, $expiration, $do_recurrent->net_total, "", $do_recurrent->idinvoice);
         $payment->process();
         if ($payment->isApproved()) {