本文整理汇总了PHP中CSalePaySystemAction::InitParamArrays方法的典型用法代码示例。如果您正苦于以下问题:PHP CSalePaySystemAction::InitParamArrays方法的具体用法?PHP CSalePaySystemAction::InitParamArrays怎么用?PHP CSalePaySystemAction::InitParamArrays使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSalePaySystemAction
的用法示例。
在下文中一共展示了CSalePaySystemAction::InitParamArrays方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: is_file
}
elseif (strlen($arPaySys["PSA_RESULT_FILE"]) > 0)
{
if (file_exists($_SERVER["DOCUMENT_ROOT"].$arPaySys["PSA_RESULT_FILE"])
&& is_file($_SERVER["DOCUMENT_ROOT"].$arPaySys["PSA_RESULT_FILE"]))
$psResultFile = $_SERVER["DOCUMENT_ROOT"].$arPaySys["PSA_RESULT_FILE"];
}
if (strlen($psResultFile) <= 0)
$errorMessageTmp .= GetMessage("SOD_NO_PS_SCRIPT").". ";
}
if (strlen($errorMessageTmp) <= 0)
{
$ORDER_ID = $ID;
CSalePaySystemAction::InitParamArrays($arOrder, $ID, $arPaySys["PSA_PARAMS"]);
if (!include($psResultFile))
$errorMessageTmp .= GetMessage("ERROR_CONNECT_PAY_SYS").". ";
}
if (strlen($errorMessageTmp) <= 0)
{
$ORDER_ID = IntVal($ORDER_ID);
$arOrder = CSaleOrder::GetByID($ORDER_ID);
if (!$arOrder)
$errorMessageTmp .= str_replace("#ID#", $ORDER_ID, GetMessage("SOD_NO_ORDER")).". ";
}
if (strlen($errorMessageTmp) <= 0)
{
if ($arOrder["PS_STATUS"] == "Y" && $arOrder["PAYED"] == "N")
{
示例2: obtainDataPaySystem
/**
* Function gets pay system info from database, no cache is used here
* @return void
*/
protected function obtainDataPaySystem()
{
if (empty($this->dbResult["ID"])) {
return;
}
foreach ($this->dbResult['PAYMENT'] as &$payment) {
if (intval($payment["PAY_SYSTEM_ID"])) {
$payment["PAY_SYSTEM"] = \Bitrix\Sale\PaySystem\Manager::getById($payment["PAY_SYSTEM_ID"]);
$payment["PAY_SYSTEM"]['NAME'] = htmlspecialcharsbx($payment["PAY_SYSTEM"]['NAME']);
}
if ($payment["PAID"] != "Y" && $this->dbResult["CANCELED"] != "Y") {
$payment['BUFFERED_OUTPUT'] = '';
$payment['ERROR'] = '';
$service = new \Bitrix\Sale\PaySystem\Service($payment["PAY_SYSTEM"]);
if ($service) {
$payment["CAN_REPAY"] = "Y";
if ($service->getField("NEW_WINDOW") == "Y") {
$payment["PAY_SYSTEM"]["PSA_ACTION_FILE"] = htmlspecialcharsbx($this->arParams["PATH_TO_PAYMENT"]) . '?ORDER_ID=' . urlencode(urlencode($this->dbResult["ACCOUNT_NUMBER"])) . '&PAYMENT_ID=' . $payment['ID'];
} else {
CSalePaySystemAction::InitParamArrays($this->dbResult, $this->requestData["ID"], '', array(), $payment);
// for compatibility
$actionFile = $service->getField('ACTION_FILE');
$map = CSalePaySystemAction::getOldToNewHandlersMap();
$oldHandler = array_search($actionFile, $map);
if ($oldHandler !== false && !$service->isCustom()) {
$actionFile = $oldHandler;
}
$pathToAction = Main\Application::getDocumentRoot() . $actionFile;
$pathToAction = str_replace("\\", "/", $pathToAction);
while (substr($pathToAction, strlen($pathToAction) - 1, 1) == "/") {
$pathToAction = substr($pathToAction, 0, strlen($pathToAction) - 1);
}
if (file_exists($pathToAction)) {
if (is_dir($pathToAction) && file_exists($pathToAction . "/payment.php")) {
$pathToAction .= "/payment.php";
}
$payment["PAY_SYSTEM"]["PSA_ACTION_FILE"] = $pathToAction;
}
$encoding = $service->getField("ENCODING");
if (strlen($encoding) > 0) {
define("BX_SALE_ENCODING", $encoding);
AddEventHandler("main", "OnEndBufferContent", array($this, "changeBodyEncoding"));
}
/** @var \Bitrix\Sale\Order $order */
$order = \Bitrix\Sale\Order::load($this->dbResult["ID"]);
if ($order) {
/** @var \Bitrix\Sale\PaymentCollection $paymentCollection */
$paymentCollection = $order->getPaymentCollection();
if ($paymentCollection) {
/** @var \Bitrix\Sale\Payment $paymentItem */
$paymentItem = $paymentCollection->getItemById($payment['ID']);
if ($paymentItem) {
$initResult = $service->initiatePay($paymentItem, null, \Bitrix\Sale\PaySystem\BaseServiceHandler::STRING);
if ($initResult->isSuccess()) {
$payment['BUFFERED_OUTPUT'] = $initResult->getTemplate();
} else {
$payment['ERROR'] = implode('\\n', $initResult->getErrorMessages());
}
}
}
}
}
$payment["PAY_SYSTEM"]["PSA_NEW_WINDOW"] = $payment["PAY_SYSTEM"]["NEW_WINDOW"];
}
}
}
unset($payment);
// for compatibility
$this->dbResult['PAY_SYSTEM'] = $this->dbResult['PAYMENT'][0]['PAY_SYSTEM'];
$this->dbResult['CAN_REPAY'] = $this->dbResult['PAYMENT'][0]['CAN_REPAY'];
}
示例3: intval
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$orderId = intval($_POST['LMI_PAYMENT_NO']);
$paymentId = intval($_POST['PAYMENT_ID']);
$bCorrectPayment = true;
/** @var \Bitrix\Sale\Order $order */
$order = Order::load($orderId);
if (!$order) {
$bCorrectPayment = false;
}
$payment = $order->getPaymentCollection()->getItemById($paymentId);
if (!$payment) {
$bCorrectPayment = false;
}
$arOrder = $order->getFieldValues();
if ($bCorrectPayment) {
CSalePaySystemAction::InitParamArrays($arOrder, $arOrder["ID"], '', array(), $payment);
}
$CNST_SECRET_KEY = CSalePaySystemAction::GetParamValue("CNST_SECRET_KEY");
if (strlen($CNST_SECRET_KEY) <= 0) {
$bCorrectPayment = false;
}
$CNST_PAYEE_PURSE = CSalePaySystemAction::GetParamValue("SHOP_ACCT");
$currency = CSalePaySystemAction::GetParamValue("CURRENCY");
if (strlen($currency) <= 0 || $currency == "RUR") {
$currency = "RUB";
}
if ($_POST["LMI_PREREQUEST"] == "1" || $_POST["LMI_PREREQUEST"] == "2") {
if (CSalePaySystemAction::GetParamValue("SHOULD_PAY") == DoubleVal($_POST["LMI_PAYMENT_AMOUNT"]) && $currency == DoubleVal($_POST["LMI_CURRENCY"]) && $CNST_PAYEE_PURSE == $_POST["LMI_MERCHANT_ID"]) {
$APPLICATION->RestartBuffer();
echo "YES";
die;
示例4: GetMessage
}
}
}
if ($arParams['PAY_IMMED']) {
CSaleBasket::DeleteAll(CSaleBasket::GetBasketUserID());
}
CSaleBasket::Add(array('PRODUCT_ID' => $arResult['CURRENCIES'][$arResult['REQUEST_ACCOUNT']]['ID'], 'PRICE' => CCurrencyRates::ConvertCurrency($arResult['MONEY_OFF'], $arResult['REQUEST_ACCOUNT'], $arResult['LANG_CURRENCY']), 'CURRENCY' => $arResult['LANG_CURRENCY'], 'QUANTITY' => 1, 'LID' => LANG, 'DELAY' => 'N', 'CAN_BUY' => 'Y', 'NAME' => GetMessage('SPT_NAME_IN_CART', array('#VALUE#' => SaleFormatCurrency($arResult['REQUEST_AMOUNT'], $arResult['REQUEST_ACCOUNT']))), 'MODULE' => 'asd.money', 'DETAIL_PAGE_URL' => '', 'CATALOG_XML_ID' => $arResult['REQUEST_AMOUNT'] . '@' . $arResult['REQUEST_ACCOUNT']));
if ($arParams['PAY_IMMED']) {
$ORDER_ID = CSaleOrder::Add(array('LID' => SITE_ID, 'PERSON_TYPE_ID' => $arParams['PERSON_TYPE'], 'PRICE' => CCurrencyRates::ConvertCurrency($arResult['MONEY_OFF'], $arResult['REQUEST_ACCOUNT'], $arResult['LANG_CURRENCY']), 'CURRENCY' => $arResult['LANG_CURRENCY'], 'PAY_SYSTEM_ID' => $arResult['REQUEST_PAY_SYSTEM'], 'USER_ID' => $USER->getID()));
if ($ORDER_ID > 0) {
$arOrder = CSaleOrder::GetByID($ORDER_ID);
CSaleBasket::OrderBasket($ORDER_ID);
}
$arPaySysAction = $arResult['PAY_SYSTEMS'][$arResult['REQUEST_PAY_SYSTEM']];
if (strlen($arPaySysAction['ACTION_FILE']) > 0) {
CSalePaySystemAction::InitParamArrays($arOrder, $ORDER_ID, $arPaySysAction['PARAMS']);
$pathToAction = $_SERVER['DOCUMENT_ROOT'] . $arPaySysAction['ACTION_FILE'];
$pathToAction = rtrim(str_replace('\\', '/', $pathToAction), '/');
if (file_exists($pathToAction)) {
if (is_dir($pathToAction)) {
if (file_exists($pathToAction . '/payment.php')) {
include $pathToAction . '/payment.php';
}
} else {
include $pathToAction;
}
}
if (strlen($arPaySysAction['ENCODING']) > 0) {
define('BX_SALE_ENCODING', $arPaySysAction['ENCODING']);
AddEventHandler('main', 'OnEndBufferContent', 'ChangeEncoding');
function ChangeEncoding($content)
示例5: dirname
require_once dirname(__FILE__) . "/../classes/general/cache_html.php";
CHTMLPagesCache::startCaching();
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
CModule::IncludeModule('sale');
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
include GetLangFileName(dirname(__FILE__) . "/", "/ubrir.php");
include dirname(__FILE__) . "/sdk/ubrir_autoload.php";
$orderID = $_REQUEST['OrderId'];
$order = CSaleOrder::GetByID($orderID);
if (!$order) {
// ORDER NOT FOUND
die('NOT FOUND');
}
CSalePaySystemAction::InitParamArrays($orderID, $orderID);
$bankHandler = new ubrir(CSalePaySystemAction::GetParamValue("TERMINAL_ID"), CSalePaySystemAction::GetParamValue("SHOP_SECRET_WORD"), CSalePaySystemAction::GetParamValue("ubrir_PAYMENT_URL"));
try {
$bankHandler->checkNotification($_POST);
} catch (ubrirException $e) {
die($e->getMessage());
}
if ($bankHandler->isOrderFailed()) {
CSaleOrder::PayOrder($orderID, 'N');
} elseif ($bankHandler->isOrderPaid()) {
CSaleOrder::PayOrder($orderID, 'Y');
}
?>
OK
示例6: is_file
if (file_exists($psActionPath) && is_dir($psActionPath))
{
if (file_exists($psActionPath."/result.php") && is_file($psActionPath."/result.php"))
$psResultFile = $psActionPath."/result.php";
}
elseif (strlen($arPSAction["RESULT_FILE"]) > 0)
{
if (file_exists($_SERVER["DOCUMENT_ROOT"].$arPSAction["RESULT_FILE"])
&& is_file($_SERVER["DOCUMENT_ROOT"].$arPSAction["RESULT_FILE"]))
$psResultFile = $_SERVER["DOCUMENT_ROOT"].$arPSAction["RESULT_FILE"];
}
if (strlen($psResultFile) > 0)
{
$ORDER_ID = $ID;
CSalePaySystemAction::InitParamArrays(array(), $ID);
if (include($psResultFile))
{
$ORDER_ID = IntVal($ORDER_ID);
$arOrder = CSaleOrder::GetByID($ORDER_ID);
if ($arOrder)
{
if ($arOrder["PS_STATUS"] == "Y" && $arOrder["PAYED"] == "N")
{
if ($arOrder["CURRENCY"] == $arOrder["PS_CURRENCY"]
&& DoubleVal($arOrder["PRICE"]) == DoubleVal($arOrder["PS_SUM"]))
{
if (!CSaleOrder::PayOrder($arOrder["ID"], "Y", True, True))
{
if ($ex = $APPLICATION->GetException())
示例7: foreach
}
if ($arOrder) {
foreach (GetModuleEvents("sale", "OnSaleComponentOrderOneStepFinal", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($arResult["ORDER_ID"], &$arOrder, &$arParams));
}
}
$payment = \Bitrix\Sale\Internals\PaymentTable::getRow(array('select' => array('ID', 'PAY_SYSTEM_ID', 'SUM', 'DATE_BILL'), 'filter' => array('ORDER_ID' => $arResult["ORDER_ID"], '!PAY_SYSTEM_ID' => \Bitrix\Sale\Internals\PaySystemInner::getId())));
if ($arOrder && $arOrder["USER_ID"] == IntVal($USER->GetID())) {
if ($payment && IntVal($payment["PAY_SYSTEM_ID"]) > 0 && $arOrder["PAYED"] != "Y") {
$arOrder['PAYMENT_ID'] = $payment['ID'];
$dbPaySysAction = CSalePaySystemAction::GetList(array(), array("PAY_SYSTEM_ID" => $payment["PAY_SYSTEM_ID"], "PERSON_TYPE_ID" => $arOrder["PERSON_TYPE_ID"]), false, false, array("NAME", "ACTION_FILE", "NEW_WINDOW", "PARAMS", "ENCODING", "LOGOTIP"));
if ($arPaySysAction = $dbPaySysAction->Fetch()) {
$arPaySysAction["NAME"] = htmlspecialcharsEx($arPaySysAction["NAME"]);
if (strlen($arPaySysAction["ACTION_FILE"]) > 0) {
if ($arPaySysAction["NEW_WINDOW"] != "Y") {
CSalePaySystemAction::InitParamArrays($arOrder, $arOrder["ID"], $arPaySysAction["PARAMS"], array(), $payment);
$pathToAction = $_SERVER["DOCUMENT_ROOT"] . $arPaySysAction["ACTION_FILE"];
$pathToAction = str_replace("\\", "/", $pathToAction);
while (substr($pathToAction, strlen($pathToAction) - 1, 1) == "/") {
$pathToAction = substr($pathToAction, 0, strlen($pathToAction) - 1);
}
if (file_exists($pathToAction)) {
if (is_dir($pathToAction) && file_exists($pathToAction . "/payment.php")) {
$pathToAction .= "/payment.php";
}
$arPaySysAction["PATH_TO_ACTION"] = $pathToAction;
}
if (strlen($arPaySysAction["ENCODING"]) > 0) {
define("BX_SALE_ENCODING", $arPaySysAction["ENCODING"]);
AddEventHandler("main", "OnEndBufferContent", "ChangeEncoding");
function ChangeEncoding($content)
示例8: trim
if ($inv_id > 0 && $paymentId > 0) {
$bCorrectPayment = True;
$out_summ = trim($_REQUEST["OutSum"]);
$crc = trim($_REQUEST["SignatureValue"]);
/** @var \Bitrix\Sale\Order $order */
$order = Order::load($inv_id);
if (!$order) {
$bCorrectPayment = false;
}
$arOrder = $order->getFieldValues();
$payment = $order->getPaymentcollection()->getItemById($paymentId);
if (!$payment) {
$bCorrectPayment = false;
}
if ($bCorrectPayment) {
CSalePaySystemAction::InitParamArrays($arOrder, $inv_id, '', array(), $payment->getFieldValues());
}
$changePayStatus = trim(CSalePaySystemAction::GetParamValue("CHANGE_STATUS_PAY"));
$mrh_pass2 = CSalePaySystemAction::GetParamValue("ShopPassword2");
if (strlen($mrh_pass2) <= 0) {
$bCorrectPayment = False;
}
$strCheck = md5($out_summ . ":" . $inv_id . ":" . $mrh_pass2 . ':shp_payment_id=' . $paymentId);
if ($bCorrectPayment && ToUpper($crc) != ToUpper($strCheck)) {
$bCorrectPayment = False;
}
if ($bCorrectPayment) {
$strPS_STATUS_DESCRIPTION = GetMessage('SALE_RES_NUMBER') . ": " . $inv_id;
$strPS_STATUS_DESCRIPTION .= "; " . GetMessage('SALE_RES_DATEPAY') . ": " . date("d.m.Y H:i:s");
if (isset($_REQUEST["IncCurrLabel"]) && strlen($_REQUEST["IncCurrLabel"]) > 0) {
$strPS_STATUS_DESCRIPTION .= "; " . GetMessage('SASP_RES_PAY_TYPE') . ": " . $_REQUEST["IncCurrLabel"];
示例9: GetMessage
if (count($arBasketItems) <= 0) {
$arResult["ERROR_MESSAGE"] = GetMessage("SALE_EMPTY_BASKET");
}
$arResult["DISCOUNT_PRICE_ALL"] = $DISCOUNT_PRICE_ALL;
$arResult["DISCOUNT_PRICE_ALL_FORMATED"] = SaleFormatCurrency($DISCOUNT_PRICE_ALL, $allCurrency);
if ($arParams["USE_PREPAYMENT"] == "Y") {
if (doubleval($arResult["allSum"]) > 0) {
$personType = array();
$dbPersonType = CSalePersonType::GetList(array("SORT" => "ASC", "NAME" => "ASC"), array("LID" => SITE_ID, "ACTIVE" => "Y"));
while ($arPersonType = $dbPersonType->GetNext()) {
$personType[] = $arPersonType["ID"];
}
if (!empty($personType)) {
$dbPaySysAction = CSalePaySystemAction::GetList(array(), array("PS_ACTIVE" => "Y", "HAVE_PREPAY" => "Y", "PERSON_TYPE_ID" => $personType), false, false, array("ID", "PAY_SYSTEM_ID", "PERSON_TYPE_ID", "NAME", "ACTION_FILE", "RESULT_FILE", "NEW_WINDOW", "PARAMS", "ENCODING", "LOGOTIP"));
if ($arPaySysAction = $dbPaySysAction->Fetch()) {
CSalePaySystemAction::InitParamArrays(false, false, $arPaySysAction["PARAMS"]);
$pathToAction = $_SERVER["DOCUMENT_ROOT"] . $arPaySysAction["ACTION_FILE"];
$pathToAction = str_replace("\\", "/", $pathToAction);
while (substr($pathToAction, strlen($pathToAction) - 1, 1) == "/") {
$pathToAction = substr($pathToAction, 0, strlen($pathToAction) - 1);
}
if (file_exists($pathToAction)) {
if (is_dir($pathToAction) && file_exists($pathToAction . "/pre_payment.php")) {
$pathToAction .= "/pre_payment.php";
}
include_once $pathToAction;
$psPreAction = new CSalePaySystemPrePayment();
if ($psPreAction->init()) {
$orderData = array("PATH_TO_ORDER" => $arParams["PATH_TO_ORDER"], "AMOUNT" => $arResult["allSum"]);
if (!$psPreAction->BasketButtonAction($orderData)) {
if ($e = $APPLICATION->GetException()) {
示例10: die
<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();?><?
include(GetLangFileName(dirname(__FILE__)."/", "/payment.php"));
$inv_id = IntVal($_REQUEST["InvId"]);
if($inv_id > 0)
{
$bCorrectPayment = True;
$out_summ = trim($_REQUEST["OutSum"]);
$crc = trim($_REQUEST["SignatureValue"]);
if (!($arOrder = CSaleOrder::GetByID($inv_id)))
$bCorrectPayment = False;
if ($bCorrectPayment)
CSalePaySystemAction::InitParamArrays($arOrder, $inv_id);
$changePayStatus = trim(CSalePaySystemAction::GetParamValue("CHANGE_STATUS_PAY"));
$mrh_pass2 = CSalePaySystemAction::GetParamValue("ShopPassword2");
$strCheck = md5($out_summ.":".$inv_id.":".$mrh_pass2);
if ($bCorrectPayment && ToUpper($crc) != ToUpper($strCheck))
$bCorrectPayment = False;
if($bCorrectPayment)
{
$strPS_STATUS_DESCRIPTION = GetMessage('SALE_RES_NUMBER').": ".$inv_id;
$strPS_STATUS_DESCRIPTION .= "; ".GetMessage('SALE_RES_DATEPAY').": ".date("d.m.Y H:i:s");
if (isset($_REQUEST["IncCurrLabel"]) && strlen($_REQUEST["IncCurrLabel"]) > 0)
$strPS_STATUS_DESCRIPTION .= "; ".GetMessage('SASP_RES_PAY_TYPE').": ".$_REQUEST["IncCurrLabel"];
示例11: executeComponent
public function executeComponent()
{
global $APPLICATION;
try {
# verify token is valid
$token = $this->checkToken();
# locate order and its payment system
$order_id = $_REQUEST['order_id'];
$payment_id = $_REQUEST['payment_id'];
$uid = $_REQUEST['uid'];
$order = Order::load($order_id);
if (!$order)
throw new Exception( Loc::getMessage("COMPONENT_BEGATEWAY_WRONG_ORDER_ID") . $order_id);
$payment = $order->getPaymentCollection()->getItemById($payment_id);
if (!$payment)
throw new Exception( Loc::getMessage("COMPONENT_BEGATEWAY_WRONG_PAYMENT_ID") . $payment_id);
$arOrder = CSaleOrder::GetByID($order_id);
CSalePaySystemAction::InitParamArrays($arOrder, $arOrder["ID"], '', array(), $payment->getFieldValues());
\beGateway\Settings::$shopId = CSalePaySystemAction::GetParamValue("SHOP_ID");
\beGateway\Settings::$shopKey = CSalePaySystemAction::GetParamValue("SHOP_KEY");
\beGateway\Settings::$gatewayBase = "https://" . CSalePaySystemAction::GetParamValue("DOMAIN_GATEWAY");
\beGateway\Settings::$checkoutBase = "https://" . CSalePaySystemAction::GetParamValue("DOMAIN_PAYMENT_PAGE");
$query = new \beGateway\QueryByToken();
$query->setToken($token);
$response = $query->submit()->getResponse();
if( ! isset( $response->checkout ) )
throw new Exception( Loc::getMessage("COMPONENT_BEGATEWAY_FAIL_TOKEN_QUERY") );
# verify token matches uid
$this->arResult = $response->checkout;
$type = $this->arResult->transaction_type;
if (! isset($this->arResult->gateway_response))
throw new Exception( Loc::getMessage("COMPONENT_BEGATEWAY_NO_TRANS_INFO") );
if ($this->arResult->gateway_response->$type->uid != $uid)
throw new Exception( Loc::getMessage("COMPONENT_BEGATEWAY_NO_UID_TOKEN_ACCESS") );
if ($this->arResult->order->tracking_id != $order_id . ':' . $payment_id)
throw new Exception( Loc::getMessage("COMPONENT_BEGATEWAY_WRONG_TRACKING_ID") );
$money = new \beGateway\Money;
$money->setCents($response->checkout->order->amount);
$money->setCurrency($response->checkout->order->currency);
$response->checkout->order->amount = CCurrencyLang::CurrencyFormat( $money->getAmount(), $money->getCurrency() );
$this->arResult->order->description = $APPLICATION->ConvertCharset($this->arResult->order->description, 'utf-8', SITE_CHARSET);
$this->arResult->gateway_response->$type->billing_descriptor = $APPLICATION->ConvertCharset($this->arResult->gateway_response->$type->billing_descriptor, SITE_CHARSET, 'utf-8');
$this->IncludeComponentTemplate();
} catch(Exception $e) {
ShowError( $e->getMessage() );
}
}
示例12: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
// define("NO_KEEP_STATISTIC", true);
// define("NOT_CHECK_PERMISSIONS", true);
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
if (CModule::IncludeModule("sale")) {
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_GET["server_responce"]) && $_GET["server_responce"] == "Y" && !empty($_POST["cartId"])) {
$bCorrect = True;
if ($bCorrect && !($arOrder = CSaleOrder::GetByID(IntVal($_POST["cartId"])))) {
$bCorrect = False;
}
if ($bCorrect) {
CSalePaySystemAction::InitParamArrays($arOrder);
$strCallbackPassword = CSalePaySystemAction::GetParamValue("CALLBACK_PASSWORD");
if (strlen($strCallbackPassword) > 0 && $_POST["callbackPW"] != $strCallbackPassword) {
$bCorrect = False;
}
}
if ($bCorrect && isset($_POST["testMode"]) && IntVal($_POST["testMode"]) > 0) {
$bCorrect = False;
}
if ($bCorrect) {
$arFields = array("PS_STATUS" => $_POST["transStatus"] == "Y" ? "Y" : "N", "PS_STATUS_CODE" => $_POST["transStatus"], "PS_STATUS_DESCRIPTION" => $_POST["rawAuthMessage"], "PS_STATUS_MESSAGE" => $_POST["transStatus"] == "Y" ? "The WorldPay ID for this transaction: " . $_POST["transId"] . ", Time of this transaction: " . Date("r", $_POST["transTime"]) : "", "PS_SUM" => $_POST["authAmount"], "PS_CURRENCY" => $_POST["authCurrency"], "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))), "USER_ID" => $arOrder["USER_ID"]);
if ($arOrder["CURRENCY"] == $_POST["authCurrency"] && $arOrder["PRICE"] == $_POST["authAmount"]) {
$arFields["PAYED"] = "Y";
$arFields["DATE_PAYED"] = Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG)));
$arFields["EMP_PAYED_ID"] = false;
}
示例13: ShowError
if ($CCrmQuote->cPerms->HavePerm('QUOTE', BX_CRM_PERM_NONE, 'READ')) {
ShowError(GetMessage('CRM_PERMISSION_DENIED'));
return;
}
global $APPLICATION;
$APPLICATION->RestartBuffer();
$quoteID = intval($arParams["QUOTE_ID"]);
$dbResult = CCrmQuote::GetList(array(), array('ID' => $quoteID, 'CHECK_PERMISSIONS' => 'N'), false, false, array('*', 'UF_*'));
$arQuote = is_object($dbResult) ? $dbResult->Fetch() : null;
$paymentData = is_array($arQuote) ? CCrmQuote::PrepareSalePaymentData($arQuote) : null;
$paySystemID = isset($_REQUEST['PAY_SYSTEM_ID']) ? intval($_REQUEST['PAY_SYSTEM_ID']) : 0;
if (is_array($paymentData) && $paySystemID > 0) {
$dbPaySysAction = CSalePaySystemAction::GetList(array(), array("PAY_SYSTEM_ID" => $paySystemID, "PERSON_TYPE_ID" => $arQuote["PERSON_TYPE_ID"]), false, false, array("ACTION_FILE", "PARAMS", "ENCODING"));
if ($arPaySysAction = $dbPaySysAction->Fetch()) {
if (strlen($arPaySysAction["ACTION_FILE"]) > 0) {
CSalePaySystemAction::InitParamArrays($paymentData["ORDER"], 0, $arPaySysAction["PARAMS"], array("PROPERTIES" => $paymentData["PROPERTIES"], "BASKET_ITEMS" => $paymentData["CART_ITEMS"], "TAX_LIST" => $paymentData["TAX_LIST"]));
$pathToAction = $_SERVER["DOCUMENT_ROOT"] . $arPaySysAction["ACTION_FILE"];
$pathToAction = str_replace("\\", "/", $pathToAction);
while (substr($pathToAction, strlen($pathToAction) - 1, 1) == "/") {
$pathToAction = substr($pathToAction, 0, strlen($pathToAction) - 1);
}
if (file_exists($pathToAction)) {
if (is_dir($pathToAction)) {
if (file_exists($pathToAction . "/payment.php")) {
include $pathToAction . "/payment.php";
}
} else {
include $pathToAction;
}
}
if (strlen($arPaySysAction["ENCODING"]) > 0) {
示例14: intval
}
$errorMessage .= $productLimit;
$arResult["ERROR_MESSAGE"] = $errorMessage;
} else {
$arResult["ORDER_BASKET"]["CONFIRM_ORDER"] = "Y";
$arResult["ORDER_BASKET"]["ORDER_ID"] = intval($ORDER_ID);
$arResult["ORDER_ID"] = intval($ORDER_ID);
$dbOrder = CSaleOrder::GetList(array("DATE_UPDATE" => "DESC"), array("LID" => SITE_ID, "USER_ID" => $currentUserId, "ID" => $arResult["ORDER_BASKET"]["ORDER_ID"]));
if ($arOrder = $dbOrder->GetNext()) {
if (intval($arOrder["PAY_SYSTEM_ID"]) > 0) {
$dbPaySysAction = CSalePaySystemAction::GetList(array(), array("PAY_SYSTEM_ID" => $arOrder["PAY_SYSTEM_ID"], "PERSON_TYPE_ID" => $arOrder["PERSON_TYPE_ID"]), false, false, array("NAME", "ACTION_FILE", "NEW_WINDOW", "PARAMS", "ENCODING"));
if ($arPaySysAction = $dbPaySysAction->Fetch()) {
$arPaySysAction["NAME"] = htmlspecialcharsEx($arPaySysAction["NAME"]);
if (strlen($arPaySysAction["ACTION_FILE"]) > 0) {
if ($arPaySysAction["NEW_WINDOW"] != "Y") {
CSalePaySystemAction::InitParamArrays($arOrder, $arOrder["ID"], $arPaySysAction["PARAMS"]);
$pathToAction = $_SERVER["DOCUMENT_ROOT"] . $arPaySysAction["ACTION_FILE"];
$pathToAction = str_replace("\\", "/", $pathToAction);
while (substr($pathToAction, strlen($pathToAction) - 1, 1) == "/") {
$pathToAction = substr($pathToAction, 0, strlen($pathToAction) - 1);
}
if (file_exists($pathToAction)) {
if (is_dir($pathToAction) && file_exists($pathToAction . "/payment.php")) {
$pathToAction .= "/payment.php";
}
$arPaySysAction["PATH_TO_ACTION"] = $pathToAction;
}
if (strlen($arPaySysAction["ENCODING"]) > 0) {
define("BX_SALE_ENCODING", $arPaySysAction["ENCODING"]);
AddEventHandler("main", "OnEndBufferContent", "ChangeEncoding");
function ChangeEncoding($content)
示例15: str_replace
$actionFilePath = $_SERVER["DOCUMENT_ROOT"] . $actionFilePath;
$actionFilePath = str_replace("\\", "/", $actionFilePath);
while (substr($actionFilePath, strlen($actionFilePath) - 1, 1) == "/") {
$actionFilePath = substr($actionFilePath, 0, strlen($actionFilePath) - 1);
}
if (!file_exists($actionFilePath)) {
echo CUtil::PhpToJSObject(array('ERROR' => 'COULD NOT FIND PAYMENT SYSTEM ACTION FILE!'));
die;
} elseif (is_dir($actionFilePath)) {
$actionFilePath = $actionFilePath . '/payment.php';
if (!file_exists($actionFilePath)) {
echo CUtil::PhpToJSObject(array('ERROR' => 'COULD NOT FIND PAYMENT SYSTEM ACTION FILE!'));
die;
}
}
CSalePaySystemAction::InitParamArrays($paymentData['ORDER'], 0, $paySysActionFields['PARAMS'], array("PROPERTIES" => $paymentData['PROPERTIES'], "BASKET_ITEMS" => $paymentData['CART_ITEMS'], "TAX_LIST" => $paymentData["TAX_LIST"]));
$pdfContent = (include $actionFilePath);
$fileName = "quote_{$quoteID}.pdf";
$fileData = array('name' => $fileName, 'type' => 'file', 'content' => $pdfContent, 'MODULE_ID' => 'crm');
$fileID = CFile::SaveFile($fileData, 'crm');
if ($fileID > 0) {
$fileArray = CFile::GetFileArray($fileID);
$storageTypeID = \Bitrix\Crm\Integration\StorageType::getDefaultTypeID();
if ($storageTypeID !== \Bitrix\Crm\Integration\StorageType::File) {
$storageFileID = \Bitrix\Crm\Integration\StorageManager::saveEmailAttachment($fileArray, $storageTypeID);
$fileInfo = $storageFileID > 0 ? \Bitrix\Crm\Integration\StorageManager::getFileInfo($storageFileID, $storageTypeID) : null;
if (is_array($fileInfo)) {
if ($storageTypeID === \Bitrix\Crm\Integration\StorageType::WebDav) {
echo CUtil::PhpToJSObject(array('webdavelement' => $fileInfo));
} elseif ($storageTypeID === \Bitrix\Crm\Integration\StorageType::Disk) {
echo CUtil::PhpToJSObject(array('diskfile' => $fileInfo));