コード例 #1
0
ファイル: PayqrOrder.php プロジェクト: rakot9/diafanpayqr
 /**
  * Получает стоимость товара с учетом скидки
  * @param int $id
  * @return int
  */
 private function _dfnGetProductPrice($id)
 {
     Custom::inc('modules/shop/inc/shop.inc.price.php');
     $shopIncPrice = new Shop_inc_price($this->diafan);
     $price = $shopIncPrice->get((int) $id, array());
     unset($shopIncPrice);
     return (double) (isset($price['price']) ? $price['price'] : 0);
 }
コード例 #2
0
ファイル: handler.php プロジェクト: rakot9/diafanpayqr
    define('REVATIVE_PATH', '');
    define('BASE_PATH', "http" . (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? "s" : '') . "://" . getenv("HTTP_HOST") . "/" . (REVATIVE_PATH ? REVATIVE_PATH . '/' : ''));
    define('ABSOLUTE_PATH', dirname(__FILE__) . '/../');
    define('BASE_PATH_HREF', BASE_PATH . "registration/");
    //define('BASE_URL', ($domain ? $domain : getenv("HTTP_HOST")).(REVATIVE_PATH ? '/'.REVATIVE_PATH : ''));
    define('BASE_URL', getenv("HTTP_HOST") . (REVATIVE_PATH ? '/' . REVATIVE_PATH : ''));
    include_once ABSOLUTE_PATH . 'includes/custom.php';
    include_once ABSOLUTE_PATH . 'includes/developer.php';
    include_once ABSOLUTE_PATH . 'includes/diafan.php';
    include_once ABSOLUTE_PATH . 'includes/file.php';
    Dev::init();
    include_once ABSOLUTE_PATH . 'config.php';
    include_once ABSOLUTE_PATH . 'includes/core.php';
    include_once ABSOLUTE_PATH . 'includes/init.php';
    $diafan = new Init();
    Custom::inc('includes/controller.php');
    Custom::inc('includes/model.php');
    Custom::inc('includes/action.php');
    Custom::inc('includes/controller.php');
    Custom::inc('includes/model.php');
    Custom::inc('includes/action.php');
    $receiver = new PayqrReceiver();
    $receiver->handle($diafan);
} catch (PayqrExeption $e) {
    PayqrLog::log($e->response);
}
function encrypt($text)
{
    //return md5($text);
    return $text;
}
コード例 #3
0
<?php

if (!defined('DIAFAN')) {
    include dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/includes/404.php';
}
if (empty($_REQUEST["order_id"])) {
    Custom::inc('includes/404.php');
}
$pay = $this->diafan->_payment->check_pay($_REQUEST["order_id"], 'rficb');
$in_data = array('tid' => $_REQUEST['tid'], 'name' => $_REQUEST['name'], 'comment' => $_REQUEST['comment'], 'partner_id' => $_REQUEST['partner_id'], 'service_id' => $_REQUEST['service_id'], 'order_id' => $_REQUEST['order_id'], 'type' => $_REQUEST['type'], 'partner_income' => $_REQUEST['partner_income'], 'system_income' => $_REQUEST['system_income'], 'test' => $_REQUEST['test']);
$my_crc = md5(implode('', array_values($in_data)) . $pay["params"]['rficb_skey']);
$out_summ = $_REQUEST["partner_income"];
$crc = $_REQUEST["check"];
if ($_GET["rewrite"] == "rficb/result") {
    if ($my_crc != $crc) {
        echo "bad sign\n";
        exit;
    }
    if (sprintf('%0.2f', $_REQUEST['system_income']) < sprintf('%0.2f', $pay['summ'])) {
        echo "Неверная сумма";
    } else {
        $this->diafan->_payment->success($pay, 'pay');
        echo "OK" . $pay["id"] . "\n";
    }
    exit;
}
if ($_GET["rewrite"] == "rficb/success") {
    if ($my_crc == $crc) {
        $this->diafan->_payment->success($pay, 'redirect');
    }
}
コード例 #4
-1
ファイル: dfnUserAuth.php プロジェクト: rakot9/diafanpayqr
 public function CreateUser($email)
 {
     $_POST["name"] = $email;
     $_POST["mail"] = $email;
     //Пароль 123qwe123
     $_POST["password"] = "******";
     //Пароль 123qwe123
     $_POST["password2"] = "5667a84c6f63b6cbcd87f974c4fc032e";
     $_POST["fio"] = "PayQR";
     $_POST["action"] = "add";
     $_POST["phone"] = "";
     /**
      * Отключаем каптчу временно для модуля
      */
     //в таблице diafan_config ищем модуль users по полю name='captcha'
     DB::query("UPDATE {config} SET name='%s' WHERE module_name='users' AND name='captcha'", "c_aptcha");
     $module = 'registration';
     $this->diafan->_site->module = $module;
     $this->diafan->current_module = $module;
     Custom::inc('modules/' . $module . '/' . $module . '.php');
     $registration = new Registration($this->diafan);
     $registration->action();
     /**
      * Включаем снова каптчу
      */
     DB::query("UPDATE {config} SET name='%s' WHERE module_name='users' AND name='c_aptcha'", "captcha");
     return $this->getUserId($email);
 }