Esempio n. 1
0
    <tbody>
        <tr class="b-layout__tr">
            <td class="b-layout__td b-layout__td_padright_20">
                <div class="b-fon b-fon_bg_fff9bf b-fon_pad_10 b-fon_padleft_35">
                    <div class="b-layout__txt b-layout__txt_fontsize_11 b-layout__txt_bold"><span class="b-icon b-icon_sbr_oattent b-icon_margleft_-20"></span>Обратите внимание</div>
                    <div class="b-layout__txt b-layout__txt_fontsize_11">— Оплата услуг производится в течение 2-3 минут.</div> 
                    <div class="b-layout__txt b-layout__txt_fontsize_11">— После нажатия на кнопку Оплатить вы будете перенаправлены в платежную систему WebMoney.</div>
                </div>
                <form id="<?php 
echo $type_payment;
?>
" name="<?php 
echo $type_payment;
?>
" method="post" action="<?php 
echo is_release() ? 'https://paymaster.ru/Payment/Init' : '/bill/test/wmpay.php';
?>
">
                    <input type="hidden" name="LMI_MERCHANT_ID" value="<?php 
echo $bill->pm->merchants[pmpay::MERCHANT_BILL];
?>
" />
                    <input type="hidden" name="LMI_PAYMENT_AMOUNT" id="ammount" value="<?php 
echo $payment_sum;
?>
" />
                    <input type="hidden" name="LMI_CURRENCY" value="RUB" />
                    <input type="hidden" name="LMI_PAYMENT_DESC_BASE64" value="<?php 
echo base64_encode(iconv('CP1251', 'UTF-8', 'Оплата за услуги сайта www.free-lance.ru, в том числе НДС - 18%. Счет #' . $bill->acc['id'] . ', логин ' . $bill->user['login']));
?>
" />
Esempio n. 2
0
 /**
  * ¬озвращает список публичных типовых услуг по заданным услови¤м и пагинацией
  * 
  * @return array
  */
 public function getList($excluded_ids = array())
 {
     $criteria = array($this->category_id, $this->city_id, $this->country_id, $this->keywords, $this->limit, $this->offset, $this->price_ranges, $this->price_max, $this->order, $excluded_ids, $this->user_id);
     $membuf = new memBuff();
     $memkey = __METHOD__ . '#' . md5(serialize($criteria));
     if (false !== ($result = $membuf->get($memkey)) && is_release()) {
         return $result;
     }
     $sort = $this->getSort();
     # @see http://sphinxsearch.com/forum/view.html?id=11538 about city = x or country = y
     $sphinxClient = new SphinxClient();
     $sphinxClient->SetServer(SEARCHHOST, SEARCHPORT);
     $sphinxClient->SetLimits($this->offset, $this->limit, 20000);
     $sphinxClient->SetSortMode(SPH_SORT_EXTENDED, $sort);
     $sphinxClient->SetFieldWeights(array('title' => 2, 'extra_title' => 1));
     //$sphinxClient->SetRankingMode(SPH_RANK_PROXIMITY_BM25);
     $selectExpression = '*';
     // все колонки
     if ($this->user_id) {
         $selectExpression .= ", IF(user_id = {$this->user_id}, 1, 0) as match_user";
         $sphinxClient->setFilter('match_user', array(1));
     }
     if ($this->category_id) {
         $selectExpression .= ", IF(category_id = {$this->category_id} or category_parent_id = {$this->category_id}, 1, 0) as match_category";
         $sphinxClient->setFilter('match_category', array(1));
     }
     if ($this->country_id) {
         $selectExpression .= ", IF(user_country_id = {$this->country_id} or country_id = {$this->country_id}, 1, 0) as match_country";
         $sphinxClient->setFilter('match_country', array(1));
     }
     if ($this->city_id) {
         $selectExpression .= ", IF(user_city_id = {$this->city_id} or city_id = {$this->city_id}, 1, 0) as match_city";
         $sphinxClient->setFilter('match_city', array(1));
     }
     if (count($this->price_ranges)) {
         $match_price_exprs = array();
         foreach ($this->getPriceRanges() as $i => $price_range) {
             if (!isset($this->price_ranges[$i])) {
                 continue;
             }
             $match_price_exprs[] = "price_{$i} = 1";
         }
         $match_price_exprs = implode(' or ', $match_price_exprs);
         $selectExpression .= ", IF({$match_price_exprs}, 1, 0) as match_price";
         $sphinxClient->setFilter('match_price', array(1));
     }
     if ($this->price_max > 0) {
         $selectExpression .= ", IF(price <= {$this->price_max}, 1, 0) as match_price_max";
         $sphinxClient->setFilter('match_price_max', array(1));
     }
     $searchString = '';
     if (!empty($this->keywords)) {
         $keywords = implode(' ', array_filter(preg_split('/\\s*,\\s*/', $this->keywords)));
         $searchString = trim($keywords);
         //$searchString = $this->GetSphinxKeyword($searchString);
         $sphinxClient->SetMatchMode(SPH_MATCH_ANY);
         //SPH_MATCH_EXTENDED2);
     }
     if (count($excluded_ids)) {
         $sphinxClient->setFilter('tservice_id', $excluded_ids, true);
     }
     $sphinxClient->SetSelect($selectExpression);
     $queryResult = $sphinxClient->query($searchString, "tservices;delta_tservices");
     //echo '<pre>error: ', $sphinxClient->GetLastError(), '</pre>';
     //echo '<pre>warn : ', $sphinxClient->GetLastWarning(), '</pre>';
     $list = array();
     $total = 0;
     if (isset($queryResult['matches'])) {
         foreach ($queryResult['matches'] as $id => $row) {
             $row['attrs']['id'] = $id;
             $list[] = $row['attrs'];
         }
         $total = $queryResult['total_found'] < $queryResult['total'] ? $queryResult['total_found'] : $queryResult['total'];
     }
     $result = array('list' => $list, 'total' => $total);
     if ($this->_ttl) {
         $membuf->set($memkey, $result, $this->_ttl);
     }
     return $result;
 }
Esempio n. 3
0
<?php

/**
 * Эмуляция ответа от ЯД при запросах на выплату.
 */
require_once __DIR__ . '/../../classes/stdf.php';
require_once ABS_PATH . '/classes/YandexMoney3/Utils/Array2XML.php';
use YandexMoney3\Utils\Array2XML;
if (is_release()) {
    exit;
}
$method = __paramInit('string', 'm', null, null);
$bodyRaw = file_get_contents('php://input');
if (empty($bodyRaw)) {
    exit;
}
$xml = simplexml_load_string($bodyRaw);
$json = json_encode($xml);
$decodedArray = json_decode($json, true);
$is_fail = false;
$clientOrderId = @$decodedArray['@attributes']['clientOrderId'];
if (!$clientOrderId) {
    $is_fail = true;
}
$converter = new Array2XML();
$converter->setConvertFromEncoding('windows-1251');
$converter->setTopNodeName($method . 'Response');
if ($is_fail) {
    $converter->importArray(array('clientOrderId' => $clientOrderId, 'status' => 3, 'error' => 41, 'processedDT' => date('c')));
    echo $converter->saveXml();
}
Esempio n. 4
0
 public function validate($name, $value, $phone_is_set = false)
 {
     global $DB;
     switch ($name) {
         case 'agree':
             if ($value != 1) {
                 $this->error[$name] = 'Прочтите и согласитесь с правилами';
             }
             break;
         case 'country':
             if ($value <= 0) {
                 $this->error[$name] = 'Выберите страну';
             }
             break;
         case 'city':
             if ($value <= 0) {
                 $this->error[$name] = 'Выберите город';
             }
             break;
         case 'birthday':
             if (!$value) {
                 $this->error[$name] = "Заполните дату дня рождения";
                 $this->errno[$name] = 1;
             }
             break;
         case 'sex':
             if ($value === null) {
                 // $this->error[$name] = 'Выберите пол';
             }
             break;
         case 'uname':
         case 'usurname':
             if (!$value) {
                 $this->error[$name] = "Поле заполнено некорректно";
                 $this->errno[$name] = 1;
             }
             if (!preg_match("/^[-a-zA-Zа-яёА-ЯЁ]+\$/i", $value)) {
                 $this->error[$name] = "Поле заполнено некорректно";
                 $this->errno[$name] = 2;
             }
             break;
         case 'password':
             if ($value == '') {
                 $this->error[$name] = 'Введите пароль';
                 $this->errno[$name] = 1;
             } else {
                 if (strlen($value) > 24) {
                     $this->error[$name] = 'Максимальная длина пароля 24 символа';
                     $this->errno[$name] = 2;
                 } else {
                     if (strlen($value) < 6) {
                         $this->error[$name] = 'Минимальная длина пароля 6 символов';
                         $this->errno[$name] = 3;
                     } else {
                         if (strlen(preg_replace("#[a-zA-Z\\d\\!\\@\\#\$\\%\\^\\&\\*\\(\\)\\_\\+\\-\\=\\;\\,\\.\\/\\?\\[\\]\\{\\}]#", "", $value)) != 0) {
                             $this->error[$name] = 'Поле заполнено некорректно';
                             $this->errno[$name] = 4;
                         }
                     }
                 }
             }
             break;
         case 'login':
             if (!preg_match("/^[a-zA-Z0-9]+[-a-zA-Z0-9_]{2,}\$/", $value)) {
                 $this->error[$name] = 'От 3 до 15 символов. Может содержать латинские буквы, цифры, подчёркивание (_) и дефис (-)';
                 $this->errno[$name] = 1;
             }
             if (in_array(strtolower($value), $GLOBALS['disallowUserLogins'])) {
                 $this->error[$name] = 'Извините, такой логин использовать нельзя';
                 $this->errno[$name] = 2;
             }
             if (empty($this->error[$name])) {
                 $sql = "SELECT uid FROM users WHERE lower(login) = ?";
                 if ($DB->val($sql, strtolower($value))) {
                     $this->error[$name] = 'Извините, этот логин занят. Придумайте другой.';
                     $this->errno[$name] = 3;
                 }
             }
             break;
         case 'email':
             if (!is_email($value)) {
                 $this->error[$name] = 'Поле заполнено некорректно';
                 $this->errno[$name] = 1;
             }
             if (empty($this->error[$name])) {
                 require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/temp_email.php";
                 if (temp_email::isTempEmail($value)) {
                     $this->error[$name] = 'К сожалению, регистрация аккаунта на указанный адрес электронной почты невозможна. Пожалуйста, для регистрации воспользуйтесь почтовым адресом другого домена';
                     $this->errno[$name] = 2;
                 } else {
                     if ($DB->val("SELECT uid FROM users WHERE lower(email) = ?", strtolower($value))) {
                         if ($this->_disable_email_redirect) {
                             $this->error[$name] = 'Email занят';
                             $this->errno[$name] = 3;
                         } else {
                             require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/smail.php";
                             $smail = new smail();
                             $smail->reRegisterToYourMail(strtolower($value));
                             unset($_SESSION["regform_captcha_entered"]);
                             unset($_SESSION["reg_phone"]);
                             unset($_SESSION['send_sms_time']);
                             header_location_exit("/reg_complete.php");
                         }
                     }
                 }
             }
             break;
         case 'smscode':
             if ($_SESSION['smsCode'] != $value && !($value == 7777 && $_SESSION["reg_phone"] == 71111112222 && !is_release())) {
                 $this->error[$name] = 'Неверный код';
             }
             break;
         case 'phone':
             if (!$phone_is_set && $_SESSION["reg_phone"] != $value) {
                 $this->error[$name] = 'Вы подтвердили не этот номер';
                 $this->errno[$name] = 1;
             }
             $sPhone = $phone_is_set ? $value : $_SESSION['reg_phone'];
             if (trim(preg_replace("#[\\D]#", "", $sPhone)) == '') {
                 $this->error[$name] = 'Необходимо ввести номер';
                 $this->errno[$name] = 2;
             }
             break;
     }
 }
