source: branches/beta/data/downloads/module/mdl_remise/card.php @ 17003

Revision 17003, 5.8 KB checked in by adachi, 14 years ago (diff)

ポイント使用時にエラーになる不具合を修正

Line 
1<?php
2/*
3 * Copyright(c) 2000-2006 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7require_once("../require.php");
8require_once(DATA_PATH . "module/Request.php");
9require_once(MODULE_PATH . "mdl_remise/mdl_remise.inc");
10
11class LC_Page {
12    function LC_Page() {
13        /** ɬ¤º»ØÄꤹ¤ë **/
14        $this->tpl_mainpage = MODULE_PATH . 'mdl_remise/card.tpl';          // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È
15        $this->tpl_title = "¥«¡¼¥É·èºÑ";
16        /*
17         session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç
18         ¡ÖÌá¤ë¡×¥Ü¥¿¥ó»ÈÍÑ»þ¤ÎÍ­¸ú´ü¸ÂÀÚ¤ìɽ¼¨¤òÍÞÀ©¤¹¤ë¡£
19         private-no-expire:¥¯¥é¥¤¥¢¥ó¥È¤Î¥­¥ã¥Ã¥·¥å¤òµö²Ä¤¹¤ë¡£
20        */
21        session_cache_limiter('private-no-expire');
22    }
23}
24
25$objPage = new LC_Page();
26$objView = new SC_SiteView();
27$objSiteInfo = $objView->objSiteInfo;
28$arrInfo = $objSiteInfo->data;
29
30// ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹
31$objFormParam = new SC_FormParam();
32// ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½
33lfInitParam();
34// POSTÃͤμèÆÀ
35$objFormParam->setParam($_POST);
36
37// ¥æ¡¼¥¶¥æ¥Ë¡¼¥¯ID¤Î¼èÆÀ¤È¹ØÆþ¾õÂÖ¤ÎÀµÅöÀ­¤ò¥Á¥§¥Ã¥¯
38$uniqid = sfCheckNormalAccess($objSiteSess, $objCartSess);
39
40// ¥«¡¼¥È½¸·×½èÍý
41$objPage = sfTotalCart($objPage, $objCartSess, $arrInfo);
42
43// °ì»þ¼õÃí¥Æ¡¼¥Ö¥ë¤ÎÆɹþ
44$arrData = sfGetOrderTemp($uniqid);
45
46// ¥«¡¼¥È½¸·×¤ò¸µ¤ËºÇ½ª·×»»
47$arrData = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo);
48
49$sql = "SELECT module_id, memo01, memo02, memo03, memo04, memo05, memo06, memo07, memo08, memo09, memo10 ".
50    "FROM dtb_payment WHERE payment_id = ? ";
51
52// »Ùʧ¤¤¾ðÊó¤ò¼èÆÀ
53$arrPayment = $objQuery->getall($sql, array($arrData["payment_id"]));
54
55// ²èÌÌÁ«°ÜȽÄê
56switch($_POST["mode"]){
57    //Ìá¤ë
58    case 'return':
59        // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
60        $objSiteSess->setRegistFlag();
61        // ³Îǧ¥Ú¡¼¥¸¤Ø°ÜÆ°
62        header("Location: " . URL_SHOP_CONFIRM);
63        exit;
64        break;
65}
66
67// ¥ë¥ß¡¼¥º¤«¤é¤ÎÊÖ¿®¤¬¤¢¤Ã¤¿¾ì¹ç
68if (isset($_POST["X-R_CODE"])) {
69
70    $err_detail = "";
71
72    // ÄÌ¿®»þ¥¨¥é¡¼
73    if ($_POST["X-R_CODE"] != $arrRemiseErrorWord["OK"]) {
74        $err_detail = $_POST["X-R_CODE"];
75        sfDispSiteError(FREE_ERROR_MSG, "", false, "¹ØÆþ½èÍýÃæ¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£<br /><br /><br />¡¦" . $err_detail);
76
77    // ÄÌ¿®·ë²ÌÀµ¾ï
78    } else {
79
80        $log_path = DATA_PATH . "logs/remise_card_finish.log";
81        gfPrintLog("remise card finish start----------", $log_path);
82        foreach($_POST as $key => $val){
83            gfPrintLog( "\t" . $key . " => " . $val, $log_path);
84        }
85        gfPrintLog("remise card finish end  ----------", $log_path);
86
87        // ¶â³Û¤ÎÀ°¹çÀ­¥Á¥§¥Ã¥¯
88        if ($arrData["payment_total"] != $_POST["X-TOTAL"] && $arrData["credit_result"] != $_POST["X-TRANID"]) {
89            sfDispSiteError(FREE_ERROR_MSG, "", false, "¹ØÆþ½èÍýÃæ¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£<br /><br /><br />¡¦ÀÁµá¶â³Û¤È»Ùʧ¤¤¶â³Û¤¬°ã¤¤¤Þ¤¹¡£");
90        }
91
92        // Àµ¾ï¤Ê¿ä°Ü¤Ç¤¢¤ë¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
93        $objSiteSess->setRegistFlag();
94
95        // POST¥Ç¡¼¥¿¤òÊݸ
96        $arrVal["credit_result"] = $_POST["X-TRANID"];
97        $arrVal["memo01"] = PAYMENT_CREDIT_ID;
98        $arrVal["memo03"] = $arrPayment[0]["module_id"];
99        $arrVal["memo04"] = $_POST["X-TRANID"];
100
101        // ¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¥³¡¼¥É
102        $arrMemo["trans_code"] = array("name"=>"Remise¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¥³¡¼¥É", "value" => $_POST["X-TRANID"]);
103        $arrVal["memo02"] = serialize($arrMemo);
104
105        // ·èºÑÁ÷¿®¥Ç¡¼¥¿ºîÀ®
106        $arrModule['module_id'] = MDL_REMISE_ID;
107        $arrModule['payment_total'] = $arrData["payment_total"];
108        $arrModule['payment_id'] = PAYMENT_CREDIT_ID;
109        $arrVal['memo05'] = serialize($arrModule);
110
111        // ¼õÃí°ì»þ¥Æ¡¼¥Ö¥ë¤Ë¹¹¿·
112        sfRegistTempOrder($uniqid, $arrVal);
113
114        // ´°Î»²èÌ̤Ø
115        header("Location: " .  URL_SHOP_COMPLETE);
116    }
117}
118
119// EC-CUBE¦¤ÎÄÌÃÎÍÑURL
120$retUrl = SITE_URL . 'shopping/load_payment_module.php?module_id=' . MDL_REMISE_ID;
121$exitUrl = SITE_URL . 'shopping/load_payment_module.php';
122
123$arrSendData = array(
124    'SEND_URL'      => $arrPayment[0]["memo04"],    // ÀܳÀèURL
125    'S_TORIHIKI_NO' => $arrData["order_id"],        // ¥ª¡¼¥À¡¼ÈÖ¹æ
126    'MAIL'          => $arrData["order_email"],     // ¥á¡¼¥ë¥¢¥É¥ì¥¹
127    'AMOUNT'        => $arrData["payment_total"],   // ¶â³Û
128    'TAX'           => '0',                         // Á÷ÎÁ + ÀÇ
129    'TOTAL'         => $arrData["payment_total"],   // ¹ç·×¶â³Û
130    'SHOPCO'        => $arrPayment[0]["memo01"],    // ŹÊÞ¥³¡¼¥É
131    'HOSTID'        => $arrPayment[0]["memo02"],    // ¥Û¥¹¥ÈID
132    'JOB'           => REMISE_PAYMENT_JOB_CODE,     // ¥¸¥ç¥Ö¥³¡¼¥É
133    'ITEM'          => '0000120',                   // ¾¦ÉÊ¥³¡¼¥É(¥ë¥ß¡¼¥º¸ÇÄê)
134    'RETURL'        => $retUrl,                     // ´°Î»ÄÌÃÎURL
135    'NG_RETURL'     => $retUrl,                     // NG´°Î»ÄÌÃÎURL
136    'EXITURL'       => $exitUrl,                    // Ìá¤êÀèURL
137    'REMARKS3'      => MDL_REMISE_POST_VALUE,
138    'ELIO'          => 1                            // ELIO·èºÑ
139);
140
141// »Ùʧ¤¤Êýˡɽ¼¨½èÍý
142$objFormParam->setValue("credit_method", $arrPayment[0]["memo08"]);
143$objFormParam->splitParamCheckBoxes("credit_method");
144$arrUseCreMet = $objFormParam->getValue("credit_method");
145
146foreach($arrUseCreMet as $key => $val) {
147    $arrCreMet[$val] = $arrCredit[$val];
148}
149
150// ʬ³ä²ó¿ôɽ¼¨½èÍý(´ÉÍý²èÌ̤ǤÎÀßÄê²ó¿ô°ÊÆâ¤Þ¤Çɽ¼¨)
151foreach($arrCreditDivide as $key => $val) {
152    if ($arrPayment[0]["memo09"] >= $val) {
153        $arrCreDiv[$val] = $val;
154    }
155}
156
157$objPage->arrCreMet = $arrCreMet;
158$objPage->arrCreDiv = $arrCreDiv;
159$objPage->arrSendData = $arrSendData;
160
161$objView->assignobj($objPage);
162
163// ½ÐÎÏÆâÍƤòSJIS¤Ë¤¹¤ë(¥ë¥ß¡¼¥ºÂбþ)
164mb_http_output(REMISE_SEND_ENCODE);
165$objView->display(SITE_FRAME);
166//---------------------------------------------------------------------------------------------------------------------------------------------------------
167
168//¥Ñ¥é¥á¡¼¥¿¤Î½é´ü²½
169function lfInitParam() {
170    global $objFormParam;
171    $objFormParam->addParam("»Ùʧ¤¤ÊýË¡", "credit_method");
172}
173
174?>
Note: See TracBrowser for help on using the repository browser.