* @package payments * @version 1.1.2 * @author CMSWorks Team * @copyright Copyright (c) CMSWorks.ru * @license BSD */ defined('COT_CODE') or die('Wrong URL.'); require_once cot_incfile('payments', 'module'); $cot_billings = array(); /* === Hook === */ foreach (cot_getextplugins('payments.billing.register') as $pl) { include $pl; } /* ===== */ // Проверяем платежки на оплату пополнение счета. if ($balancepays = cot_payments_getallpays('balance', 'paid')) { foreach ($balancepays as $pay) { if (cot_payments_updatestatus($pay['pay_id'], 'done')) { $urr = $db->query("SELECT * FROM {$db_users} WHERE user_id=" . $pay['pay_userid'])->fetch(); $subject = $L['payments_balance_billing_admin_subject']; $body = sprintf($L['payments_balance_billing_admin_body'], $urr['user_name'], $pay['pay_summ'] . ' ' . $cfg['payments']['valuta'], $pay['pay_id'], cot_date('d.m.Y в H:i', $pay['pay_pdate'])); cot_mail($cfg['adminemail'], $subject, $body); if (!empty($pay['pay_code'])) { $dpay = cot_payments_payinfo($pay['pay_code']); if (!empty($dpay)) { $ubalance = cot_payments_getuserbalance($dpay['pay_userid']); if ($ubalance >= $dpay['pay_summ'] && cot_payments_updatestatus($dpay['pay_id'], 'paid')) { cot_payments_updateuserbalance($dpay['pay_userid'], -$dpay['pay_summ'], $dpay['pay_id']); } } }
<?php /** * [BEGIN_COT_EXT] * Hooks=global * [END_COT_EXT] */ defined('COT_CODE') or die('Wrong URL.'); require_once cot_incfile('paypro', 'plug'); require_once cot_incfile('payments', 'module'); // Проверяем платежки на оплату услуги PRO. Если есть то включаем услугу или продлеваем ее. if ($propays = cot_payments_getallpays('pro', 'paid')) { foreach ($propays as $pay) { $userid = !empty($pay['pay_code']) ? $pay['pay_code'] : $pay['pay_userid']; $upro = cot_getuserpro($userid); $initialtime = $upro > $sys['now'] ? $upro : $sys['now']; $rproexpire = $initialtime + $pay['pay_time']; if (cot_payments_updatestatus($pay['pay_id'], 'done')) { $db->update($db_users, array('user_pro' => (int) $rproexpire), "user_id=" . (int) $userid); /* === Hook === */ foreach (cot_getextplugins('paypro.done') as $pl) { include $pl; } /* ===== */ } } }
<?php /** * [BEGIN_COT_EXT] * Hooks=global * [END_COT_EXT] */ defined('COT_CODE') or die('Wrong URL.'); require_once cot_incfile('payprjtop', 'plug'); require_once cot_incfile('projects', 'module'); require_once cot_incfile('payments', 'module'); if ($pays = cot_payments_getallpays('prj.top', 'paid')) { foreach ($pays as $pay) { $adv = $db->query("SELECT item_top FROM {$db_projects} WHERE item_id=" . $pay['pay_code'])->fetch(); $initialtime = $adv['item_top'] > $sys['now'] ? $adv['item_top'] : $sys['now']; $rtopexpire = $initialtime + $pay['pay_time']; if (cot_payments_updatestatus($pay['pay_id'], 'done')) { $db->update($db_projects, array('item_top' => (int) $rtopexpire), "item_id=" . (int) $pay['pay_code']); /* === Hook === */ foreach (cot_getextplugins('payprjtop.done') as $pl) { include $pl; } /* ===== */ } } }
*/ /** * marketorders plugin * * @package marketorders * @version 1.0.0 * @author CMSWorks Team * @copyright Copyright (c) CMSWorks.ru * @license BSD */ defined('COT_CODE') or die('Wrong URL.'); require_once cot_incfile('marketorders', 'plug'); require_once cot_incfile('market', 'module'); require_once cot_incfile('payments', 'module'); // Проверяем платежки на оплату в маркете if ($marketpays = cot_payments_getallpays('marketorders', 'paid')) { foreach ($marketpays as $pay) { if (cot_payments_updatestatus($pay['pay_id'], 'done')) { $db->update($db_market_orders, array('order_paid' => (int) $sys['now'], 'order_status' => 'paid'), "order_id=" . (int) $pay['pay_code']); $marketorder = $db->query("SELECT * FROM {$db_market_orders} AS o\n\t\t\t\tLEFT JOIN {$db_market} AS m ON m.item_id=o.order_pid\n\t\t\t\tWHERE order_id=" . $pay['pay_code'])->fetch(); $seller = $db->query("SELECT * FROM {$db_users} WHERE user_id=" . $marketorder['order_seller'])->fetch(); if ($marketorder['order_userid'] > 0) { $customer = $db->query("SELECT * FROM {$db_users} WHERE user_id=" . $marketorder['order_userid'])->fetch(); } else { $customer['user_name'] = $marketorder['order_email']; $customer['user_email'] = $marketorder['order_email']; } $summ = $marketorder['order_cost'] - $marketorder['order_cost'] * $cfg['plugin']['marketorders']['tax'] / 100; // Уведопляем продавца о совершении покупки его товара $rsubject = cot_rc($L['marketorders_paid_mail_toseller_header'], array('order_id' => $marketorder['order_id'], 'product_title' => $marketorder['item_title'])); $rbody = cot_rc($L['marketorders_paid_mail_toseller_body'], array('user_name' => $customer['user_name'], 'product_id' => $marketorder['item_id'], 'product_title' => $marketorder['item_title'], 'order_id' => $marketorder['order_id'], 'summ' => $summ . ' ' . $cfg['payments']['valuta'], 'tax' => $cfg['plugin']['marketorders']['tax'], 'warranty' => $cfg['plugin']['marketorders']['warranty'], 'sitename' => $cfg['maintitle'], 'link' => COT_ABSOLUTE_URL . cot_url('marketorders', "id=" . $marketorder['order_id'], '', true)));
<?php /** * [BEGIN_COT_EXT] * Hooks=global * [END_COT_EXT] */ defined('COT_CODE') or die('Wrong URL.'); require_once cot_incfile('paytop', 'plug'); require_once cot_incfile('payments', 'module'); // Проверяем платежки на оплату услуги TOP. Если есть то включаем услугу или продлеваем ее. $pt_cfg = cot_cfg_paytop(); foreach ($pt_cfg as $area => $opt) { if ($toppays = cot_payments_getallpays('paytop.' . $area, 'paid')) { foreach ($toppays as $pay) { if (cot_payments_userservice('paytop.' . $area, $pay['pay_userid'], $pay['pay_time'])) { if (cot_payments_updatestatus($pay['pay_id'], 'done')) { /* === Hook === */ foreach (cot_getextplugins('paytop.done') as $pl) { include $pl; } /* ===== */ /* === Hook === */ foreach (cot_getextplugins('paytop.' . $area . '.done') as $pl) { include $pl; } /* ===== */ } } } }
<?php /** * [BEGIN_COT_EXT] * Hooks=global * [END_COT_EXT] */ defined('COT_CODE') or die('Wrong URL.'); require_once cot_incfile('payprjbold', 'plug'); require_once cot_incfile('projects', 'module'); require_once cot_incfile('payments', 'module'); if ($pays = cot_payments_getallpays('prj.bold', 'paid')) { foreach ($pays as $pay) { $adv = $db->query("SELECT item_bold FROM {$db_projects} WHERE item_id=" . $pay['pay_code'])->fetch(); $initialtime = $adv['item_bold'] > $sys['now'] ? $adv['item_bold'] : $sys['now']; $rboldexpire = $initialtime + $pay['pay_time']; if (cot_payments_updatestatus($pay['pay_id'], 'done')) { $db->update($db_projects, array('item_bold' => (int) $rboldexpire), "item_id=" . (int) $pay['pay_code']); /* === Hook === */ foreach (cot_getextplugins('payprjbold.done') as $pl) { include $pl; } /* ===== */ } } }
<?php /** * [BEGIN_COT_EXT] * Hooks=global * [END_COT_EXT] */ defined('COT_CODE') or die('Wrong URL.'); require_once cot_incfile('sbr', 'plug'); require_once cot_incfile('payments', 'module'); // Проверяем платежки на оплату сделок. Если есть то активируем сделки. if ($sbrpays = cot_payments_getallpays('sbr', 'paid')) { foreach ($sbrpays as $pay) { if (cot_payments_updatestatus($pay['pay_id'], 'done')) { if ($sbr = $db->query("SELECT * FROM {$db_sbr} WHERE sbr_id=" . $pay['pay_code'])->fetch()) { // Запуск сделки на исполнение if ($db->update($db_sbr, array('sbr_status' => 'process', 'sbr_begin' => $sys['now']), "sbr_id=" . $pay['pay_code'])) { // Выбираем исполнителем, если сделка привязана к проекту if ($sbr['sbr_pid'] > 0) { // находим предыдущего выбранного исполнителя, если есть $lastperformer = $db->query("SELECT u.* FROM {$db_projects_offers} AS o\n\t\t\t\t\t\t\tLEFT JOIN {$db_users} AS u ON u.user_id=o.offer_userid \n\t\t\t\t\t\t\tWHERE offer_pid=" . (int) $sbr['sbr_pid'] . " AND offer_choise='performer'")->fetch(); if ($db->update($db_projects_offers, array("offer_choise" => 'performer', "offer_choise_date" => (int) $sys['now']), "offer_pid=" . (int) $sbr['sbr_pid'] . " AND offer_userid=" . (int) $sbr['sbr_performer'])) { if ($db->fieldExists($db_projects, "item_performer")) { if ($db->update($db_projects, array("item_performer" => $sbr['sbr_performer']), "item_id=" . (int) $sbr['sbr_pid'])) { /* === Hook === */ foreach (cot_getextplugins('sbr.pay.setperformer') as $pl) { include $pl; } /* ===== */ } }