示例#1
0
 function cleanSameReservationPending($email, $datas, $datae, $key_control_reservation)
 {
     $query = " \tSELECT \r\n\t\t\t\t\t\tc.confirmation_id,\r\n\t\t\t\t\t\tc.email,\r\n\t\t\t\t\t\thp.paymentprocessor_type \tAS type\r\n\t\t\t\t\tFROM #__hotelreservation_confirmations c\r\n\t\t\t\t\tINNER JOIN #__hotelreservation_confirmations_payments\tcp USING( confirmation_id )\r\n\t\t\t\t\tINNER JOIN #__hotelreservation_paymentprocessors\t\thp USING( paymentprocessor_id )\r\n\t\t\t\t\tWHERE \r\n\t\t\t\t\t\tc.datas='{$datas}'\r\n\t\t\t\t\t\tAND\r\n\t\t\t\t\t\tc.datae='{$datae}'\r\n\t\t\t\t\t\tAND\r\n\t\t\t\t\t\tc.email='{$email}'\r\n\t\t\t\t\t\tAND\t\t\t\t\t\t\r\n\t\t\t\t\t\thp.paymentprocessor_type ='" . PROCESSOR_PAYPAL_EXPRESS . "'\r\n\t\t\t\t\t\tAND\t\t\t\t\t\t\r\n\t\t\t\t\t\tcp.payment_status ='" . PAYMENT_STATUS_PENDING . "'\r\n\t\t\t\t\t\tAND\r\n\t\t\t\t\t\tkey_control_reservation = '{$key_control_reservation}'\r\n\t\t\t\t\tGROUP BY c.confirmation_id\r\n\t\t\t\t\tORDER BY hp.paymentprocessor_name\r\n\t\t\t\t\t";
     $this->_db->setQuery($query);
     $reservations_unwanted =& $this->_getList($query);
     foreach ($reservations_unwanted as $res) {
         // dbg($res);
         if (LOGGER_PAYPAL_EXPRESS) {
             JHotelReservationModelVariables::writeMessage("\r\nFile:" . __FILE__ . "\r\nLine:" . __LINE__ . "\r\nFunction:" . __FUNCTION__ . "\r\n ID=" . $res->confirmation_id . '\\r\\nInfo:delete pending', 1);
         }
         JHotelReservationModelVariables::deletePendingConfirmation($res->confirmation_id, $res->email, $res->type, false, false);
     }
 }
 function cancelPayment($confirmationId)
 {
     JHotelReservationModelVariables::writeMessage('processing cancelPayment() function');
     try {
         JRequest::setVar('tip_oper', 4);
         $modelVariables = new JHotelReservationModelVariables();
         if (!$modelVariables->load($confirmationId, null, null)) {
             JHotelReservationModelVariables::writeMessage('processErr');
             exit;
         }
         //canceled, sending email
         if ($modelVariables->itemAppSettings->is_email_notify_canceled_pending == true) {
             $modelVariables->sendCancelPendingEmail($confirmationId, CANCELED_PENDING_ID);
         }
         //~canceled, sending email
         JHotelReservationModelVariables::deletePendingConfirmation($confirmationId, null, null, false, false);
     } catch (Exception $e) {
         JHotelReservationModelVariables::writeMessage("Error accured processing cancelPayment() function. ");
     }
     die;
 }