* but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * @category  PayIntelligent
 * @package   ratepay
 * @copyright (C) 2012 PayIntelligent GmbH  <http://www.payintelligent.de/>
 * @license   GPLv2
 */
/**
 * RatePAY order script calls the right controller action for RatePAY order operations
 */
require_once 'includes/application_top.php';
require_once '../includes/classes/ratepay/helpers/Data.php';
require_once '../includes/classes/ratepay/helpers/Globals.php';
require_once '../includes/classes/ratepay/controllers/OrderController.php';
if (Globals::hasPostEntry('order_number')) {
    if (Globals::hasPostEntry('ship')) {
        OrderController::deliverAction();
    } elseif (Globals::hasPostEntry('cancel')) {
        OrderController::cancelAction();
    } elseif (Globals::hasPostEntry('refund')) {
        OrderController::refundAction();
    } elseif (Globals::hasPostEntry('credit')) {
        OrderController::creditAction();
    } else {
        die('Operation not found!');
    }
} else {
    die('Missing post param "order_number"!');
}
Ejemplo n.º 2
0
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License, version 2, as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * @category  PayIntelligent
 * @package   ratepay
 * @copyright (C) 2012 PayIntelligent GmbH  <http://www.payintelligent.de/>
 * @license   GPLv2
 */
/**
 * Delete logging script
 */
require_once 'includes/application_top.php';
require_once '../includes/classes/ratepay/helpers/Data.php';
require_once '../includes/classes/ratepay/helpers/Globals.php';
if (Globals::hasPostEntry('submit')) {
    $days = Globals::getPostEntry('days');
    if (preg_match("/^[0-9]{1,2}\$/", $days)) {
        if ($days == 0) {
            tep_db_query("delete from ratepay_log");
        } else {
            tep_db_query("DELETE FROM ratepay_log WHERE TO_DAYS(now()) - TO_DAYS(date) > " . (int) $days);
        }
    }
}
tep_redirect(tep_href_link('ratepay_logging.php', 'success=1', 'SSL'));
Ejemplo n.º 3
0
 /**
  * Is called after checkout_payment.php is confirmed,
  * checks if all needed customer data available or 
  * redirect the customer to the checkout_payment.php
  * with a error message otherwise the user get to the
  * ratepay terms page
  * 
  * @global order $order
  */
 public function pre_confirmation_check()
 {
     global $order;
     if (!$this->isInfoVisited()) {
         if ($this->_isPhoneNeeded()) {
             if (Globals::hasPostEntry($this->code . '_phone') && !Data::betterEmpty(Globals::getPostEntry($this->code . '_phone'))) {
                 $phone = Globals::getPostEntry($this->code . '_phone');
                 if ($this->_isPhoneValid($phone)) {
                     Db::setXtCustomerEntry(Session::getSessionEntry('customer_id'), 'customers_telephone', $phone);
                     $order->customer['telephone'] = $phone;
                 } else {
                     $this->error['PHONE'] = 'INVALID';
                 }
             } else {
                 $this->error['PHONE'] = 'MISSING';
             }
         }
         if ($this->_isDobNeeded()) {
             if (Globals::hasPostEntry($this->code . '_birthdate') && !Data::betterEmpty(Globals::getPostEntry($this->code . '_birthdate'))) {
                 $dob = Globals::getPostEntry($this->code . '_birthdate');
                 if (!$this->_isDobValid($dob)) {
                     $this->error['DOB'] = 'INVALID';
                 } elseif (!$this->_isAdult($dob)) {
                     $this->error['DOB'] = 'YOUNGER';
                 } else {
                     $dobArr = explode('.', $dob);
                     $dateStr = $dobArr[2] . "-" . $dobArr[1] . "-" . $dobArr[0] . " 00:00:00";
                     Db::setXtCustomerEntry(Session::getSessionEntry('customer_id'), 'customers_dob', $dateStr);
                 }
             } else {
                 $this->error['DOB'] = 'MISSING';
             }
         }
         if ($this->_isCompanyNeeded()) {
             if (Globals::hasPostEntry($this->code . '_company') && !Data::betterEmpty(Globals::getPostEntry($this->code . '_company'))) {
                 $company = Globals::getPostEntry($this->code . '_company');
                 $order->customer['company'] = $company;
                 $order->billing['company'] = $company;
                 $dbInput = tep_db_input(Db::getXtCustomerEntry(Session::getSessionEntry('customer_id'), 'customers_default_address_id'));
                 tep_db_query("UPDATE " . TABLE_ADDRESS_BOOK . " " . "SET entry_company = '" . tep_db_prepare_input($company) . "' " . "WHERE address_book_id = '" . $dbInput . "'");
             } else {
                 $this->error['VATID'] = 'MISSING';
             }
         }
         if ($this->_isVatIdNeeded()) {
             if (Globals::hasPostEntry($this->code . '_vatid') && !Data::betterEmpty(Globals::getPostEntry($this->code . '_vatid'))) {
                 Db::setXtCustomerEntry(Session::getSessionEntry('customer_id'), 'customers_vat_id', Globals::getPostEntry($this->code . '_vatid'));
             } else {
                 $this->error['VATID'] = 'MISSING';
             }
         }
         if (empty($this->error)) {
             $this->setInfoVisited(true);
             Session::setRpSessionEntry('basketAmount', Data::getBasketAmount($order));
             //$url = tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL');
             $url = tep_href_link($this->_getNextStepPayment(), '', 'SSL');
         } else {
             $this->error = urlencode($this->_getErrorString($this->error));
             $url = tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . $this->error, 'SSL');
         }
         tep_redirect($url);
     }
 }