Esempio n. 5
0
 public function __construct()
 {
     $this->isTest = !is_release() || is_local();
 }
Esempio n. 6
0
<h2 class="b-layout__title b-layout__title_padbot_30">Оплата через Okpay</h2>

<table class="b-layout__table b-layout__table_width_full">
    <tbody>
        <tr class="b-layout__tr">
            <td class="b-layout__td b-layout__td_padright_20">
                <form method="POST" action="<?php 
echo is_release() ? "https://www.okpay.com/process.html" : "/bill/test/okpay.php";
?>
" id="<?php 
echo $type_payment;
?>
" name="<?php 
echo $type_payment;
?>
">
                    <div class="b-layout__txt b-layout__txt_inline-block b-layout__txt_padtop_5 b-page__desktop b-page__ipad">Мобильный телефон</div>
                    <div class="b-combo b-combo_inline-block b-combo_padbot_20">
                        <div class="b-combo__input <?php 
echo $bill->error['phone'] ? "b-combo__input_error" : "";
?>
 b-combo__input_width_170 b-combo__input_tel
                               b-combo__input_phone_countries_dropdown b-combo__input_visible_items_5 use_scroll show_all_records
                                                    b-combo__input_init_countryPhoneCodes">
                            <input type="text" maxlength="15" id="reg_phone" class="b-combo__input-text payment-system js-payform_input" name="phone" size="80" value="7">
                            <span class="b-combo__tel"><span class="b-combo__flag" style="background-position:0 -660px"></span></span> 
                        </div>
                    </div>
                    
                    <div class="i-shadow">
                        <div id="error_phone" class="b-shadow b-shadow_zindex_3 b-shadow_m <?php 
Esempio n. 7
0
 /**
  * Отправка пакета сообщения через СМС-Шлюз.
  * 
  * @param type $params
  *
  * @return bool
  */
 protected function _send($params)
 {
     $ch = curl_init();
     if (is_array($params)) {
         foreach ($params as $k => $v) {
             if ($v === null) {
                 continue;
             }
             $params[$k] = $this->_enc($v);
         }
         $build_query = http_build_query($params);
     } else {
         ob_start();
         var_dump($params);
         $out = ob_get_clean();
         $this->_log->writeln($this->_enc($out, true));
         $this->_log->writeln('Ошибка параметров для запроса');
         $this->_setError('Ошибка параметров для запроса');
         return false;
     }
     if (!SMS_GATE_DEBUG) {
         curl_setopt($ch, CURLOPT_USERPWD, SMS_GATE_AUTH);
         curl_setopt($ch, CURLOPT_URL, (is_release() ? $this->_request_url : 'localhost') . '?' . $build_query);
         if ($this->_request_port) {
             curl_setopt($ch, CURLOPT_PORT, $this->_request_port);
         }
     } else {
         if (defined('BASIC_AUTH')) {
             curl_setopt($ch, CURLOPT_USERPWD, BASIC_AUTH);
         }
         curl_setopt($ch, CURLOPT_URL, $this->_request_url . '?' . $build_query);
     }
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
     curl_setopt($ch, CURLOPT_TIMEOUT, 30);
     $res = curl_exec($ch);
     $this->_http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
     ob_start();
     var_dump($this->_request_url . '?' . $build_query);
     var_dump($params);
     var_dump($res);
     var_dump($this->_http_code);
     $out = ob_get_clean();
     $this->_log->writeln($this->_enc($out, true));
     return $res;
 }
Esempio n. 8
0
 /**
  * Возвращает адрес редиректа приложения
  *
  * @return string
  */
 public static function getRedirectURI()
 {
     return is_release() ? API_Yandex::REDIRECT_URI : API_Yandex::REDIRECT_BETA_URI;
 }
Esempio n. 9
0
 function getSecret()
 {
     if (is_release()) {
         return false;
     }
     return $this->_secret;
 }
Esempio n. 10
0
 /**
  * Возвращает информацию о выплате ЯД
  * 
  * @param  int $user_id UID пользователя
  * @return object yd_payments
  */
 function getWmPaymentInfo($user_id)
 {
     if (!$this->sbr->isAdmin()) {
         return;
     }
     require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/wm_payments.php';
     if (!$this->getPayouts($user_id)) {
         return NULL;
     }
     $payout = $this->payouts[$user_id];
     $wm = new wm_payments($payout['id'], wm_payments::SRC_SBR);
     if (!is_release()) {
         $wm->DEBUG = array('address' => $GLOBALS['host'] . '/norisk2/admin/wm-server-test.php');
         if (defined('BASIC_AUTH')) {
             $wm->DEBUG['headers'] = 'Authorization: Basic ' . base64_encode(BASIC_AUTH) . "\r\n";
         }
     }
     $pmt = $wm->getPayment();
     $reqvs = sbr_meta::getUserReqvs($user_id);
     if ($pmt) {
         $tr = $wm->getTr($pmt['ltr_id']);
         $pmt['dstacnt_nr'] = $tr ? $tr['purse'] : $reqvs[sbr::FT_PHYS]['el_wmr'];
         $pmt['performed_dt'] = $tr['dateupd'];
     } else {
         $pmt = array('src_id' => $payout['id'], 'src_type' => wm_payments::SRC_SBR, 'in_amt' => $payout['credit_sum'], 'dstacnt_nr' => $reqvs[sbr::FT_PHYS]['el_wmr']);
     }
     // $pmt['balance'] = $wm->balance();
     $pmt['errors'] = $wm->errors;
     $pmt['amt_sys'] = exrates::WMR;
     return $pmt;
 }
Esempio n. 11
0
 public function getAccessData($type = null)
 {
     switch ($type) {
         case 'bind':
             $this->userName = API_AlphaBank::LOGIN_BINDING;
             $this->password = is_release() ? API_AlphaBank::PASSWD_BINDING : API_AlphaBank::PASSWD_TEST_BINDING;
             break;
         case 'autopay':
             $this->userName = API_AlphaBank::LOGIN_AUTOPAY;
             $this->password = is_release() ? API_AlphaBank::PASSWD_AUTOPAY : API_AlphaBank::PASSWD_TEST_AUTOPAY;
             break;
         default:
             $this->userName = API_AlphaBank::LOGIN;
             $this->password = is_release() ? API_AlphaBank::PASSWD : API_AlphaBank::PASSWD_TEST;
             break;
     }
 }
