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); } }
/** * Parse response */ public function parseResponse($params) { foreach ($params as $k => $v) { JHotelReservationModelVariables::writeMessage("Response param: " . $k . ' ' . $v); } $this->amount = $params["brq_amount"]; $this->currencyCode = $params["brq_currency"]; $this->transactions = $params["brq_transactions"]; $this->invoiceNumber = $params["brq_invoicenumber"]; $this->responseCode = $params["brq_statuscode"]; $this->responseMessage = $params["brq_statusmessage"]; $this->transactionTime = $params["brq_timestamp"]; if (isset($params["brq_payment"])) { $this->paymentId = $params["brq_payment"]; } if (isset($params["brq_payment_method"])) { $this->paymentMethod = $params["brq_payment_method"]; } }
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; }
private function showPaymentResult($confirmationId, $success) { JHotelReservationModelVariables::writeMessage(" call function showPaymentResult() - confirmationId: " . $confirmationId); $tipOper = 5; $view = "confirmation"; if ($success == 'false') { $tipOper = 4; $view = "guestinformation"; } JRequest::setVar('tip_oper', $tipOper); try { $modelVariables = new JHotelReservationModelVariables(); if (!$modelVariables->load($confirmationId, null, null)) { throw new Exception(JText::_('LNG_CANNOT_LOAD_MODEL', true)); } $view = $this->getView($view); $view->setModel($modelVariables, true); $view->display(); } catch (Exception $e) { JHotelReservationModelVariables::writeMessage("Error accured processing showPaymentResult()- 4B Spain function."); JHotelReservationModelVariables::writeMessage("Error: " . $e); JRequest::setVar('tip_oper', 0); $this->display(); return; } }