/** * 受注IDをキーにして, 決済モジュールのパスを取得する. * * 決済モジュールが取得できた場合は, require 可能な決済モジュールのパスを返す. * 受注IDが無効な場合, 取得したパスにファイルが存在しない場合は false * * @param integer $order_id 受注ID * @return string|boolean 成功した場合は決済モジュールのパス; * 失敗した場合 false */ public function getModulePath($order_id) { $objPurchase = new SC_Helper_Purchase_Ex(); $objPayment = new SC_Helper_Payment_Ex(); $order = $objPurchase->getOrder($order_id); $payment = $objPayment->get($order['payment_id']); $module_path = $payment['module_path']; /* * 2.12.x までは dtb_payment.module_path がフルパスとなっていた. * 2.13.x より, MODULE_REALDIR からのパスでも対応できるよう修正 * http://svn.ec-cube.net/open_trac/ticket/2292 */ if (realpath($module_path) !== false) { $module_path = str_replace('\\', '/', realpath($module_path)); } else { $module_path = str_replace('\\', '/', $module_path); } $module_realdir = str_replace('\\', '/', realpath(MODULE_REALDIR) . '/'); if (strpos($module_path, $module_realdir) !== false) { $module_path = str_replace($module_realdir, '', $module_path); } $module_path = $module_realdir . $module_path; if (file_exists($module_path)) { return $module_path; } return false; }
/** * Page のアクション. * * @return void */ function action() { $objPayment = new SC_Helper_Payment_Ex(); if (!empty($_POST)) { $objFormParam = new SC_FormParam_Ex(); $objFormParam->addParam('支払方法ID', 'payment_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); $objFormParam->setParam($_POST); $objFormParam->convParam(); $this->arrErr = $objFormParam->checkError(); if (!empty($this->arrErr['payment_id'])) { trigger_error('', E_USER_ERROR); return; } $post = $objFormParam->getHashArray(); } switch ($this->getMode()) { case 'delete': // ランク付きレコードの削除 $objPayment->delete($post['payment_id']); // 再表示 $this->objDisplay->reload(); break; case 'up': $objPayment->rankUp($post['payment_id']); // 再表示 $this->objDisplay->reload(); break; case 'down': $objPayment->rankDown($post['payment_id']); // 再表示 $this->objDisplay->reload(); break; } $this->arrPaymentListFree = $objPayment->getList(); }
/** * dtb_payment に WebPay モジュールによるクレジットカード決済がない場合は追加する * * @return boolean 実行した場合は true */ private function initPaymentMethod($current_member_id) { $objQuery = SC_Query::getSingletonInstance(); $isExists = $objQuery->exists('dtb_payment', 'module_id = ?', array(MDL_WEBPAY_ID)); if ($isExists) { return false; } // rank, create_date, update_date, payment_id は自動設定される $arrVal = array('payment_method' => 'クレジットカード決済', 'creator_id' => $current_member_id, 'charge_flg' => 2, 'rule_min' => 50, 'upper_rule_max' => 9999999, 'module_id' => MDL_WEBPAY_ID, 'module_path' => MDL_WEBPAY_REALDIR . 'payment.php', 'memo03' => MDL_WEBPAY_CODE); $objPayment = new SC_Helper_Payment_Ex(); $objPayment->save($arrVal); return true; }
/** * Page を初期化する. * * @return void */ public function init() { parent::init(); $this->tpl_mainpage = 'customer/edit.tpl'; $this->tpl_mainno = 'customer'; $this->tpl_subno = 'index'; $this->tpl_pager = 'pager.tpl'; $this->tpl_maintitle = '会員管理'; $this->tpl_subtitle = '会員登録'; $masterData = new SC_DB_MasterData_Ex(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrCountry = $masterData->getMasterData('mtb_country'); $this->arrJob = $masterData->getMasterData('mtb_job'); $this->arrSex = $masterData->getMasterData('mtb_sex'); $this->arrReminder = $masterData->getMasterData('mtb_reminder'); $this->arrStatus = $masterData->getMasterData('mtb_customer_status'); $this->arrMailMagazineType = $masterData->getMasterData('mtb_mail_magazine_type'); // 日付プルダウン設定 $objDate = new SC_Date_Ex(BIRTH_YEAR); $this->arrYear = $objDate->getYear(); $this->arrMonth = $objDate->getMonth(); $this->arrDay = $objDate->getDay(); // 支払い方法種別 $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList(); }
/** * Page を初期化する. * * @return void */ public function init() { parent::init(); $this->tpl_mainpage = 'order/index.tpl'; $this->tpl_mainno = 'order'; $this->tpl_subno = 'index'; $this->tpl_pager = 'pager.tpl'; $this->tpl_maintitle = '受注管理'; $this->tpl_subtitle = '受注管理'; $masterData = new SC_DB_MasterData_Ex(); $this->arrORDERSTATUS = $masterData->getMasterData('mtb_order_status'); $this->arrORDERSTATUS_COLOR = $masterData->getMasterData('mtb_order_status_color'); $this->arrSex = $masterData->getMasterData('mtb_sex'); $this->arrPageMax = $masterData->getMasterData('mtb_page_max'); $objDate = new SC_Date_Ex(); // 登録・更新日検索用 $objDate->setStartYear(RELEASE_YEAR); $objDate->setEndYear(DATE('Y')); $this->arrRegistYear = $objDate->getYear(); // 生年月日検索用 $objDate->setStartYear(BIRTH_YEAR); $objDate->setEndYear(DATE('Y')); $this->arrBirthYear = $objDate->getYear(); // 月日の設定 $this->arrMonth = $objDate->getMonth(); $this->arrDay = $objDate->getDay(); // 支払い方法の取得 $this->arrPayments = SC_Helper_Payment_Ex::getIDValueList(); $this->httpCacheControl('nocache'); }
/** * Page を初期化する. * * @return void */ public function init() { parent::init(); $this->tpl_mainpage = 'order/edit.tpl'; $this->tpl_mainno = 'order'; $this->tpl_maintitle = '受注管理'; $this->tpl_subtitle = '受注登録'; $masterData = new SC_DB_MasterData_Ex(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrCountry = $masterData->getMasterData('mtb_country'); $this->arrORDERSTATUS = $masterData->getMasterData('mtb_order_status'); $this->arrDeviceType = $masterData->getMasterData('mtb_device_type'); $this->arrSex = $masterData->getMasterData('mtb_sex'); $this->arrJob = $masterData->getMasterData('mtb_job'); $objShippingDate = new SC_Date_Ex(RELEASE_YEAR); $this->arrYearShippingDate = $objShippingDate->getYear('', date('Y'), ''); $this->arrMonthShippingDate = $objShippingDate->getMonth(true); $this->arrDayShippingDate = $objShippingDate->getDay(true); $objBirthDate = new SC_Date_Ex(BIRTH_YEAR, date('Y', strtotime('now'))); $this->arrBirthYear = $objBirthDate->getYear('', START_BIRTH_YEAR, ''); $this->arrBirthMonth = $objBirthDate->getMonth(true); $this->arrBirthDay = $objBirthDate->getDay(true); // 支払い方法の取得 $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList(); // 配送業者の取得 $this->arrDeliv = SC_Helper_Delivery_Ex::getIDValueList(); $this->httpCacheControl('nocache'); }
/** * Page を初期化する. * * @return void */ public function init() { parent::init(); $this->tpl_mainpage = 'basis/delivery_input.tpl'; $this->tpl_subno = 'delivery'; $this->tpl_mainno = 'basis'; $masterData = new SC_DB_MasterData_Ex(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrProductType = $masterData->getMasterData('mtb_product_type'); $this->arrPayments = SC_Helper_Payment_Ex::getIDValueList(); $this->tpl_maintitle = '基本情報管理'; $this->tpl_subtitle = '配送方法設定'; $this->mode = $this->getMode(); }
/** * Page を初期化する. * * @return void */ public function init() { parent::init(); $this->tpl_mainpage = 'order/disp.tpl'; $this->tpl_mainno = 'order'; $this->tpl_subnavi = ''; $this->tpl_subno = ''; $this->tpl_subtitle = '受注情報表示'; $masterData = new SC_DB_MasterData_Ex(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrORDERSTATUS = $masterData->getMasterData('mtb_order_status'); $this->arrDeviceType = $masterData->getMasterData('mtb_device_type'); $this->arrCountry = $masterData->getMasterData('mtb_country'); $this->arrSex = $masterData->getMasterData('mtb_sex'); $this->arrJob = $masterData->getMasterData('mtb_job'); // 支払い方法の取得 $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList(); // 配送業者の取得 $this->arrDeliv = SC_Helper_Delivery_Ex::getIDValueList(); }
/** * Page を初期化する. * * @return void */ public function init() { parent::init(); $this->tpl_mainpage = 'products/upload_csv.tpl'; $this->tpl_mainno = 'products'; $this->tpl_subno = 'upload_csv'; $this->tpl_maintitle = '商品管理'; $this->tpl_subtitle = '商品登録CSV'; $this->csv_id = '1'; $masterData = new SC_DB_MasterData_Ex(); $this->arrDISP = $masterData->getMasterData('mtb_disp'); $this->arrSTATUS = $masterData->getMasterData('mtb_status'); $this->arrDELIVERYDATE = $masterData->getMasterData('mtb_delivery_date'); $this->arrProductType = $masterData->getMasterData('mtb_product_type'); $this->arrMaker = SC_Helper_Maker_Ex::getIDValueList(); $this->arrPayments = SC_Helper_Payment_Ex::getIDValueList(); $this->arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); $this->arrAllowedTag = $masterData->getMasterData('mtb_allowed_tag'); $this->arrTagCheckItem = array(); }
/** * Page のアクション. * * @return void */ public function action() { $objDb = new SC_Helper_DB_Ex(); // パラメーター管理クラス $objFormParam = new SC_FormParam_Ex(); // パラメーター情報の初期化 $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); // 入力値の変換 $objFormParam->convParam(); $this->arrForm = $objFormParam->getHashArray(); //支払方法の取得 $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList(); switch ($this->getMode()) { case 'update': switch ($objFormParam->getValue('change_status')) { // 削除 case 'delete': $this->lfDelete($objFormParam->getValue('move')); break; // 更新 // 更新 default: $this->lfStatusMove($objFormParam->getValue('change_status'), $objFormParam->getValue('move')); break; } break; case 'search': default: break; } // 対応状況 $status = $objFormParam->getValue('status'); if (strlen($status) === 0) { //デフォルトで新規受付一覧表示 $status = ORDER_NEW; } $this->SelectedStatus = $status; //検索結果の表示 $this->lfStatusDisp($status, $objFormParam->getValue('search_pageno')); }
/** * Page のAction. * * @return void */ public function action() { //決済処理中ステータスのロールバック $objPurchase = new SC_Helper_Purchase_Ex(); $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); $objCustomer = new SC_Customer_Ex(); $objProduct = new SC_Product(); if (!SC_Utils_Ex::sfIsInt($_GET['order_id'])) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } $order_id = $_GET['order_id']; $this->is_price_change = false; //受注データの取得 $this->tpl_arrOrderData = $objPurchase->getOrder($order_id, $objCustomer->getValue('customer_id')); if (empty($this->tpl_arrOrderData)) { SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); } $this->arrShipping = $this->lfGetShippingDate($objPurchase, $order_id, $this->arrWDAY); $this->isMultiple = count($this->arrShipping) > 1; // 支払い方法の取得 $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList(); // 受注商品明細の取得 $this->tpl_arrOrderDetail = $objPurchase->getOrderDetail($order_id); foreach ($this->tpl_arrOrderDetail as $product_index => $arrOrderProductDetail) { //必要なのは商品の販売金額のみなので、遅い場合は、別途SQL作成した方が良い $arrTempProductDetail = $objProduct->getProductsClass($arrOrderProductDetail['product_class_id']); // 税計算 $this->tpl_arrOrderDetail[$product_index]['price_inctax'] = $this->tpl_arrOrderDetail[$product_index]['price'] + SC_Helper_TaxRule_Ex::calcTax($this->tpl_arrOrderDetail[$product_index]['price'], $this->tpl_arrOrderDetail[$product_index]['tax_rate'], $this->tpl_arrOrderDetail[$product_index]['tax_rule']); $arrTempProductDetail['price02_inctax'] = SC_Helper_TaxRule_Ex::sfCalcIncTax($arrTempProductDetail['price02'], $arrTempProductDetail['product_id'], $arrTempProductDetail['product_class_id']); if ($this->tpl_arrOrderDetail[$product_index]['price_inctax'] != $arrTempProductDetail['price02_inctax']) { $this->is_price_change = true; } $this->tpl_arrOrderDetail[$product_index]['product_price_inctax'] = $arrTempProductDetail['price02_inctax'] ? $arrTempProductDetail['price02_inctax'] : 0; } $this->tpl_arrOrderDetail = $this->setMainListImage($this->tpl_arrOrderDetail); $objPurchase->setDownloadableFlgTo($this->tpl_arrOrderDetail); // モバイルダウンロード対応処理 $this->lfSetAU($this->tpl_arrOrderDetail); // 受注メール送信履歴の取得 $this->tpl_arrMailHistory = $this->lfGetMailHistory($order_id); }
/** * Page のアクション. * * @return void */ function action() { $objCartSess = new SC_CartSession_Ex(); $objSiteSess = new SC_SiteSession_Ex(); $objCustomer = new SC_Customer_Ex(); $objPurchase = new SC_Helper_Purchase_Ex(); $objHelperMail = new SC_Helper_Mail_Ex(); $this->is_multiple = $objPurchase->isMultiple(); // 前のページで正しく登録手続きが行われた記録があるか判定 if (!$objSiteSess->isPrePage()) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, $objSiteSess); } // ユーザユニークIDの取得と購入状態の正当性をチェック $this->tpl_uniqid = $objSiteSess->getUniqId(); $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess); $this->cartKey = $objCartSess->getKey(); // カート内商品のチェック $this->tpl_message = $objCartSess->checkProducts($this->cartKey); if (!SC_Utils_Ex::isBlank($this->tpl_message)) { SC_Response_Ex::sendRedirect(CART_URLPATH); SC_Response_Ex::actionExit(); } // カートの商品を取得 $this->arrShipping = $objPurchase->getShippingTemp($this->is_multiple); $this->arrCartItems = $objCartSess->getCartList($this->cartKey); // 合計金額 $this->tpl_total_inctax[$this->cartKey] = $objCartSess->getAllProductsTotal($this->cartKey); // 税額 $this->tpl_total_tax[$this->cartKey] = $objCartSess->getAllProductsTax($this->cartKey); // ポイント合計 $this->tpl_total_point[$this->cartKey] = $objCartSess->getAllProductsPoint($this->cartKey); // 一時受注テーブルの読込 $arrOrderTemp = $objPurchase->getOrderTemp($this->tpl_uniqid); // カート集計を元に最終計算 $arrCalcResults = $objCartSess->calculate($this->cartKey, $objCustomer, $arrOrderTemp['use_point'], $objPurchase->getShippingPref($this->is_multiple), $arrOrderTemp['charge'], $arrOrderTemp['discount'], $arrOrderTemp['deliv_id']); $this->arrForm = array_merge($arrOrderTemp, $arrCalcResults); // 会員ログインチェック if ($objCustomer->isLoginSuccess(true)) { $this->tpl_login = '******'; $this->tpl_user_point = $objCustomer->getValue('point'); } // 決済モジュールを使用するかどうか $this->use_module = SC_Helper_Payment_Ex::useModule($this->arrForm['payment_id']); switch ($this->getMode()) { // 前のページに戻る case 'return': // 正常な推移であることを記録しておく $objSiteSess->setRegistFlag(); SC_Response_Ex::sendRedirect(SHOPPING_PAYMENT_URLPATH); SC_Response_Ex::actionExit(); break; case 'confirm': /* * 決済モジュールで必要なため, 受注番号を取得 */ $this->arrForm['order_id'] = $objPurchase->getNextOrderID(); $_SESSION['order_id'] = $this->arrForm['order_id']; // 集計結果を受注一時テーブルに反映 $objPurchase->saveOrderTemp($this->tpl_uniqid, $this->arrForm, $objCustomer); // 正常に登録されたことを記録しておく $objSiteSess->setRegistFlag(); // 決済モジュールを使用する場合 if ($this->use_module) { $objPurchase->completeOrder(ORDER_PENDING); SC_Response_Ex::sendRedirect(SHOPPING_MODULE_URLPATH); } else { $objPurchase->completeOrder(ORDER_NEW); $template_id = SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE ? 2 : 1; $objHelperMail->sfSendOrderMail($this->arrForm['order_id'], $template_id); SC_Response_Ex::sendRedirect(SHOPPING_COMPLETE_URLPATH); } SC_Response_Ex::actionExit(); break; default: break; } }
/** * 配送業者IDから, 支払い方法, お届け時間の配列を取得する. * * 結果の連想配列の添字の値は以下の通り * - 'arrDelivTime' - お届け時間の配列 * - 'arrPayment' - 支払い方法の配列 * - 'img_show' - 支払い方法の画像の有無 * * @param SC_CartSession $objCartSess SC_CartSession インスタンス * @param integer $deliv_id 配送業者ID * @return array 支払い方法, お届け時間を格納した配列 */ public function getSelectedDeliv(&$objCartSess, $deliv_id) { $arrResults = array(); if (strval($deliv_id) === strval(intval($deliv_id))) { $arrResults['arrDelivTime'] = SC_Helper_Delivery_Ex::getDelivTime($deliv_id); $total = $objCartSess->getAllProductsTotal($objCartSess->getKey()); $payments_deliv = SC_Helper_Delivery_Ex::getPayments($deliv_id); $objPayment = new SC_Helper_Payment_Ex(); $payments_total = $objPayment->getByPrice($total); $arrPayment = array(); foreach ($payments_total as $payment) { if (in_array($payment['payment_id'], $payments_deliv)) { $arrPayment[] = $payment; } } $arrResults['arrPayment'] = $arrPayment; $arrResults['img_show'] = $this->hasPaymentImage($arrResults['arrPayment']); } return $arrResults; }
function lfCheckError($post, $objFormParam, SC_Helper_Payment_Ex $objPayment) { // DBのデータを取得 $arrPaymentData = $objPayment->get($post['payment_id']); // 手数料を設定できない場合には、手数料を0にする if ($arrPaymentData['charge_flg'] == 2) { $objFormParam->setValue('charge', '0'); } // 入力データを渡す。 $arrRet = $objFormParam->getHashArray(); $objErr = new SC_CheckError_Ex($arrRet); $objErr->arrErr = $objFormParam->checkError(); // 利用条件(下限)チェック if ($arrRet['rule_max'] < $arrPaymentData['rule_min'] and $arrPaymentData['rule_min'] != '') { $objErr->arrErr['rule'] = '利用条件(下限)は' . $arrPaymentData['rule_min'] . '円以上にしてください。<br>'; } // 利用条件(上限)チェック if ($arrRet['upper_rule'] > $arrPaymentData['upper_rule_max'] and $arrPaymentData['upper_rule_max'] != '') { $objErr->arrErr['upper_rule'] = '利用条件(上限)は' . $arrPaymentData['upper_rule_max'] . '円以下にしてください。<br>'; } // 利用条件チェック $objErr->doFunc(array('利用条件(~円以上)', '利用条件(~円以下)', 'rule_max', 'upper_rule'), array('GREATER_CHECK')); return $objErr->arrErr; }
function lfCheckError($post, $objFormParam, SC_Helper_Payment_Ex $objPayment) { // DBのデータを取得 $arrPaymentData = $objPayment->get($post['payment_id']); // 手数料を設定できない場合には、手数料を0にする if ($arrPaymentData['charge_flg'] == 2) { $objFormParam->setValue('charge', '0'); } // 入力データを渡す。 $arrRet = $objFormParam->getHashArray(); $objErr = new SC_CheckError_Ex($arrRet); $objErr->arrErr = $objFormParam->checkError(); // 利用条件(下限)チェック if ($arrRet['rule_max'] < $arrPaymentData['rule_min'] and $arrPaymentData['rule_min'] != '') { $objErr->arrErr['rule'] = t('c_Make the usage conditions (lower limit) $ T_ARG1 or more.<br>_01', array('T_ARG1', $arrPaymentData['rule_min'])); } // 利用条件(上限)チェック if ($arrRet['upper_rule'] > $arrPaymentData['upper_rule_max'] and $arrPaymentData['upper_rule_max'] != '') { $objErr->arrErr['rule'] = t('c_Make the usage conditions (max) $ T_ARG1 or less.<br>_01', array('T_ARG1', $arrPaymentData['upper_rule_max'])); } // 利用条件チェック $objErr->doFunc(array(t('c_Usage conditions(-$ Above)_01'), t('c_Usage conditions(-$ Less than)_01'), 'rule_max', 'upper_rule'), array('GREATER_CHECK')); return $objErr->arrErr; }
private function validateOrderConsistency($arrOrder) { switch ($arrOrder['status']) { case ORDER_PENDING: // 対象ケース。以降で処理する break; // 会計済み。許容しうる // 会計済み。許容しうる case ORDER_NEW: case ORDER_PAY_WAIT: case ORDER_PRE_END: SC_Response_Ex::sendRedirect(SHOPPING_COMPLETE_URLPATH); SC_Response_Ex::actionExit(); break; // WebPay の決済では発生しない // WebPay の決済では発生しない default: SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', true, '注文情報の状態が不正です。<br />この手続きは無効となりました。'); } $objPayment = new SC_Helper_Payment_Ex(); $arrPayment = $objPayment->get($arrOrder['payment_id']); if ($arrPayment === null || $arrPayment['module_id'] !== MDL_WEBPAY_ID) { SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', true, '支払方法が不正です。<br />この手続きは無効となりました。'); } }
/** * Page のAction. * * @return void */ public function action() { //決済処理中ステータスのロールバック $objPurchase = new SC_Helper_Purchase_Ex(); $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); $objCustomer = new SC_Customer_Ex(); $customer_id = $objCustomer->getValue('customer_id'); //ページ送り用 $this->objNavi = new SC_PageNavi_Ex($_REQUEST['pageno'], $this->lfGetOrderHistory($customer_id), SEARCH_PMAX, 'eccube.movePage', NAVI_PMAX, 'pageno=#page#', SC_Display_Ex::detectDevice() !== DEVICE_TYPE_MOBILE); $this->arrOrder = $this->lfGetOrderHistory($customer_id, $this->objNavi->start_row); switch ($this->getMode()) { case 'getList': echo SC_Utils_Ex::jsonEncode($this->arrOrder); SC_Response_Ex::actionExit(); break; default: break; } // 支払い方法の取得 $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList(); // 1ページあたりの件数 $this->dispNumber = SEARCH_PMAX; $this->json_payment = SC_Utils::jsonEncode($this->arrPayment); $this->json_customer_order_status = SC_Utils::jsonEncode($this->arrCustomerOrderStatus); }