function action() { $objFormParam = new SC_FormParam_Ex(); $objFormParam->addParam("加盟店ID", "memberId", 5, "n", explode(",", "NUM_CHECK,EXIST_CHECK,NUM_COUNT_CHECK")); $objFormParam->addParam("サービスID", "serviceId", 5, "n", explode(",", "NUM_CHECK,EXIST_CHECK,NUM_COUNT_CHECK")); $objFormParam->addParam("セキュアキー", "secureKey", 32, "n", explode(",", "ALNUM_CHECK,EXIST_CHECK,NUM_COUNT_CHECK")); $objFormParam2 = new SC_FormParam_Ex(); $objFormParam2->addParam("加盟店ID", "cpid", 10, "n", explode(",", "ALNUM_CHECK,EXIST_CHECK,NUM_COUNT_CHECK")); $objFormParam2->addParam("サイトID", "siteid", 10, "n", explode(",", "ALNUM_CHECK,EXIST_CHECK,NUM_COUNT_CHECK")); $objFormParam2->addParam("セキュアキー", "secureKey1", 20, "n", explode(",", "ALNUM_CHECK,EXIST_CHECK,NUM_COUNT_CHECK")); switch ($this->getMode()) { case "edit": $objFormParam->setParam($_POST); $objFormParam->convParam(); $this->arrErr = $objFormParam->checkError(); if (SC_Utils_Ex::isBlank($this->arrErr)) { $arrConfig = $objFormParam->getHashArray(array("memberId", "serviceId", "secureKey")); SC_AuonePayment_Ex::saveConfig($arrConfig); } // キセカエタッチの $config2 = SC_AuonePayment_Ex::getConfig("free_field2"); $objFormParam2->setParam($config2); break; case "edit_kisekae": $objFormParam2->setParam($_POST); $objFormParam2->convParam(); $this->arrErr = $objFormParam2->checkError(); if (SC_Utils_Ex::isBlank($this->arrErr)) { $arrConfig = $objFormParam2->getHashArray(array("cpid", "siteid", "secureKey1")); SC_AuonePayment_Ex::saveConfig($arrConfig, "free_field2"); } // au かんたん決済の設定は 再読み込み $config = SC_AuonePayment_Ex::getConfig(); $objFormParam->setParam($config); break; default: $config = SC_AuonePayment_Ex::getConfig(); $objFormParam->setParam($config); $config2 = SC_AuonePayment_Ex::getConfig("free_field2"); $objFormParam2->setParam($config2); break; } $form = $this->createForm1($objFormParam); $form2 = $this->createForm2($objFormParam2); switch ($this->getMode()) { case "edit": $form->validate(); break; case "edit_kisekae": $form2->validate(); break; } $this->form = $form->toHtml(); $this->form2 = $form2->toHtml(); $this->tpl_mainpage = dirname(__FILE__) . "/config.tpl"; $this->setTemplate($this->tpl_mainpage); }
/** * レスポンスチェック. * * @param unknown $result * @param string $check_tid * @param array $next_result_code */ function check_result($result, $check_tid = true, $next_result_code = array()) { return SC_AuonePayment_Ex::check_result($result, $check_tid, $next_result_code, true); }
/** * レスポンスチェック. * * @param unknown $result * @param string $check_tid * @param array $next_result_code */ static function check_result($result, $check_tid = true, $next_result_code = array(), $disp_error = true) { $config = SC_AuonePayment_Ex::getConfig(); $success = explode(",", AUONE_PAYMENT_XRESULT_CODE_SUCCESS); if (is_array($next_result_code)) { $success = array_merge($success, $next_result_code); } $res_code = $result["head"]["X-ResultCd"]; $res_code = str_replace("MPL", "", $res_code); GC_Utils_Ex::gfPrintLog(print_r(array("rescd" => $res_code, "codes" => $success, "check" => in_array($res_code, $success)), true), DEBUG_LOG_REALFILE); GC_Utils_Ex::gfPrintLog(print_r(compact("result"), TRUE), DEBUG_LOG_REALFILE); $masterdata = new SC_DB_MasterData_Ex(); $arrErrCd = $masterdata->getMasterData("cp_mtb_auone_x_result_code"); if (in_array($res_code, $success)) { if (is_array($next_result_code) && in_array($res_code, $next_result_code)) { trigger_error($arrErrCd[$res_code], E_USER_WARNING); } // OK $transactionId = $result["body"]["transactionId"]; GC_Utils_Ex::gfPrintLog(print_r(compact("result", "config", "transactionId"), TRUE), DEBUG_LOG_REALFILE); if ($check_tid && strlen($transactionId) == 0 && $res_code == "01000") { GC_Utils_Ex::gfPrintLog(print_r(compact("result", "config", "transactionId"), TRUE), DEBUG_LOG_REALFILE); SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "無効なtransactionIDです。"); SC_Response_Ex::actionExit(); } elseif ($res_code == "40538") { } } elseif ($disp_error) { // NG SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, $arrErrCd[$res_code]); SC_Response_Ex::actionExit(); } else { return $arrErrCd[$res_code]; } return ""; }
protected function setOrderParam(SC_FormParam &$objFormParam, $vid, $aid, $re_download = false) { $config = SC_AuonePayment_Ex::getConfig(); $objProduct = new SC_Product_Ex(); $objPurchase = new SC_Helper_Purchase_Ex(); $objCustomer = new SC_Customer_Ex(); $this->lfInitParamOrder($objFormParam); $arrRet = array(); $objPurchase->copyFromCustomer($arrRet, $objCustomer); $objPurchase->copyFromCustomer($arrRet, $objCustomer, "shipping"); $arrRet["order_name01"] = str_replace(" ", "+", $arrRet["order_name01"]); $arrRet["order_name02"] = str_replace(" ", "+", $arrRet["order_name02"]); $arrRet["order_kana01"] = str_replace(" ", "+", $arrRet["order_kana01"]); $arrRet["order_kana02"] = str_replace(" ", "+", $arrRet["order_kana02"]); $product_class_id = SC_Utils_Ex::sfGetProductClassId($this->tpl_product_id); $arrProductClass = $objProduct->getDetailAndProductsClass($product_class_id); $objFormParam->setParam($arrProductClass); $objFormParam->setParam($arrRet); // きせかえタッチ情報 $objFormParam->setValue("kisekae_provider_id", $config['cpid']); $objFormParam->setValue("kisekae_site_id", $config['siteid']); $objFormParam->setValue("kisekae_contents_id", $objFormParam->getValue("product_code")); $objFormParam->setValue("kisekae_validateion_id", $vid); $objFormParam->setValue("kisekae_authentication_id", $aid); $use_point = 0; $objFormParam->setValue("use_point", $use_point); $objFormParam->setValue("quantity", 1); $objFormParam->setValue("product_name", $arrProductClass["name"]); $objFormParam->setValue("tax_rate", 0); $objFormParam->setValue("tax_rule", 0); $objFormParam->setValue("price", $arrProductClass["price02"]); $objFormParam->setValue("use_point", $arrProductClass["price02"]); if ($re_download) { $objFormParam->setValue("use_point", 0); } elseif ($objCustomer->getValue("buy_to_nopoint") == "1") { $objFormParam->setValue("use_point", 0); } $use_point = $objFormParam->getValue("use_point", 0); $use_point = intval($use_point); $objFormParam->setValue("deliv_id", 0); // 配送方法 0 基本管理画面では操作しない $objFormParam->setValue("payment_id", 0); // 支払方法 0 基本管理画面では操作しない $objFormParam->setValue("deliv_fee", 0); // 配送料金 0 基本管理画面では操作しない $objFormParam->setValue("status", ORDER_PENDING); // 配送料金 0 基本管理画面では操作しない $objFormParam->setValue("deliv_id", 0); $objFormParam->setValue("payment_id", 0); $objFormParam->setValue("deliv_fee", 0); // 注文合計 // 全ポイント払い $objFormParam->setValue('tax', 0); $objFormParam->setValue('subtotal', $use_point); $objFormParam->setValue('total', $use_point); $objFormParam->setValue('payment_total', 0); $objFormParam->setValue('discount', 0); $objFormParam->setValue('deliv_fee', 0); $objFormParam->setValue('charge', 0); }