本文整理汇总了PHP中CSalePaySystemAction::GetByID方法的典型用法代码示例。如果您正苦于以下问题:PHP CSalePaySystemAction::GetByID方法的具体用法?PHP CSalePaySystemAction::GetByID怎么用?PHP CSalePaySystemAction::GetByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSalePaySystemAction
的用法示例。
在下文中一共展示了CSalePaySystemAction::GetByID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getValuesByPSAId
/**
* getByPaySystemId
* returns saved tarif's values
* @return array
*/
protected static function getValuesByPSAId($psaId)
{
$arResult = array();
if (isset(self::$arItems[$psaId])) {
$arResult = self::$arItems[$psaId];
} else {
$psa = CSalePaySystemAction::GetByID($psaId);
if (is_array($psa) && isset($psa['TARIF']) && is_array($psa['TARIF'])) {
$arResult = self::$arItems[$psaId] = unserialize($psa['TARIF']);
}
}
return $arResult;
}
示例2: Withdraw
function Withdraw($sum, $currency, $arUserCard, $orderID = 0)
{
$sum = str_replace(",", ".", $sum);
$sum = roundEx(DoubleVal($sum), SALE_VALUE_PRECISION);
if ($sum <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGUC_EMPTY_SUM"), "EMPTY_SUM");
return false;
}
$currency = Trim($currency);
if (strlen($currency) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGUC_EMPTY_CURRENCY"), "EMPTY_SUM_CURRENCY");
return false;
}
if (!is_array($arUserCard) || count($arUserCard) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGUC_NO_PARAMS"), "EMPTY_CARD_ARRAY");
return false;
}
$orderID = IntVal($orderID);
if (DoubleVal($arUserCard["SUM_MAX"]) > 0) {
$maxSum = roundEx(CCurrencyRates::ConvertCurrency($arUserCard["SUM_MAX"], $arUserCard["SUM_CURRENCY"], $currency), SALE_VALUE_PRECISION);
if ($maxSum < $sum) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#SUM1#", SaleFormatCurrency($arUserCard["SUM_MAX"], $arUserCard["SUM_CURRENCY"]), str_replace("#SUM2#", SaleFormatCurrency($sum, $currency), GetMessage("SKGUC_CROSS_BOUND"))), "MAX_SUM_LIMIT");
return false;
}
}
$arPSAction = CSalePaySystemAction::GetByID($arUserCard["PAY_SYSTEM_ACTION_ID"]);
if (!$arPSAction) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arUserCard["PAY_SYSTEM_ACTION_ID"], GetMessage("SKGUC_NO_ACTION")), "NO_PAY_SYSTEM_ACTION");
return false;
}
$psActionPath = $_SERVER["DOCUMENT_ROOT"] . $arPSAction["ACTION_FILE"];
if (!file_exists($psActionPath)) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#FILE#", $arPSAction["ACTION_FILE"], GetMessage("SKGUC_NO_PATH")), "NO_PS_PATH");
return false;
}
if (is_file($psActionPath)) {
$psActionPath = dirname($psActionPath);
}
if (!file_exists($psActionPath . "/action.php")) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#FILE#", $psActionPath . "/action.php", GetMessage("SKGUC_NO_SCRIPT")), "NO_PS_SCRIPT");
return false;
}
$INPUT_CARD_TYPE = $arUserCard["CARD_TYPE"];
$INPUT_CARD_NUM = CSaleUserCards::CryptData($arUserCard["CARD_NUM"], "D");
$INPUT_CARD_EXP_MONTH = $arUserCard["CARD_EXP_MONTH"];
$INPUT_CARD_EXP_YEAR = $arUserCard["CARD_EXP_YEAR"];
$INPUT_CARD_CODE = $arUserCard["CARD_CODE"];
$INPUT_SUM = $sum;
if (DoubleVal($arUserCard["SUM_MIN"]) > 0) {
$minSum = roundEx(CCurrencyRates::ConvertCurrency($arUserCard["SUM_MIN"], $arUserCard["SUM_CURRENCY"], $currency), SALE_VALUE_PRECISION);
if ($minSum > $sum) {
$INPUT_SUM = $minSum;
}
}
$INPUT_CURRENCY = $currency;
$GLOBALS["SALE_INPUT_PARAMS"] = array();
$dbUser = CUser::GetByID(IntVal($arUserCard["USER_ID"]));
if ($arUser = $dbUser->Fetch()) {
$GLOBALS["SALE_INPUT_PARAMS"]["USER"] = $arUser;
}
if ($orderID > 0) {
if ($arOrder = CSaleOrder::GetByID($orderID)) {
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"] = $arOrder;
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["SHOULD_PAY"] = DoubleVal($arOrder["PRICE"]) - DoubleVal($arOrder["SUM_PAID"]);
$arDateInsert = explode(" ", $arOrder["DATE_INSERT"]);
if (is_array($arDateInsert) && count($arDateInsert) > 0) {
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["DATE_INSERT_DATE"] = $arDateInsert[0];
} else {
$GLOBALS["SALE_INPUT_PARAMS"]["ORDER"]["DATE_INSERT_DATE"] = $arOrder["DATE_INSERT"];
}
}
$arCurOrderProps = array();
$dbOrderPropVals = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $ORDER_ID), false, false, array("ID", "CODE", "VALUE", "ORDER_PROPS_ID", "PROP_TYPE"));
while ($arOrderPropVals = $dbOrderPropVals->Fetch()) {
$arCurOrderPropsTmp = CSaleOrderProps::GetRealValue($arOrderPropVals["ORDER_PROPS_ID"], $arOrderPropVals["CODE"], $arOrderPropVals["PROP_TYPE"], $arOrderPropVals["VALUE"], LANGUAGE_ID);
foreach ($arCurOrderPropsTmp as $key => $value) {
$arCurOrderProps[$key] = $value;
}
}
if (count($arCurOrderProps) > 0) {
$GLOBALS["SALE_INPUT_PARAMS"]["PROPERTY"] = $arCurOrderProps;
}
}
$GLOBALS["SALE_CORRESPONDENCE"] = CSalePaySystemAction::UnSerializeParams($arPSAction["PARAMS"]);
include $psActionPath . "/action.php";
$INPUT_CARD_NUM = "";
if (strlen($OUTPUT_ERROR_MESSAGE) > 0) {
$GLOBALS["APPLICATION"]->ThrowException($OUTPUT_ERROR_MESSAGE, "ERROR_MESSAGE");
return false;
}
$arFields = array("LAST_STATUS" => $OUTPUT_STATUS, "LAST_STATUS_CODE" => $OUTPUT_STATUS_CODE, "LAST_STATUS_DESCRIPTION" => $OUTPUT_STATUS_DESCRIPTION, "LAST_STATUS_MESSAGE" => $OUTPUT_STATUS_MESSAGE, "LAST_SUM" => $OUTPUT_SUM, "LAST_CURRENCY" => $OUTPUT_CURRENCY, "LAST_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))));
CSaleUserCards::Update($arUserCard["ID"], $arFields);
if ($OUTPUT_STATUS == "Y") {
$OUTPUT_SUM = str_replace(",", ".", $OUTPUT_SUM);
$OUTPUT_SUM = DoubleVal($OUTPUT_SUM);
if ($OUTPUT_CURRENCY != $currency) {
$OUTPUT_SUM = roundEx(CCurrencyRates::ConvertCurrency($OUTPUT_SUM, $OUTPUT_CURRENCY, $currency), SALE_VALUE_PRECISION);
}
return $OUTPUT_SUM;
}
//.........这里部分代码省略.........
示例3: array
$dbUserCards = CSaleUserCards::GetList(array(), array("ID" => $del_id, "USER_ID" => IntVal($USER->GetID())));
if ($arUserCards = $dbUserCards->Fetch()) {
if (!CSaleUserCards::Delete($arUserCards["ID"])) {
if ($ex = $APPLICATION->GetException()) {
$errorMessage = $ex->GetString();
} else {
$errorMessage = str_replace("#ID#", $del_id, GetMessage("STPCL_ERROR_DELETING"));
}
}
} else {
$errorMessage = str_replace("#ID#", $del_id, GetMessage("STPCL_NO_CARD_FOUND"));
}
}
if (strLen($errorMessage) >= 0) {
$arResult["ERROR_MESSAGE"] = $errorMessage;
}
$by = strlen($_REQUEST["by"]) > 0 ? $_REQUEST["by"] : "ID";
$order = strlen($_REQUEST["order"]) > 0 ? $_REQUEST["order"] : "DESC";
$dbUserCards = CSaleUserCards::GetList(array($by => $order), array("USER_ID" => IntVal($USER->GetID())));
$dbUserCards->NavStart($arParams["PER_PAGE"]);
$arResult["NAV_STRING"] = $dbUserCards->GetPageNavString(GetMessage("SPCL_PAGES"));
$arResult["CARDS"] = array();
while ($arUserCards = $dbUserCards->GetNext()) {
$arResultTmp = array();
$arResultTmp = $arUserCards;
$arResultTmp["PAY_SYSTEM"] = CSalePaySystemAction::GetByID($arUserCards["PAY_SYSTEM_ACTION_ID"]);
$arResultTmp["URL_TO_DETAIL"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_DETAIL"], array("ID" => $arUserCards["ID"]));
$arResultTmp["URL_TO_DELETE"] = htmlspecialcharsbx($APPLICATION->GetCurPage()) . "?del_id=" . $arUserCards["ID"] . "&" . bitrix_sessid_get();
$arResult["CARDS"][] = $arResultTmp;
}
$this->IncludeComponentTemplate();