本文整理汇总了PHP中CSalePaySystemAction::getParamsByConsumer方法的典型用法代码示例。如果您正苦于以下问题:PHP CSalePaySystemAction::getParamsByConsumer方法的具体用法?PHP CSalePaySystemAction::getParamsByConsumer怎么用?PHP CSalePaySystemAction::getParamsByConsumer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSalePaySystemAction
的用法示例。
在下文中一共展示了CSalePaySystemAction::getParamsByConsumer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: InitParamArrays
//.........这里部分代码省略.........
foreach ($arCurOrderPropsTmp as $key => $value) {
$arCurOrderProps["~" . $key] = $value;
$arCurOrderProps[$key] = htmlspecialcharsEx($value);
}
}
}
if (count($arCurOrderProps) > 0) {
$GLOBALS["SALE_INPUT_PARAMS"]["PROPERTY"] = $arCurOrderProps;
}
$shipment = \Bitrix\Sale\Internals\ShipmentTable::getRow(array('select' => array('DELIVERY_ID'), 'filter' => array('ORDER_ID' => $orderID, 'SYSTEM' => 'N')));
if ($shipment) {
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["DELIVERY_ID"] = $shipment['DELIVERY_ID'];
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["~DELIVERY_ID"] = $shipment['DELIVERY_ID'];
}
$paySystemId = '';
if ($payment && $payment['PAY_SYSTEM_ID'] > 0) {
$paySystemId = $payment['PAY_SYSTEM_ID'];
} elseif (isset($arOrder['PAY_SYSTEM_ID']) && $arOrder['PAY_SYSTEM_ID'] > 0) {
$paySystemId = $arOrder['PAY_SYSTEM_ID'];
} else {
$psParams = unserialize($psParams);
if (isset($psParams['BX_PAY_SYSTEM_ID'])) {
$paySystemId = $psParams['BX_PAY_SYSTEM_ID']['VALUE'];
}
}
if ($paySystemId !== '') {
if (!isset($arOrder['PERSON_TYPE_ID']) || $arOrder['PERSON_TYPE_ID'] <= 0) {
// for crm quote compatibility
$personTypes = CSalePaySystem::getPaySystemPersonTypeIds($paySystemId);
$personTypeId = array_shift($personTypes);
} else {
$personTypeId = $arOrder['PERSON_TYPE_ID'];
}
$params = CSalePaySystemAction::getParamsByConsumer('PAYSYSTEM_' . $paySystemId, $personTypeId);
foreach ($params as $key => $value) {
$params[$key]['~VALUE'] = htmlspecialcharsbx($value['VALUE']);
}
$GLOBALS["SALE_CORRESPONDENCE"] = $params;
}
if ($payment['COMPANY_ID'] > 0) {
if (!array_key_exists('COMPANY', $GLOBALS["SALE_INPUT_PARAMS"])) {
$GLOBALS["SALE_INPUT_PARAMS"]["COMPANY"] = array();
}
global $USER_FIELD_MANAGER;
$userFieldsList = $USER_FIELD_MANAGER->GetUserFields(\Bitrix\Sale\Internals\CompanyTable::getUfId(), null, LANGUAGE_ID);
foreach ($userFieldsList as $key => $userField) {
$value = $USER_FIELD_MANAGER->GetUserFieldValue(\Bitrix\Sale\Internals\CompanyTable::getUfId(), $key, $payment['COMPANY_ID']);
$GLOBALS["SALE_INPUT_PARAMS"]["COMPANY"][$key] = $value;
$GLOBALS["SALE_INPUT_PARAMS"]["COMPANY"]["~" . $key] = $value;
}
$companyFieldList = \Bitrix\Sale\Internals\CompanyTable::getRowById($payment['COMPANY_ID']);
foreach ($companyFieldList as $key => $value) {
$GLOBALS["SALE_INPUT_PARAMS"]["COMPANY"][$key] = $value;
$GLOBALS["SALE_INPUT_PARAMS"]["COMPANY"]["~" . $key] = $value;
}
}
// fields with no interface
$GLOBALS["SALE_CORRESPONDENCE"]['PAYER_STREET']["TYPE"] = 'PROPERTY';
$GLOBALS["SALE_CORRESPONDENCE"]['PAYER_STREET']["VALUE"] = 'LOCATION_STREET';
$GLOBALS["SALE_CORRESPONDENCE"]['PAYER_STREET']["~VALUE"] = 'LOCATION_STREET';
$GLOBALS["SALE_CORRESPONDENCE"]['PAYER_VILLAGE']["TYPE"] = 'PROPERTY';
$GLOBALS["SALE_CORRESPONDENCE"]['PAYER_VILLAGE']["VALUE"] = 'LOCATION_VILLAGE';
$GLOBALS["SALE_CORRESPONDENCE"]['PAYER_VILLAGE']["~VALUE"] = 'LOCATION_VILLAGE';
$GLOBALS["SALE_CORRESPONDENCE"]['ORDER_PAYMENT_ID']["TYPE"] = 'ORDER';
$GLOBALS["SALE_CORRESPONDENCE"]['ORDER_PAYMENT_ID']["VALUE"] = 'PAYMENT_ID';
$GLOBALS["SALE_CORRESPONDENCE"]['ORDER_PAYMENT_ID']["~VALUE"] = 'PAYMENT_ID';
示例2: GetList
public static function GetList($arOrder = array("SORT" => "ASC", "NAME" => "ASC"), $arFilter = array(), $arGroupBy = false, $arNavStartParams = false, $arSelectFields = array())
{
if (array_key_exists("PSA_PERSON_TYPE_ID", $arFilter)) {
$arFilter['PERSON_TYPE_ID'] = $arFilter['PSA_PERSON_TYPE_ID'];
unset($arFilter["PSA_PERSON_TYPE_ID"]);
}
$salePaySystemFields = array('ID', 'NAME', 'ACTIVE', 'SORT', 'DESCRIPTION');
$ignoredFields = array('LID', 'CURRENCY', 'PERSON_TYPE_ID');
if (!$arSelectFields) {
$select = array('ID', 'NAME', 'ACTIVE', 'SORT', 'DESCRIPTION');
} else {
$select = array();
foreach ($arSelectFields as $key => $field) {
if (in_array($field, $ignoredFields)) {
continue;
}
$select[$key] = self::getAlias($field);
}
}
$filter = array();
foreach ($arFilter as $key => $value) {
if (in_array($key, $ignoredFields)) {
continue;
}
$filter[self::getAlias($key)] = $value;
}
if (isset($arFilter['PERSON_TYPE_ID'])) {
$select = array_merge($select, array('PSA_ID' => 'ID', 'PSA_NAME', 'ACTION_FILE', 'RESULT_FILE', 'NEW_WINDOW', 'PERSON_TYPE_ID', 'PARAMS', 'TARIF', 'HAVE_PAYMENT', 'HAVE_ACTION', 'HAVE_RESULT', 'HAVE_PREPAY', 'HAVE_RESULT_RECEIVE', 'ENCODING', 'LOGOTIP'));
}
if (in_array('PARAMS', $select) && !array_key_exists('PSA_ID', $select)) {
$select['PSA_ID'] = 'ID';
}
if (in_array('PARAMS', $select) && !in_array('PERSON_TYPE_ID', $select)) {
$select[] = 'PERSON_TYPE_ID';
}
$order = array();
foreach ($arOrder as $key => $value) {
$order[self::getAlias($key)] = $value;
}
$groupBy = array();
if ($arGroupBy !== false) {
$arGroupBy = !is_array($arGroupBy) ? array($arGroupBy) : $arGroupBy;
foreach ($arGroupBy as $key => $value) {
$groupBy[$key] = self::getAlias($value);
}
}
$dbRes = PaySystemActionTable::getList(array('select' => $select, 'filter' => $filter, 'order' => $order, 'group' => $groupBy));
$limit = null;
if (is_array($arNavStartParams) && isset($arNavStartParams['nTopCount'])) {
if ($arNavStartParams['nTopCount'] > 0) {
$limit = $arNavStartParams['nTopCount'];
}
}
$result = array();
while ($data = $dbRes->fetch()) {
if ($limit !== null && !$limit) {
break;
}
$dbRestriction = \Bitrix\Sale\Internals\ServiceRestrictionTable::getList(array('filter' => array('SERVICE_ID' => $data['ID'], 'SERVICE_TYPE' => \Bitrix\Sale\Services\PaySystem\Restrictions\Manager::SERVICE_TYPE_PAYMENT)));
while ($restriction = $dbRestriction->fetch()) {
if (!CSalePaySystemAction::checkRestriction($restriction, $arFilter)) {
continue 2;
}
}
if (isset($data['ACTION_FILE'])) {
$oldHandler = array_search($data['ACTION_FILE'], CSalePaySystemAction::getOldToNewHandlersMap());
if ($oldHandler !== false) {
$data['ACTION_FILE'] = $oldHandler;
}
}
if (array_key_exists('PARAMS', $data)) {
$params = CSalePaySystemAction::getParamsByConsumer('PAYSYSTEM_' . $data['PSA_ID'], $data['PERSON_TYPE_ID']);
$params['BX_PAY_SYSTEM_ID'] = array('TYPE' => '', 'VALUE' => $data['PSA_ID']);
$data['PARAMS'] = serialize($params);
}
foreach ($data as $key => $value) {
if (!in_array($key, $salePaySystemFields)) {
$newKey = self::getAliasBack($key);
if ($newKey != $key) {
$data[$newKey] = $value;
unset($data[$key]);
}
}
}
$result[] = $data;
$limit--;
}
$dbRes = new \CDBResult();
$dbRes->InitFromArray($result);
return $dbRes;
}