Esempio n. 12
0
                    </tr>
                    <?php 
        }
        ?>
                    
                </tbody>
            </table>
<?php 
    }
    $payout_list = $payouts['list'];
    if ($payout_list) {
        ?>
            <br/>
            <h3><i>Запросы к ЯД на Выплату</i></h3>
            <?php 
        if (!is_release()) {
            ?>
            <p>* на тесте статусы выплат не меняются они всегда "новый"</p>
            <?php 
        }
        ?>
            <table class="nr-a-tbl" cellspacing="5">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>Сумма</th>
                        <th>Статус</th>
                        <th>Ошибка</th>
                        <th>Создание</th>
                        <th>Обновление</th>
                        <th>Попыток</th>
Esempio n. 13
0
    <tbody>
        <tr class="b-layout__tr">
            <td class="b-layout__td b-layout__td_padright_20">
                <div class="b-fon b-fon_bg_fff9bf b-fon_pad_10 b-fon_padleft_35">
                    <div class="b-layout__txt b-layout__txt_fontsize_11 b-layout__txt_bold"><span class="b-icon b-icon_sbr_oattent b-icon_margleft_-20"></span>Обратите внимание</div>
                    <div class="b-layout__txt b-layout__txt_fontsize_11">— Оплата услуг производится в течение 2-3 минут.</div> 
                    <div class="b-layout__txt b-layout__txt_fontsize_11">— После нажатия на кнопку Оплатить вы будете перенаправлены на сайт Яндекс.Деньги.</div> 
                </div>
                <form id="<?php 
echo $type_payment;
?>
" name="<?php 
echo $type_payment;
?>
"  method="post" action="<?php 
echo is_release() ? "https://money.yandex.ru/eshop.xml" : "/bill/test/ydpay.php";
?>
">
                    <input class="wide" name="scid" value="2200" type="hidden" />
                    <input type="hidden" name="ShopID" value="4551" />
                    <input type="hidden" name="Sum" value="<?php 
echo $payment_sum;
?>
" />
                    <input type="hidden" name="CustomerNumber" value="<?php 
echo $bill->acc['id'];
?>
" />
                </form>
                <? include ( $_SERVER['DOCUMENT_ROOT'] . "/bill/payment/paysystems/tpl.button_buy.php");?>                 
            </td>
Esempio n. 14
0
?>
]</a><br>
Номер счета: <?php 
echo $account->id;
?>
<h3 style="margin-bottom:0px;">На счету <?php 
echo round($account->sum, 2);
?>
 руб.</h3>
<strong>на бонусном счету - <?php 
echo zin(round($account->bonus_sum, 2));
?>
 руб.</strong><br /><br />

