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);
 }
 /**
  *
  * {@inheritDoc}
  *
  * @see LC_Page::init()
  */
 function init()
 {
     $this->not_unsupported = true;
     parent::init();
     $this->config = SC_AuonePayment_Ex::getConfig("free_field1");
 }
 /**
  * Page のアクション.
  *
  * @return void
  */
 public function action()
 {
     $objQuery = SC_Query_Ex::getSingletonInstance();
     parent::action();
     switch ($this->getMode()) {
         case "operate_cancel_cont_bill":
             $objFormParam = new SC_FormParam_Ex();
             $objFormSearchParam = new SC_FormParam_Ex();
             // パラメーター処理
             $this->lfInitParam($objFormParam);
             $objFormParam->setParam($_POST);
             $objFormParam->convParam();
             // 入力パラメーターチェック
             $this->arrErr = $this->lfCheckError($objFormParam);
             $this->arrForm = $objFormParam->getHashArray();
             // 検索引き継ぎ用パラメーター処理
             $this->lfInitSearchParam($objFormSearchParam);
             $objFormSearchParam->setParam($objFormParam->getValue('search_data'));
             $this->arrSearchErr = $this->lfCheckErrorSearchParam($objFormSearchParam);
             $this->arrSearchData = $objFormSearchParam->getSearchArray();
             break;
     }
     GC_Utils_Ex::gfDebugLog($this->arrErr);
     $objDb = new SC_Helper_DB_Ex();
     $this->customer_id = $this->arrForm['customer_id'];
     $this->customer = SC_Helper_Customer_Ex::sfGetCustomerData($this->customer_id);
     // モードによる処理切り替え
     switch ($this->getMode()) {
         case 'confirm':
             // 購入履歴情報の取得 (ポイント付与でエラーチェックに通らない時用)
             list($this->tpl_linemax, $this->arrPurchaseHistory, $this->objNavi) = $this->lfPurchaseHistory($this->customer_id);
             break;
         case "operate_cancel_cont_bill":
             list($this->tpl_linemax, $this->arrPurchaseHistory, $this->objNavi) = $this->lfPurchaseHistory($this->customer_id);
             $curl = $this->curl_init(true, false);
             $transactionId = $_REQUEST["au_payment_transaction_id"];
             $config = SC_AuonePayment_Ex::getConfig();
             if (strlen($transactionId) == 32) {
                 $post = $this->getPost("OperateCancelContBill", $config, compact("transactionId"));
                 curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
                 $result = $this->curl_result($curl);
                 $result["post_history"] = $post;
                 $this->arrErr["au_payment_transaction_id"] = $this->check_result($result, array());
                 $this->arrErr = array_filter($this->arrErr);
                 if (!isset($this->arrErr["au_payment_transaction_id"])) {
                     $curl = $this->curl_init(true);
                     // FIXME 状態確認
                     $post = $this->getPost("ConditionInquiryForPayTranStat", $config, compact("transactionId"));
                     curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
                     $result = $this->curl_result($curl);
                     $arrWhereVal = array("del_flg" => 1, "transaction_status" => $result["body"]["transactionStatus"], "pay_status" => $result["body"]["payStatus"]);
                     $arrWhereVal = array_filter($arrWhereVal, "strlen");
                     $objQuery->update("cp_dtb_customer_transaction", $arrWhereVal, "transaction_id = ? AND del_flg = 0", array($transactionId));
                 }
             } else {
                 $this->arrErr["au_payment_transaction_id"] = "不正な処理";
             }
             break;
     }
     if ($objDb->sfColumnExists("cp_dtb_customer_transaction", "id")) {
         $objQuery->setOrder("id DESC");
         $this->customer["transaction"] = $objQuery->select("*", "cp_dtb_customer_transaction", "\n                    customer_id = ?\n                AND continue_account_id IS NOT NULL\n                AND transaction_status = '40'\n            ", array($this->customer_id));
         $this->customer["transaction2"] = $objQuery->select("*", "cp_dtb_customer_transaction", "\n                    customer_id = ?\n                AND continue_account_id IS NULL\n                AND transaction_status = '40'\n            ", array($this->customer_id));
         $objQuery->setOrder("");
         if (count($this->customer["transaction"]) == 0 && $this->customer["status"] == "2") {
             SC_Helper_Customer_Ex::sfEditCustomerData(array("status" => 1), $this->customer_id);
             $this->arrForm["status"]["value"] = 1;
         }
     }
     foreach ($this->arrErr as $msg) {
         $this->tpl_onload .= ";console.log('{$msg}');";
     }
 }
 /**
  * レスポンスチェック.
  *
  * @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);
 }