<?php 
if (!is_release() || in_array($_SESSION['login'], $GLOBALS['balanceCanChangeAdmins'])) {
    ?>
<form action="." method="post">
Изменить счет пользователя
<table cellspacing="2" cellpadding="2" border="0">
<tr>
	<td>на сумму(руб):</td>
	<td><input type="text" name="val"></td>
</tr>
<tr>
	<td>комментарий (для пользователя)</td>
	<td><textarea cols="50" rows="" name="ucomment"></textarea></td>
</tr>
<tr>
	<td>комментарий (для системы)</td>
	<td><textarea cols="50" rows="" name="scomment"></textarea></td>
Esempio n. 15
0
<h2 class="b-layout__title b-layout__title_padbot_30">Оплата через Веб-кошелек</h2>
<table class="b-layout__table b-layout__table_width_full">
    <tbody>
        <tr class="b-layout__tr">
            <td class="b-layout__td b-layout__td_padright_20">
                <div class="b-fon b-fon_bg_fff9bf b-fon_pad_10 b-fon_padleft_35">
                    <div class="b-layout__txt b-layout__txt_fontsize_11 b-layout__txt_bold"><span class="b-icon b-icon_sbr_oattent b-icon_margleft_-20"></span>Обратите внимание</div>
                    <div class="b-layout__txt b-layout__txt_fontsize_11">— Оплата услуг производится в течение 2-3 минут.</div> 
                    <div class="b-layout__txt b-layout__txt_fontsize_11">— Платежи суммой более 15 000 не производятся.</div> 
                </div> 
                <form action="<?php 
echo is_release() ? 'http://www.onlinedengi.ru/wmpaycheck.php' : '/bill/test/webpay.php';
?>
" method="post" id="<?php 
echo $type_payment;
?>
" name="<?php 
echo $type_payment;
?>
">
                    <input type="hidden" name="project" value="3097"  />
                    <input type="hidden" name="mode_type" value="204"  />
                    <input type="hidden" name="nickname" value="<?php 
echo $bill->user['login'];
?>
"  />
                    <input type="hidden" name="nick_extra" value="<?php 
echo $bill->user['login'];
?>
"  />
                    <input type="hidden" name="amount" value="<?php 
Esempio n. 16
0
 public function __construct($is_pro = false)
 {
     $this->url = !is_release() ? self::SERVER_LOCAL : self::SERVER_URL;
     $this->shop_id = is_release() ? self::SHOP_ID : self::SHOP_ID_TEST;
     $this->is_pro = $is_pro;
 }
Esempio n. 17
0
 /**
  * Возвращает данные о комиссиях и сторонах СБР в CSV.
  *
  * @param string $date_s Дата начала периода
  * @param string $date_e Дата окончания периода
  *
  * @return string Файл с данными в CSV
  */
 public function exportSBRDataToCSV($date_s, $date_e)
 {
     global $DB;
     if (!$date_s) {
         $date_s = '1970-01-01';
     }
     if (!$date_e) {
         $date_e = date('Y') + 1 . '-01-01';
     }
     $pskb_commissions = array();
     $sql = 'SELECT * FROM pskb_lc_commission';
     $commissions = $DB->rows($sql);
     if ($commissions) {
         foreach ($commissions as $v) {
             $pskb_commissions[$v['lc_id']]['bank'] = $v['bank'];
             $pskb_commissions[$v['lc_id']]['fl'] = $v['fl'];
         }
     }
     $data_csv = '';
     /*
     $sql = "SELECT 
                 'emp' AS u_type, COALESCE(pskb_lc.date_fix_reestr, pskb_lc.bank_covered) AS lc_date, u.login, s.cost AS sum, NULL as frl_percent, pskb_lc.lc_id, 
                 pskb_lc.sbr_id, pskb_lc.ps_emp AS ps, pskb_lc.state, pskb_lc.\"tagCust\", pskb_lc.\"tagPerf\", pskb_lc.\"nameCust\", pskb_lc.\"namePerf\", 
                 pskb_lc.\"innCust\", pskb_lc.\"innPerf\", s_r.*, pskb_lc.sum as lc_sum   
             FROM account_operations AS a_o 
             INNER JOIN sbr AS s ON s.reserved_id = a_o.id 
             INNER JOIN pskb_lc ON pskb_lc.sbr_id = s.id AND pskb_lc.lc_id > 126
             INNER JOIN users AS u ON u.uid = s.emp_id 
             INNER JOIN sbr_reqv AS s_r ON s_r.user_id = s.emp_id 
             WHERE a_o.op_code IN (77) AND COALESCE(pskb_lc.date_fix_reestr, pskb_lc.bank_covered)::date >= ? AND COALESCE(pskb_lc.date_fix_reestr, pskb_lc.bank_covered)::date <= ?
     
             UNION ALL
     
             SELECT 
                 'frl' AS u_type, COALESCE(s_s_p.date_fix_reestr, s_s_p.bank_completed) AS lc_date, u.login, s_s.cost AS sum, s_s_a.frl_percent, pskb_lc.lc_id, 
                 pskb_lc.sbr_id, s_s_p.credit_sys AS ps, s_s_p.state, pskb_lc.\"tagCust\", pskb_lc.\"tagPerf\", pskb_lc.\"nameCust\", pskb_lc.\"namePerf\", 
                 pskb_lc.\"innCust\", pskb_lc.\"innPerf\", s_r.*, pskb_lc.sum as lc_sum  
             FROM account_operations AS a_o 
             INNER JOIN sbr_stages_payouts AS s_s_p ON s_s_p.credit_id = a_o.id 
             INNER JOIN sbr_stages AS s_s ON s_s.id = s_s_p.stage_id 
             LEFT JOIN sbr_stages_arbitrage AS s_s_a ON s_s_a.stage_id = s_s.id 
             INNER JOIN sbr AS s ON s.id = s_s.sbr_id AND s_s_p.user_id = s.frl_id
             INNER JOIN pskb_lc ON pskb_lc.sbr_id = s_s.sbr_id AND pskb_lc.lc_id > 126
             INNER JOIN users AS u ON u.uid = s_s_p.user_id 
             INNER JOIN sbr_reqv AS s_r ON s_r.user_id = s_s_p.user_id 
             WHERE a_o.op_code IN (79) AND COALESCE(s_s_p.date_fix_reestr, s_s_p.bank_completed)::date < '2013-03-07' AND COALESCE(s_s_p.date_fix_reestr, s_s_p.bank_completed)::date >= ? AND COALESCE(s_s_p.date_fix_reestr, s_s_p.bank_completed)::date <= ?";
     */
     $sql = "SELECT\n                    bb.u_type, \n                    bb.lc_date, \n                    u.login, \n                    bb.sum, \n                    bb.lc_id, \n                    pskb_lc.sbr_id, \n                    bb.ps, \n                    bb.state,\n                    (CASE WHEN bb.u_type = 'emp' THEN \n                    sbr_calctax( sbr_taxes_id( sbr_exrates_map(pskb_lc.ps_emp), null, null, bb.scheme, bb.sum ),bb.scheme, bb.sum, (pskb_lc.\"tagPerf\" + 1), 1, 1, sbr_exrates_map(pskb_lc.ps_emp), null, null)\n                    ELSE\n                    sbr_calctax( sbr_taxes_id( \n                            sbr_exrates_map( \n                                CASE WHEN (pskb_lc.\"tagPerf\" <> 1 AND bb.sum < 15000 AND bb.state = 'END') OR \n                                ( bb.lc_id IN(578,714,1057,1257,1344,1600,1600,1748,1795,2215,2234,2336,2573,2727,2833,3042,3134,3250,3502,3527,3599,3964,4224,4326,4333,4828,5331,5389,5631,5693,5778,5778,6167,6342,6730) AND\n                                  bb.state = 'ERR' )\n                                THEN 199 ELSE pskb_lc.ps_frl END \n                            ), \n                        0, null, bb.scheme, bb.sum ),bb.scheme, bb.sum, (pskb_lc.\"tagPerf\" + 1), 1, 1, \n                            sbr_exrates_map(\n                            CASE WHEN (pskb_lc.\"tagPerf\" <> 1 AND bb.sum < 15000 AND bb.state = 'END') OR \n                            ( bb.lc_id IN(578,714,1057,1257,1344,1600,1600,1748,1795,2215,2234,2336,2573,2727,2833,3042,3134,3250,3502,3527,3599,3964,4224,4326,4333,4828,5331,5389,5631,5693,5778,5778,6167,6342,6730) AND\n                              bb.state = 'ERR' )\n                            THEN 199 ELSE pskb_lc.ps_frl END\n                            ), null, null) \n                    END ) as fl_tax,\n                    pskb_lc.\"tagCust\", \n                    pskb_lc.\"tagPerf\", \n                    pskb_lc.\"nameCust\", \n                    pskb_lc.\"namePerf\", \n                    pskb_lc.\"innCust\", \n                    pskb_lc.\"innPerf\", \n                    s_r.*, \n                    pskb_lc.sum AS lc_sum\n                FROM (\n                    SELECT\n                        s.scheme_id as scheme,\n                        lc_id, 'emp' AS u_type, \n                        s.emp_id _uid, \n                        SUM(s.cost) sum,\n                        MIN (COALESCE(pskb_lc.date_fix_reestr, pskb_lc.bank_covered)) AS lc_date,\n                        MIN (pskb_lc.ps_emp) AS ps,\n                        MIN(pskb_lc.state) as state\n                    FROM account_operations AS a_o\n                    INNER JOIN sbr AS s ON s.reserved_id = a_o.id\n                    INNER JOIN pskb_lc ON pskb_lc.sbr_id = s.id AND pskb_lc.lc_id > 126\n                    WHERE a_o.op_code IN (77) AND COALESCE(pskb_lc.date_fix_reestr, pskb_lc.bank_covered)::date >= ? AND COALESCE(pskb_lc.date_fix_reestr, pskb_lc.bank_covered)::date <= ?\n                    GROUP BY lc_id, s.emp_id, s.scheme_id\n\n                    UNION ALL\n\n                    SELECT\n                        s.scheme_id as scheme,\n                        lc_id, 'frl' AS u_type, \n                        s_s_p.user_id _uid, \n                        SUM( CASE WHEN s_s_a.frl_percent > 0 THEN s_s.cost * s_s_a.frl_percent ELSE s_s.cost END ) sum,\n                        MIN(COALESCE(s_s_p.date_fix_reestr, s_s_p.bank_completed)) as lc_date,\n                        MIN(s_s_p.credit_sys) AS ps,\n                        MIN(s_s_p.state) as state\n                    FROM account_operations AS a_o\n                    INNER JOIN sbr_stages_payouts AS s_s_p ON s_s_p.credit_id = a_o.id\n                    INNER JOIN sbr_stages AS s_s ON s_s.id = s_s_p.stage_id\n                    LEFT JOIN sbr_stages_arbitrage AS s_s_a ON s_s_a.stage_id = s_s.id\n                    INNER JOIN sbr AS s ON s.id = s_s.sbr_id AND s_s_p.user_id = s.frl_id\n                    INNER JOIN pskb_lc ON pskb_lc.sbr_id = s_s.sbr_id AND pskb_lc.lc_id > 126\n                    WHERE a_o.op_code IN (79) AND COALESCE(s_s_p.date_fix_reestr, s_s_p.bank_completed)::date < '2013-03-07' AND COALESCE(s_s_p.date_fix_reestr, s_s_p.bank_completed)::date >= ? AND COALESCE(s_s_p.date_fix_reestr, s_s_p.bank_completed)::date <= ?\n                    GROUP BY lc_id, s_s_p.user_id, s.scheme_id\n                ) bb\n                INNER JOIN users AS u ON u.uid = _uid\n                INNER JOIN pskb_lc ON pskb_lc.lc_id = bb.lc_id\n                INNER JOIN sbr_reqv AS s_r ON s_r.user_id = _uid";
     $qres = $DB->query($sql, $date_s, $date_e, $date_s, $date_e);
     if ($qres) {
         if (pg_num_rows($qres)) {
             //$taxes = sbr::getTaxes(21);
             /*
             $res2 = array();
             while($item = pg_fetch_array($qres)) {
                 if(!$res2[$item['lc_id'].'-'.$item['user_id']]) {
                     if($item['frl_percent']>0) { 
                         $item['sum'] = $item['sum']*$item['frl_percent'];
                     }
                     $res2[$item['lc_id'].'-'.$item['user_id']] = $item;
                 } else {
                     if($item['frl_percent']>0) { 
                         $res2[$item['lc_id'].'-'.$item['user_id']]['sum'] = $res2[$item['lc_id'].'-'.$item['user_id']]['sum'] + $item['sum']*$item['frl_percent'];
                     } else {
                         $res2[$item['lc_id'].'-'.$item['user_id']]['sum'] = $res2[$item['lc_id'].'-'.$item['user_id']]['sum'] + $item['sum'];
                     }
                 }
             }
             */
             $file_name = '/tmp/' . uniqid('sbrcsvdata');
             $f = fopen($file_name, 'w');
             while ($item = pg_fetch_array($qres)) {
                 $ps_sys = $item['ps'];
                 switch ($item['u_type']) {
                     case 'emp':
                         $f_type = $item['tagCust'] == 1 ? 'Юридическое лицо' : 'Физическое лицо';
                         $f_name = htmlspecialchars_decode($item['nameCust']);
                         $f_inn = $item['innCust'];
                         $item['form_type'] = $item['tagCust'] == 1 ? 2 : 1;
                         break;
                     case 'frl':
                         $f_type = $item['tagPerf'] == 1 ? 'Юридическое лицо' : 'Физическое лицо';
                         $f_name = htmlspecialchars_decode($item['namePerf']);
                         $f_inn = $item['innPerf'];
                         $item['form_type'] = $item['tagPerf'] == 1 ? 2 : 1;
                         if ($item['tagPerf'] != 1 && $item['sum'] <= 15000 && $item['state'] == pskb::PAYOUT_END) {
                             $item['ps'] = exrates::WEBM;
                             $ps_sys = pskb::WW;
                         }
                         break;
                 }
                 if (!$item['sum']) {
                     continue;
                 }
                 //$f_name = ($item['form_type']==1 ? $item['_1_fio'] : $item['_2_full_name']);
                 //$f_inn = ($item['form_type']==1 ? $item['_1_inn'] : $item['_2_inn']);
                 $f_address = htmlspecialchars_decode($item['form_type'] == 1 ? "{$item['_1_index']}, {$item['_1_country']}, {$item['_1_city']}, {$item['_1_address']}" : "{$item['_2_index']}, {$item['_2_country']}, {$item['_2_city']}, {$item['_2_address']}");
                 //$f_type = ($item['form_type']==1 ? 'Физическое лицо' : 'Юридическое лицо');
                 $f_u_type = $item['u_type'] == 'emp' ? 'Работодатель' : 'Исполнитель';
                 $f_commission_our = 0;
                 $f_commission_bank = 0;
                 if ($item['u_type'] == 'emp') {
                     $ps_sys = $item['ps'];
                     $item['ps'] = pskb::$exrates_map[$item['ps']];
                 } else {
                     $tt = array(578, 714, 1057, 1257, 1344, 1600, 1600, 1748, 1795, 2215, 2234, 2336, 2573, 2727, 2833, 3042, 3134, 3250, 3502, 3527, 3599, 3964, 4224, 4326, 4333, 4828, 5331, 5389, 5631, 5693, 5778, 5778, 6167, 6342, 6730);
                     if (in_array($item['lc_id'], $tt) && $item['state'] == pskb::PAYOUT_ERR) {
                         $item['ps'] = exrates::WEBM;
                         $ps_sys = pskb::WW;
                     }
                     /*
                     if ( $item['state'] == pskb::PAYOUT_ERR ) {
                         $item['ps'] = exrates::WEBM;
                     }
                     */
                 }
                 $f_date = dateFormat('d.m.Y H.i.s', $item['lc_date']);
                 $f_id = $item['lc_id'];
                 $f_sbr = $item['sbr_id'];
                 $f_login = $item['login'];
                 if ($item['u_type'] == 'emp' && in_array($f_id, array_keys($pskb_commissions)) && is_release()) {
                     $f_commission_bank = $pskb_commissions[$f_id]['bank'];
                     $f_commission_our = $pskb_commissions[$f_id]['fl'];
                 } else {
                     $f_all = $item['lc_sum'] - $item['sum'];
                     $f_commission_bank = round($f_all - $item['fl_tax'], 2);
                     $f_commission_our = round($item['fl_tax'], 2);
                     $f_ps = pskb::$psys[$item['u_type'] == 'emp' ? pskb::USER_EMP : pskb::USER_FRL][$ps_sys];
                     /*switch($item['ps']) {
                           case exrates::WMR:
                               $f_ps = 'WebMoney';
                               switch($item['u_type']) {
                                   case 'emp':
                                       $f_tax = $taxes[1][28]['percent'] + $taxes[1][29]['percent'];
                                       //$f_all = $item['sum']*$f_tax;
                                       $f_all = $item['lc_sum'] - $item['sum'];
                                       $f_commission_bank = round(($item['sum']*$taxes[1][29]['percent']), 2);
                                       $f_commission_our = round(($f_all-$f_commission_bank), 2);
                                       //$f_commission_our = $item['sum']*$taxes[1][28]['percent'];
                                       //$f_commission_bank = $item['sum']*$taxes[1][29]['percent'];
                                       break;
                                   case 'frl':
                                       $f_tax = $taxes[0][19]['percent'] + $taxes[0][23]['percent'];
                                       $f_all = $item['sum']*$f_tax;
                                       $f_commission_bank = round(($item['sum']*$taxes[0][23]['percent']), 2);
                                       $f_commission_our = round(($f_all-$f_commission_bank), 2);
                                       //$f_commission_our = $item['sum']*$taxes[0][19]['percent'];
                                       //$f_commission_bank = $item['sum']*$taxes[0][23]['percent'];
                                       break;
                               }
                               break;
                           case exrates::YM:
                               $f_ps = 'ЯндексДеньги';
                               switch($item['u_type']) {
                                   case 'emp':
                                       $f_tax = $taxes[1][26]['percent'] + $taxes[1][27]['percent'];
                                       //$f_all = $item['sum']*$f_tax;
                                       $f_all = $item['lc_sum'] - $item['sum'];
                                       $f_commission_bank = round(($item['sum']*$taxes[1][27]['percent']), 2);
                                       $f_commission_our = round(($f_all-$f_commission_bank), 2);
                                       //$f_commission_our = $item['sum']*$taxes[1][26]['percent'];
                                       //$f_commission_bank = $item['sum']*$taxes[1][27]['percent'];
                                       break;
                                   case 'frl':
                                       $f_tax = $taxes[0][18]['percent'] + $taxes[0][22]['percent'];
                                       $f_all = $item['sum']*$f_tax;
                                       $f_commission_bank = round(($item['sum']*$taxes[0][22]['percent']), 2);
                                       $f_commission_our = round(($f_all-$f_commission_bank), 2);
                                       //$f_commission_our = $item['sum']*$taxes[0][18]['percent'];
                                       //$f_commission_bank = $item['sum']*$taxes[0][22]['percent'];
                                       break;
                               }
                               break;
                           case exrates::CARD:
                               $f_ps = 'Пластиковая карта';
                               switch($item['u_type']) {
                                   case 'emp':
                                       $f_tax = $taxes[1][32]['percent'] + $taxes[1][33]['percent'];
                                       //$f_all = $item['sum']*$f_tax;
                                       $f_all = $item['lc_sum'] - $item['sum'];
                                       $f_commission_bank = round(($item['sum']*$taxes[1][33]['percent']), 2);
                                       $f_commission_our = round(($f_all-$f_commission_bank), 2);
                                       //$f_commission_our = $item['sum']*$taxes[1][32]['percent'];
                                       //$f_commission_bank = $item['sum']*$taxes[1][33]['percent'];
                                       break;
                                   case 'frl':
                                       $f_commission_our = 0;
                                       $f_commission_bank = 0;
                                       break;
                               }
                               break;
                           case exrates::BANK:
                               $f_ps = 'Безнал';
                               switch($item['u_type']) {
                                   case 'emp':
                                       $f_tax = $taxes[1][30]['percent'] + $taxes[1][31]['percent'];
                                       //$f_all = $item['sum']*$f_tax;
                                       $f_all = $item['lc_sum'] - $item['sum'];
                                       $f_commission_bank = round(($item['sum']*$taxes[1][31]['percent']), 2);
                                       $f_commission_our = round(($f_all-$f_commission_bank), 2);
                                       //$f_commission_our = $item['sum']*$taxes[1][30]['percent'];
                                       //$f_commission_bank = $item['sum']*$taxes[1][31]['percent'];
                                       break;
                                   case 'frl':
                                       $f_tax = $taxes[0][20]['percent'] + $taxes[0][24]['percent'];
                                       $f_all = $item['sum']*$f_tax;
                                       $f_commission_bank = round(($item['sum']*$taxes[0][24]['percent']), 2);
                                       $f_commission_our = round(($f_all-$f_commission_bank), 2);
                                       //$f_commission_our = $item['sum']*$taxes[0][20]['percent'];
                                       //$f_commission_bank = $item['sum']*$taxes[0][24]['percent'];
                                       break;
                               }
                               break;
                           case exrates::WEBM:
                               $f_ps = 'Веб кошелек';
                               switch($item['u_type']) {
                                   case 'emp':
                                       $f_tax = $taxes[1][34]['percent'] + $taxes[1][35]['percent'];
                                       //$f_all = $item['sum']*$f_tax;
                                       $f_all = $item['lc_sum'] - $item['sum'];
                                       $f_commission_bank = round(($item['sum']*$taxes[1][35]['percent']), 2);
                                       $f_commission_our = round(($f_all-$f_commission_bank), 2);
                                       //$f_commission_our = $item['sum']*$taxes[1][34]['percent'];
                                       //$f_commission_bank = $item['sum']*$taxes[1][35]['percent'];
                                       break;
                                   case 'frl':
                                       $f_tax = $taxes[0][21]['percent'];
                                       $f_all = $item['sum']*$f_tax;
                                       $f_commission_bank = 0;
                                       $f_commission_our = round(($f_all-$f_commission_bank), 2);
                                       //$f_commission_our = $item['sum']*$taxes[0][21]['percent'];
                                       //$f_commission_bank = 0;
                                       break;
                               }
                               break;
                       }
                       */
                 }
                 $data_csv = "{$f_name};{$f_inn};{$f_type};{$f_address};{$f_u_type};" . number_format($f_commission_our, 2, ',', '') . ";{$f_ps};" . number_format($f_commission_bank, 2, ',', '') . ";{$f_date};{$f_id};{$f_sbr};{$f_login};\n";
                 fwrite($f, $data_csv);
             }
             fclose($f);
         }
     }
     return $file_name;
 }
Esempio n. 18
0
 /**
  * Отправляет файл индекса в гугл.
  */
 function send()
 {
     if (!is_release()) {
         return;
     }
     $surl = urlencode(self::PUBLIC_HOST . '/sitemap.xml');
     file_get_contents("http://www.google.ru/webmasters/tools/ping?sitemap={$surl}");
     $surl2 = urlencode(self::PUBLIC_HOST . '/flru/sitemap.xml');
     file_get_contents("http://www.google.ru/webmasters/tools/ping?sitemap={$surl}");
 }
Esempio n. 19
0
 /**
  * Возвращает адрес редиректа приложения.
  *
  * @return string
  */
 public static function getRedirectURI()
 {
     return is_release() ? self::REDIRECT_URI : self::REDIRECT_BETA_URI;
 }
Esempio n. 20
0
             unset($_POST);
         }
     }
     // Закомментировано, по причине того, что у некоторых юзеров файрволы по умолчанию
     // настроены с отключенными Referers.
     // else { unset($_POST); }
 }
 require_once ABS_PATH . "/classes/session.php";
 require_once ABS_PATH . "/classes/adriver.php";
 require_once ABS_PATH . '/classes/Helpers/GaJsHelper.php';
 session_start();
 detectSiteVersion();
 $UID = get_uid(false);
 $ip = getRemoteIP();
 // Ticket #0028763
 if (is_release() && $UID > 0 && !isset($error404_page) && strpos($ip, '10.') !== 0 && isset($_SESSION['permissions']) && !empty($_SESSION['permissions'])) {
     //Админ не под VPN
     header("Location: /404.php");
     exit;
 }
 //Если это не авторизация то чистим метку
 $_action = __paramInit('striptrim', 'action', 'action');
 if ($_action !== 'login' && !defined('IS_AUTH_SECOND') && !defined('IS_OPAUTH') && !defined('IS_PHP_JS')) {
     unset($_SESSION['2fa_provider']);
 }
 // Добавление в Apache лог идентификатора пользователя
 if (function_exists('apache_note')) {
     apache_note('custom_field', $UID);
 }
 if (isset($_GET['blogon'])) {
     $_SESSION['blog_ON'] = 1;
Esempio n. 21
0
<h2 class="b-layout__title b-layout__title_padbot_30">Оплата через Веб-кошелек</h2>
<table class="b-layout__table b-layout__table_width_full">
    <tbody>
        <tr class="b-layout__tr">
            <td class="b-layout__td b-layout__td_padright_20">
                <div class="b-fon b-fon_bg_fff9bf b-fon_pad_10 b-fon_padleft_35">
                    <div class="b-layout__txt b-layout__txt_fontsize_11 b-layout__txt_bold"><span class="b-icon b-icon_sbr_oattent b-icon_margleft_-20"></span>Обратите внимание</div>
                    <div class="b-layout__txt b-layout__txt_fontsize_11">— Оплата услуг производится в течение 2-3 минут.</div> 
                    <div class="b-layout__txt b-layout__txt_fontsize_11">— Платежи суммой более 15 000 не производятся.</div> 
                </div> 
                <form action="<?php 
echo is_release() ? "http://www.onlinedengi.ru/wmpaycheck.php" : "/bill/test/webpay.php";
?>
" method="post" id="<?php 
echo $type_payment;
?>
" name="<?php 
echo $type_payment;
?>
">
                    <input type="hidden" name="project" value="3097"  />
                    <input type="hidden" name="mode_type" value="204"  />
                    <input type="hidden" name="nickname" value="<?php 
echo $bill->user['login'];
?>
"  />
                    <input type="hidden" name="nick_extra" value="<?php 
echo $bill->user['login'];
?>
"  />
                    <input type="hidden" name="amount" value="<?php 
Esempio n. 22
0
 /**
  * @deprecated Синхронная выплата, сейчас используется очередь
  * 
  * Выплата через сервис
  * 
  * @param type $reserveInstance
  * @param type $type
  * @return substatus
  * @throws Exception
  */
 public function payout($reserveInstance, $type)
 {
     $uid = $reserveInstance->getFrlId();
     $reserve_id = $reserveInstance->getID();
     $sum = $reserveInstance->getPayoutSum();
     //Подготовка данных/реквизитов для последующей работы с API
     try {
         if ($sum <= 0) {
             throw new ReservesPayoutException(ReservesPayoutException::WRONG_SUM);
         }
         $reqv = array();
         $request_list = $this->getPayouts($reserve_id);
         $is_allow_repeated = $this->isAllowRepeatedRequest($request_list);
         if ($is_allow_repeated) {
             //Это повторный запрос на выплату
             //нельзя менять реквизиты!
             //Если нельзя обновлять реквизиты то читаем из слепка
             $data_reqv = $this->getPayoutReqv($reserve_id);
             if ($data_reqv) {
                 $reqv = mb_unserialize($data_reqv['fields']);
                 if ($reqv) {
                     $type = $data_reqv['pay_type'];
                 }
             }
             if (!$reqv) {
                 throw new ReservesPayoutException(ReservesPayoutException::REQV_INVALID);
             }
             $is_update = false;
             //Если нет мобильного у существующих реквизитов
             //то пробует получить из обычного телефона
             if (!isset($reqv['mob_phone']) || empty($reqv['mob_phone'])) {
                 $is_update = true;
                 $reqv['mob_phone'] = @$reqv['phone'];
                 if (empty($reqv['mob_phone'])) {
                     throw new ReservesPayoutException(ReservesPayoutException::PHONE_FAIL);
                 }
             }
             //Если выплата на карту то получаем и сохраняем ее синоним
             if ($type == ReservesPayoutPopup::PAYMENT_TYPE_CARD && !isset($reqv['skr_destinationCardSynonim'])) {
                 $is_update = true;
                 $reqv['skr_destinationCardSynonim'] = $this->getDestinationCardSynonim($reqv['el_ccard'], $sum);
                 if (!$reqv['skr_destinationCardSynonim']) {
                     throw new ReservesPayoutException(ReservesPayoutException::CARD_SYNONIM_FAIL);
                 }
             }
             //Обновляем реквизиты
             if ($is_update) {
                 $this->updateReqv($reserve_id, $reqv);
                 //Фиксируем остояние в истории
                 $this->saveToHistory($reserve_id);
             }
         } else {
             //Иначе сознаем новый запрос на выплату
             $reqv = $this->getUserReqvs($uid, $type, $sum);
             if (!$reqv) {
                 throw new ReservesPayoutException(ReservesPayoutException::REQV_FAIL, $type, $uid);
             }
             //Если выплата на карту то получаем и сохраняем ее синоним
             if ($type == ReservesPayoutPopup::PAYMENT_TYPE_CARD) {
                 $reqv['skr_destinationCardSynonim'] = $this->getDestinationCardSynonim($reqv['el_ccard'], $sum);
                 if (!$reqv['skr_destinationCardSynonim']) {
                     throw new ReservesPayoutException(ReservesPayoutException::CARD_SYNONIM_FAIL);
                 }
             }
             //Создаем запросы на выплату если нужно дробим сумму
             $request_list = $this->calcRequestList($reserve_id, $sum);
             $this->db()->start();
             $ok_1 = $this->insertReqv($reserve_id, $type, $reqv);
             if ($ok_1) {
                 foreach ($request_list as $key => $payout) {
                     $ok_2 = $this->db()->insert($this->TABLE, $payout, 'id');
                     if (!$ok_2) {
                         break;
                     }
                     $request_list[$key]['id'] = $ok_2;
                 }
             }
             //Если при добавлении списка задач или реквизитов возникла ошибка
             //то откатываем назад транзакцию и валимся с ошибкой
             if (!$ok_1 || !$ok_2) {
                 $this->db()->rollback();
                 $request_list = array();
                 throw new ReservesPayoutException(ReservesPayoutException::INS_FAIL);
             }
             if (!$this->db()->commit()) {
                 $request_list = array();
                 throw new ReservesPayoutException(ReservesPayoutException::INS_FAIL);
             }
             //Если все ок - сохраняем в историю
             $this->saveToHistory($reserve_id);
         }
         //На всякий пожарный проверяем наличие списка задач на выплату
         if (empty($request_list)) {
             throw new ReservesPayoutException(ReservesPayoutException::RQST_EMPTY);
         }
     } catch (Exception $e) {
         $this->errorLog($reserve_id, $e->getMessage());
         return ReservesModel::SUBSTATUS_ERR;
     }
     $substatus = ReservesModel::SUBSTATUS_PAYED;
     //Если это не боевой сервер то всегда успешная выплата
     //но! при этом не меняется статус у задач из reserves_payout
     if (!is_release()) {
         return $substatus;
     }
     //Формирование запроса к API сервиса и обработка ответа
     try {
         $depositionRequest = new DepositionRequest();
         $depositionRequest->setAgentId($this->agent_id);
         $depositionRequest->setCurrency($this->currency);
         $depositionRequest->setPofOfferAccepted(1);
         $depositionRequest->setSmsPhoneNumber(trim(str_replace('+', '', $reqv['mob_phone'])));
         foreach ($request_list as $key => $request) {
             if ($request['status'] == static::STATUS_SUCCESS) {
                 continue;
             }
             $depositionRequest->setAmount(number_format($request['price'], 2, '.', ''));
             $depositionRequest->setClientOrderId($request['id']);
             //Заполняем общие параметры для платежей
             //Например реквизиты юзера
             switch ($type) {
                 case ReservesPayoutPopup::PAYMENT_TYPE_RS:
                     //Реквизиты юзера
                     $fio = explode(' ', $reqv['fio']);
                     $depositionRequest->setTmpFirstName(@$fio[1]);
                     $depositionRequest->setTmpMiddleName(@$fio[2]);
                     $depositionRequest->setTmpLastName(@$fio[0]);
                 case ReservesPayoutPopup::PAYMENT_TYPE_CARD:
                     //Реквизиты юзера
                     $fio = explode(' ', $reqv['fio']);
                     $depositionRequest->setPdrFirstName(@$fio[1]);
                     $depositionRequest->setPdrMiddleName(@$fio[2]);
                     $depositionRequest->setPdrLastName(@$fio[0]);
                     if (isset($reqv['rez_type']) && @$reqv['rez_type'] == sbr::RT_UABYKZ) {
                         $depositionRequest->setPdrDocType(10);
                     } else {
                         $depositionRequest->setPdrDocType(21);
                     }
                     $depositionRequest->setPdrDocNumber(@$reqv['idcard_ser'] . @$reqv['idcard']);
                     $date = explode('.', @$reqv['idcard_from']);
                     $depositionRequest->setPdrDocIssueYear(@$date[2]);
                     $depositionRequest->setPdrDocIssueMonth(@$date[1]);
                     $depositionRequest->setPdrDocIssueDay(@$date[0]);
                     $depositionRequest->setPdrDocIssuedBy(@$reqv['idcard_by']);
                     $country_iso = @$reqv['country_iso'];
                     //@todo: если не удалось выявить код то Россия Матушка :D !
                     $depositionRequest->setPdrCountry($country_iso ? $country_iso : 643);
                     //парсим адрес по формату:
                     //127287, Россия, г. Москва, ул. 2-я Хуторская д 38А стр.9
                     $info = explode(',', @$reqv['address']);
                     if (isset($reqv['index']) && !empty($reqv['index'])) {
                         $depositionRequest->setPdrPostcode($reqv['index']);
                     } else {
                         $depositionRequest->setPdrPostcode(trim(@$info[0]));
                     }
                     if (isset($reqv['city']) && !empty($reqv['city'])) {
                         $depositionRequest->setPdrCity($reqv['city']);
                         $depositionRequest->setPdrBirthPlace($reqv['city']);
                     } else {
                         $depositionRequest->setPdrCity(trim(@$info[2]));
                         $depositionRequest->setPdrBirthPlace(trim(@$info[2]));
                     }
                     if (count($info) > 4) {
                         unset($info[0], $info[1], $info[2]);
                         $depositionRequest->setPdrAddress(trim(implode(',', $info)));
                     } else {
                         $depositionRequest->setPdrAddress(trim(@$info[3]));
                     }
                     $depositionRequest->setPdrBirthDate(@$reqv['birthday']);
                     break;
             }
             //Специфика для каждого платежа в отдельности
             switch ($type) {
                 case ReservesPayoutPopup::PAYMENT_TYPE_YA:
                     $depositionRequest->setDstAccount($reqv['el_yd']);
                     break;
                 case ReservesPayoutPopup::PAYMENT_TYPE_CARD:
                     $depositionRequest->setDstAccount(25700130535186);
                     $depositionRequest->setSkrDestinationCardSynonim($reqv['skr_destinationCardSynonim']);
                     break;
                 case ReservesPayoutPopup::PAYMENT_TYPE_RS:
                     $depositionRequest->setDstAccount(2570066962077);
                     $bank = explode(',', $reqv['bank_name']);
                     $depositionRequest->setBankName(trim(@$bank[0]));
                     if (isset($reqv['bank_city']) && !empty($reqv['bank_city'])) {
                         $depositionRequest->setBankCity(trim(@$reqv['bank_city']));
                     } else {
                         $depositionRequest->setBankCity(trim(@$bank[1]));
                     }
                     $depositionRequest->setBankBIK(trim(@$reqv['bank_bik']));
                     $depositionRequest->setBankCorAccount(trim(@$reqv['bank_ks']));
                     $depositionRequest->setBankKPP(trim(@$reqv['bank_kpp']));
                     $depositionRequest->setBankINN(trim(@$reqv['bank_inn']));
                     /*@todo: ЯД меняет формат на ходу, тут устаревший
                       if (isset($reqv['bank_assignment']) && 
                          !empty($reqv['bank_assignment'])) {
                           $depositionRequest->setDepositAccount(@$reqv['bank_rs']);
                           $depositionRequest->setFaceAccount(@$reqv['bank_assignment']);
                       } else {
                           $depositionRequest->setRubAccount(@$reqv['bank_rs']);
                       }
                       */
                     $bank_rs = trim(@$reqv['bank_rs']);
                     $depositionRequest->setDepositAccount($bank_rs);
                     $depositionRequest->setFaceAccount($bank_rs);
                     $depositionRequest->setCustAccount($bank_rs);
                     break;
                 default:
                     throw new ReservesPayoutException(ReservesPayoutException::TYPE_INVALID, $type);
             }
             $current_substatus = ReservesModel::SUBSTATUS_PAYED;
             //Запрос к API
             $result = $this->getApiFacade()->testDeposition($depositionRequest);
             if (!$result->isSuccess() && $result->getError() != 26) {
                 $current_substatus = ReservesModel::SUBSTATUS_ERR;
             } else {
                 $result = $this->getApiFacade()->makeDeposition($depositionRequest);
                 if ($result->getStatus() == static::STATUS_INPROGRESS) {
                     $current_substatus = ReservesModel::SUBSTATUS_INPROGRESS;
                 } elseif ($result->getStatus() == static::STATUS_FAIL) {
                     $current_substatus = ReservesModel::SUBSTATUS_ERR;
                 }
             }
             $_request = array('status' => $result->getStatus(), 'error' => !$result->isSuccess() ? $result->getError() : 0, 'last' => 'NOW()', 'cnt' => $request['cnt'] + 1, 'techmessage' => $result->getTechMessage());
             $this->db()->update($this->TABLE, $_request, 'id = ?i', $result->getClientOrderId());
             if ($current_substatus == ReservesModel::SUBSTATUS_ERR) {
                 if ($substatus != ReservesModel::SUBSTATUS_INPROGRESS) {
                     $substatus = $current_substatus;
                 }
                 $techmessage = $result->getTechMessage();
                 if ($techmessage) {
                     $techmessage = " ({$techmessage})";
                 }
                 $this->errorLog($reserve_id, sprintf(ReservesPayoutException::LAST_PAYED_FAIL, $result->getClientOrderId(), $result->getError(), $techmessage));
             } elseif ($current_substatus == ReservesModel::SUBSTATUS_INPROGRESS) {
                 $substatus = $current_substatus;
             }
         }
         //Сохраняем в историю слепок с последнего ответа
         $this->saveToHistory($reserve_id);
     } catch (Exception $e) {
         $this->errorLog($reserve_id, $e->getMessage());
         return ReservesModel::SUBSTATUS_ERR;
     }
     return $substatus;
 }
Esempio n. 23
0
    <tbody>
        <tr class="b-layout__tr">
            <td class="b-layout__td b-layout__td_padright_20">
                <div class="b-fon b-fon_bg_fff9bf b-fon_pad_10 b-fon_padleft_35">
                    <div class="b-layout__txt b-layout__txt_fontsize_11 b-layout__txt_bold"><span class="b-icon b-icon_sbr_oattent b-icon_margleft_-20"></span>ќбратите внимание</div>
                    <div class="b-layout__txt b-layout__txt_fontsize_11">Ч ќплата услуг производитс¤ в течение 2-3 минут.</div> 
                    <div class="b-layout__txt b-layout__txt_fontsize_11">Ч ѕосле нажати¤ на кнопку ќплатить вы будете перенаправлены в платежную систему WebMoney.</div>
                </div>
                <form id="<?php 
echo $type_payment;
?>
" name="<?php 
echo $type_payment;
?>
" method="post" action="<?php 
echo is_release() ? "https://paymaster.ru/Payment/Init" : "/bill/test/wmpay.php";
?>
">
                    <input type="hidden" name="LMI_MERCHANT_ID" value="<?php 
echo $bill->pm->merchants[pmpay::MERCHANT_BILL];
?>
" />
                    <input type="hidden" name="LMI_PAYMENT_AMOUNT" id="ammount" value="<?php 
echo $payment_sum;
?>
" />
                    <input type="hidden" name="LMI_CURRENCY" value="RUB" />
                    <input type="hidden" name="LMI_PAYMENT_DESC_BASE64" value="<?php 
echo base64_encode(iconv('CP1251', 'UTF-8', "ќплата за услуги сайта www.free-lance.ru, в том числе Ќƒ— - 18%. —чет #" . $bill->acc['id'] . ", логин " . $bill->user['login']));
?>
" />
Esempio n. 24
0
 public function __construct()
 {
     $this->payments = array(3 => self::PAYMENT_YD, 6 => self::PAYMENT_AC, 10 => self::PAYMENT_WM, 16 => self::PAYMENT_AB, 17 => self::PAYMENT_SB);
     $this->setTest(!is_release());
 }
Esempio n. 25
0
<h2 class="b-layout__title b-layout__title_padbot_30">Оплата через МТС</h2>

<table class="b-layout__table b-layout__table_width_full">
    <tbody>
        <tr class="b-layout__tr">
            <td class="b-layout__td b-layout__td_padright_20">
                <form method="POST" action="<?php 
echo is_release() ? "/bill/payment/?type={$type_payment}" : "/bill/test/qiwipurse.php";
?>
" id="<?php 
echo $type_payment;
?>
" name="<?php 
echo $type_payment;
?>
">
                    <div class="b-layout__txt b-layout__txt_inline-block b-layout__txt_padtop_5 b-page__desktop b-page__ipad">Мобильный телефон</div>
                    <div class="b-combo b-combo_inline-block b-combo_padbot_20">
                        <div class="b-combo__input <?php 
echo $bill->error['phone'] ? "b-combo__input_error" : "";
?>
 b-combo__input_width_170 b-combo__input_tel
                               b-combo__input_phone_countries_dropdown b-combo__input_visible_items_5 use_scroll show_all_records
                                                    b-combo__input_init_countryPhoneCodes">
                            <input type="text" maxlength="15" id="reg_phone" class="b-combo__input-text payment-system js-payform_input" name="phone" size="80" value="7">
                            <span class="b-combo__tel"><span class="b-combo__flag" style="background-position:0 -660px"></span></span> 
                        </div>
                    </div>
                    
                    <div class="i-shadow">
                        <div id="error_phone" class="b-shadow b-shadow_zindex_3 b-shadow_m <?php 
Esempio n. 26
0
                <div class="b-layout__txt b-layout__txt_color_a0763b b-layout__txt_padtop_20 b-layout__txt_padleft_20"><span class="b-icon b-icon_top_2 b-icon_margleft_-20 b-icon_sbr_oattent"></span>После резервирования вернуть деньги можно будет только через арбитраж.</div>									
                <div id="finance-err" class="b-layout__txt b-layout__txt_color_c10600 b-layout__txt_padleft_20 b-layout__txt_padtop_30 b-layout_hide"><span class="b-icon b-icon_top_2 b-icon_margleft_-20 b-icon_sbr_rattent"></span>Произошла ошибка. <span id="finance-err-txt"></span></div>
                <div class="b-buttons b-buttons_padtop_40 b-buttons_padleft_20">
                    <a href="javascript:void(0)" onclick="if(!$(this).hasClass('b-button_disabled')) <?php 
echo $sbr->scheme_type == sbr::SCHEME_PDRD2 ? "sendReservePdrd('{$sbr->data['id']}')" : "sendReserve()";
?>
" class="b-button b-button_flat b-button_flat_green<?php 
echo $noFinanceDataPDRD ? " b-button_disabled" : "";
?>
" id="send_btn">Зарезервировать деньги
                                <img width="26" height="6" alt="" src="/css/block/b-button/b-button__load.gif" class="b-button__load b-layout_hide"></a>
                    <span id="finance-btns"><span class="b-buttons__txt b-buttons__txt_padleft_10">или</span> <a class="b-buttons__link b-buttons__link_dot_c10601" href="javascript:void(0)" onclick="if(confirm('Отменить сделку?')) { submitForm($('actionSbrForm'), {action: 'status_action', cancel:1}); }">отменить сделку</a>	</span>
                    <span id="finance-btns-spinn" class="b-buttons__txt b-buttons__txt_padleft_10" style="display: none;">идет подготовка к резервированию, это может занять от нескольких секунд до минуты…</span>
                </div>
                <?php 
if ($sbr->scheme_type == sbr::SCHEME_PDRD2 && !is_release()) {
    ?>
                <div class="b-buttons b-buttons_padtop_40 b-buttons_padleft_20" id="buttonBankReserved">
                    <a href="javascript:void(0)" onclick="if(!$(this).hasClass('b-button_disabled')) submitForm($('commonFrm'), {action: 'test_reserve'});" class="b-button b-button_flat b-button_flat_green">Я тестю
                                <img width="26" height="6" alt="" src="/css/block/b-button/b-button__load.gif" class="b-button__load b-layout_hide"></a>
                </div>
                <?php 
}
?>
            </td>
        </tr>
    </table>
    <?php 
if ($sbr->scheme_type == sbr::SCHEME_LC) {
    ?>
    <input type="hidden" name="project" value="<?php 
Esempio n. 27
0
    echo cardpay::TESTMODE;
    ?>
" />
    <input name="ieutf" type="hidden" value="&#9760;" />
<?php 
} else {
    //if
    ?>
<form id="<?php 
    echo $type_payment;
    ?>
" name="<?php 
    echo $type_payment;
    ?>
" action="<?php 
    echo is_release() ? $bill->pm->getRedirectUrl($bill->pm->order_id, $payment_sum) : "/bill/test/card.php";
    ?>
" accept-charset="UTF-8" method="post">  
    <input type="hidden" name="OrderAmount" id="ammount" value="<?php 
    echo $payment_sum;
    ?>
" />
    <input type="hidden" name="OrderNumber" value="<?php 
    echo $bill->pm->order_id;
    ?>
" />
<?php 
}
//else
?>
    <table class="b-layout__table">
Esempio n. 28
0
 /**
  * Добавление нового файла (стилей, ява-скрипта, др) перед вызовом static_compress::send().
  * @see static_compress::send()
  * 
  * @param string $fname   путь к файлу.
  */
 function add($fname, $utf8 = false)
 {
     if ($this->isAdded($fname)) {
         return;
     }
     if (strstr($fname, '.php') !== false && preg_match('/(kword_js|kword_search_js|professions_js|cities_js|tservices_categories_js)\\.php/', $fname)) {
         $this->_add(self::TYPE_PHP_JS, $fname);
     } else {
         if (strstr($fname, '.js') !== false) {
             $this->_add($utf8 ? self::TYPE_JS_UTF8 : self::TYPE_JS, $fname);
         } else {
             if (strstr($fname, '.css') !== false) {
                 if ($this->isMSIE && COMPRESS_STATIC) {
                     if (!$this->_addWorker) {
                         $fsize = @filesize($this->root($fname));
                         $maxsize = self::MAX_CSSSIZE_IE * 1024;
                         if ($fsize > $maxsize) {
                             $this->_log->writeln("ERROR! {$fname} size is {$fsize} bytes (limit is {$maxsize})");
                             if (!is_release()) {
                                 die("static_compress: ERROR! {$fname} size is {$fsize} bytes (limit is {$maxsize}). Необходимо разбить файл на более мелкие.");
                             }
                         }
                         if ($this->_cssSize && $this->_cssSize + $fsize > $maxsize) {
                             $this->_addWorker = new static_compress($this->enabled);
                         }
                         $this->_cssSize += $fsize;
                     }
                     if ($this->_addWorker) {
                         return $this->_addWorker->add($fname);
                     }
                 }
                 $this->_add(self::TYPE_CSS, $fname);
             }
         }
     }
 }
Esempio n. 29
0
                <div class="b-layout__txt b-layout__txt_padbot_15">Обращаем ваше внимание на то, что оплата с помощью терминалов QIWI доступна только пользователям, находящимся на территории Российской Федерации.</div>
                    
                <div class="b-fon b-fon_bg_fcc b-fon_padbot_20">
                    <b class="b-fon__b1"></b>
                    <b class="b-fon__b2"></b>
                    <div class="b-fon__body b-fon__body_pad_5"><strong>Внимание:</strong> мы не осуществляем возврат денежных средств при оплате через терминалы.</div>
                    <b class="b-fon__b2"></b>
                    <b class="b-fon__b1"></b>
                </div>
                <h3 class="b-layout__h3">Что делать, если деньги не были перечислены на счет?</h3>
                <div class="b-layout__txt">В случае, если зачисление суммы не произошло, напишите нам в <a class="b-layout__link" href="/about/feedback/">Службу поддержки</a> и пришлите копию чека об оплате (скан).</div>
                <?php 
if (!$print) {
    ?>
                <form method="POST" action="<?php 
    echo is_release() ? "/bill/payment/?type={$type_payment}" : '/bill/test/osmp.php';
    ?>
" id="<?php 
    echo $type_payment;
    ?>
" name="<?php 
    echo $type_payment;
    ?>
">
                    <input type="hidden" name="action" value="osmp" />
                    <input type="hidden" name="sum" value="<?php 
    echo $payment_sum;
    ?>
" />
                </form>
                <?php 
Esempio n. 30
0
<h2 class="b-layout__title b-layout__title_padbot_30">Оплата через Okpay</h2>

<table class="b-layout__table b-layout__table_width_full">
    <tbody>
        <tr class="b-layout__tr">
            <td class="b-layout__td b-layout__td_padright_20">
                <form method="POST" action="<?php 
echo is_release() ? 'https://www.okpay.com/process.html' : '/bill/test/okpay.php';
?>
" id="<?php 
echo $type_payment;
?>
" name="<?php 
echo $type_payment;
?>
">
                    <div class="b-layout__txt b-layout__txt_inline-block b-layout__txt_padtop_5 b-page__desktop b-page__ipad">Мобильный телефон</div>
                    <div class="b-combo b-combo_inline-block b-combo_padbot_20">
                        <div class="b-combo__input <?php 
echo $bill->error['phone'] ? 'b-combo__input_error' : '';
?>
 b-combo__input_width_170 b-combo__input_tel
                               b-combo__input_phone_countries_dropdown b-combo__input_visible_items_5 use_scroll show_all_records
                                                    b-combo__input_init_countryPhoneCodes">
                            <input type="text" maxlength="15" id="reg_phone" class="b-combo__input-text payment-system js-payform_input" name="phone" size="80" value="7">
                            <span class="b-combo__tel"><span class="b-combo__flag" style="background-position:0 -660px"></span></span> 
                        </div>
                    </div>
                    
                    <div class="i-shadow">
                        <div id="error_phone" class="b-shadow b-shadow_zindex_3 b-shadow_m <?php