Changeset 7796 for temp/trunk/data
- Timestamp:
- 2006/11/08 16:19:00 (20 years ago)
- Location:
- temp/trunk/data/downloads/module/mdl_epsilon
- Files:
-
- 1 deleted
- 1 edited
-
card.tpl (deleted)
-
convenience.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
temp/trunk/data/downloads/module/mdl_epsilon/convenience.php
r7573 r7796 7 7 8 8 require_once("../require.php"); 9 require_once(DATA_PATH . "module/Request.php"); 10 require_once(MODULE_PATH . "mdl_epsilon/mdl_epsilon.inc"); 9 11 10 12 class LC_Page { 11 13 function LC_Page() { 12 $this->tpl_mainpage = "shopping/convenience.tpl"; 13 $this->tpl_css = '/css/layout/shopping/pay.css'; 14 global $arrCONVENIENCE; 15 $this->arrCONVENIENCE = $arrCONVENIENCE; 14 /** ɬ¤º»ØÄꤹ¤ë **/ 15 $this->tpl_mainpage = 'mdl_epsilon/card.tpl'; // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È 16 16 /* 17 17 session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç … … 23 23 } 24 24 25 $objPage = new LC_Page; 26 $objView = new SC_SiteView; 27 $objSiteSess = new SC_SiteSession; 28 $objCartSess = new SC_CartSession; 25 $objPage = new LC_Page(); 26 $objView = new SC_SiteView(); 29 27 $objSiteInfo = $objView->objSiteInfo; 30 $objCustomer = new SC_Customer;31 32 28 $arrInfo = $objSiteInfo->data; 33 29 34 // ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹ 35 $objFormParam = new SC_FormParam(); 36 // ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ 37 lfInitParam(); 38 // POSTÃͤμèÆÀ 39 $objFormParam->setParam($_POST); 40 41 // ¥¢¥¯¥»¥¹¤ÎÀµÅöÀ¤ÎȽÄê 30 // ¥æ¡¼¥¶¥æ¥Ë¡¼¥¯ID¤Î¼èÆÀ¤È¹ØÆþ¾õÂÖ¤ÎÀµÅöÀ¤ò¥Á¥§¥Ã¥¯ 42 31 $uniqid = sfCheckNormalAccess($objSiteSess, $objCartSess); 43 32 44 //¥³¥ó¥Ó¥Ë¤Î¼ïÎà¤Ç½èÍý¥Õ¥¡¥¤¥ë¤òÀÚ¤êÂØ¤¨¤ë 45 switch($_POST['mode']) { 46 //´°Î» 47 case 'complete': 48 //¥¨¥é¡¼¥Á¥§¥Ã¥¯ 49 $objPage->arrErr = lfCheckError(); 50 if($objPage->arrErr == "") { 51 // ¥Þ¡¼¥Á¥ã¥ó¥È¾ðÊóÀßÄê¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥¯¥ë¡¼¥É 52 //require("merchant.ini"); 53 // ·èºÑ½èÍý¥Ñ¥Ã¥±¡¼¥¸¤ò¥¤¥ó¥¯¥ë¡¼¥É 54 require_once(DATA_PATH . "vtcvsmdk/mdk/lib/BSCVS/Transaction.php"); 55 require_once(DATA_PATH . "vtcvsmdk/mdk/lib/BSCVS/Config.php"); 56 require_once(DATA_PATH . "vtcvsmdk/mdk/lib/BSCVS/Log.php"); 33 // ¥«¡¼¥È½¸·×½èÍý 34 $objPage = sfTotalCart($objPage, $objCartSess, $arrInfo); 35 36 // °ì»þ¼õÃí¥Æ¡¼¥Ö¥ë¤ÎÆÉ¹þ 37 $arrData = sfGetOrderTemp($uniqid); 38 39 // ¥«¡¼¥È½¸·×¤ò¸µ¤ËºÇ½ª·×»» 40 $arrData = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo); 41 42 // Âåɽ¾¦ÉʾðÊó 43 $arrMainProduct = $objPage->arrProductsClass[0]; 44 45 // »Ùʧ¤¤¾ðÊó¤ò¼èÆÀ 46 $arrPayment = $objQuery->getall("SELECT module_id, memo01, memo02, memo03, memo04, memo05, memo06, memo07, memo08, memo09, memo10 FROM dtb_payment WHERE payment_id = ? ", array($arrData["payment_id"])); 47 48 // ¥Ç¡¼¥¿Á÷¿®ÀèCGI 49 $order_url = $arrPayment[0]["memo02"]; 50 51 // trans_code¤ËÃͤ¬¤¢¤ê³î¤Ä¡¢Àµ¾ï½ªÎ»¤Î¤È¤¤Ï¥ª¡¼¥À¡¼³Îǧ¤ò¹Ô¤¦¡£ 52 if($_GET["result"] == "1"){ 57 53 58 // ¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¥¤¥ó¥¹¥¿¥ó¥¹¤òºîÀ® 59 $objTran = new Transaction; 60 61 // ÀßÄê¥Õ¥¡¥¤¥ë cvsgwlib.conf ¤Ë¤è¤ê¥¤¥ó¥¹¥¿¥ó¥¹¤ò½é´ü²½ 62 $objTran->setServer(DATA_PATH . "vtcvsmdk/mdk/conf/cvsgwlib.conf"); 63 64 // ¥«¡¼¥È½¸·×½èÍý 65 $objPage = sfTotalCart($objPage, $objCartSess, $arrInfo); 66 // °ì»þ¼õÃí¥Æ¡¼¥Ö¥ë¤ÎÆÉ¹þ 67 $arrData = sfGetOrderTemp($uniqid); 68 // ¥«¡¼¥È½¸·×¤ò¸µ¤ËºÇ½ª·×»» 69 $arrPrice = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo, $objCustomer); 70 71 // ¥í¥°½ÐÎÏ¥¤¥ó¥¹¥¿¥ó¥¹¤ò¼èÆÀ 72 $logger = $objTran->getLogger(); 73 74 // ¥í¥°½ÐÎÏ(¤³¤³¤«¤é) 75 $logger->logprint('DEBUG', '<<< »Ùʧ·ë²Ì²èÌ̽èÍý³«»Ï... >>>'); 76 77 //¥³¥ó¥Ó¥Ë¤Î¼ïÎफ¤éCVS¥¿¥¤¥×¤ò·èÄꤹ¤ë 78 switch($_POST['convenience']) { 79 //¥»¥Ö¥ó¥¤¥ì¥Ö¥ó 80 case '1': 81 $cvs_type = '01'; 82 break; 83 //¥Õ¥¡¥ß¥ê¡¼¥Þ¡¼¥È 84 case '2': 85 $cvs_type = '03'; 86 break; 87 //¥µ¡¼¥¯¥ëK¥µ¥ó¥¯¥¹ 88 case '3': 89 $cvs_type = '04'; 90 break; 91 //¤½¤Î¾ 92 case '4': 93 case '5': 94 $cvs_type = '02'; 95 break; 96 default: 97 sfDispSiteError(PAGE_ERROR); 98 break; 99 } 54 // Àµ¾ï¤Ê¿ä°Ü¤Ç¤¢¤ë¤³¤È¤òµÏ¿¤·¤Æ¤ª¤¯ 55 $objSiteSess->setRegistFlag(); 100 56 101 //¥ê¥¯¥¨¥¹¥ÈÅÅʸ 102 $arrRequest = array( 103 // ¼è°ú ID 104 REQ_ORDER_ID => $uniqid, 105 // CVS¥¿¥¤¥× 106 REQ_CVS_TYPE => $cvs_type, 107 // ¶â³Û 108 REQ_AMOUNT => $arrPrice['payment_total'], 109 // »Ùʧ´ü¸Â 110 REQ_PAY_LIMIT => lfGetPayLimit(), 111 // »á̾¡ÊÃí°Õ¡§¥Ù¥ê¥È¥é¥ó¥¹¥³¥ó¥Ó¥Ë¥²¡¼¥È¥¦¥§¥¤¤Ï UTF-8 ¤Îʸ»ú¤Î¤ß¤ò 112 // ¼õ¤±ÉÕ¤±¤ë¤¿¤á¡¢¥²¡¼¥È¥¦¥§¥¤Àܳ¤ÎÁ°¤Ë UTF-8 ¥³¡¼¥É¤ØÊÑ´¹¡Ë 113 REQ_NAME1 => $objTran->jCode($arrData['order_name01'], ENCODE_UTF8), 114 REQ_NAME2 => $objTran->jCode($arrData['order_name02'], ENCODE_UTF8), 115 REQ_KANA => $objTran->jCode($arrData['order_kana01'].$arrData['order_kana02'], ENCODE_UTF8), 116 // ÅÅÏÃÈÖ¹æ 117 REQ_TEL_NO => $arrData['order_tel01']."-".$arrData['order_tel02']."-".$arrData['order_tel03'] 118 ); 57 // GET¥Ç¡¼¥¿¤òÊݸ 58 $arrVal["credit_result"] = $_GET["result"]; 59 $arrVal["memo01"] = 1; 60 $arrVal["memo03"] = $arrPayment[0]["module_id"]; 61 62 // ¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¥³¡¼¥É 63 $arrMemo["trans_code"] = array("name"=>"Epsilon¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¥³¡¼¥É", "value" => $_GET["trans_code"]); 64 $arrVal["memo02"] = serialize($arrMemo); 119 65 120 //¥Ù¥ê¥È¥é¥ó¥¹¥³¥ó¥Ó¥Ë¥²¡¼¥È¥¦¥§¥¤¤Ë¥ê¥¯¥¨¥¹¥ÈÅÅʸ¤òÅꤲ¡¢¼è°ú·ë²Ì¤ò³ÊǼ 121 $arrResult = $objTran->doTransaction(CMD_ENTRY, $arrRequest); 122 //¼è°úÀ®¸ù 123 if($arrResult[RES_ACTION_CODE] = '010') { 124 //¥³¥ó¥Ó¥Ë¤Î¼ïÎà 125 switch($_POST['convenience']) { 126 //¥»¥Ö¥ó¥¤¥ì¥Ö¥ó 127 case '1': 128 $arrRet['cv_type'] = '1'; //¥³¥ó¥Ó¥Ë¤Î¼ïÎà 129 $arrRet['cv_payment_url'] = $arrResult[RES_HARAIKOMI_URL]; //ʧ¹þɼURL(PC) 130 $arrRet['cv_receipt_no'] = $arrResult[RES_RECEIPT_NO]; //ʧ¹þɼÈÖ¹æ 131 break; 132 //¥Õ¥¡¥ß¥ê¡¼¥Þ¡¼¥È 133 case '2': 134 $company_code = substr($arrResult[RES_RECEIPT_NO], 0, 5); 135 $order_no = substr($arrResult[RES_RECEIPT_NO], 6, 12); 136 $arrRet['cv_type'] = '2'; //¥³¥ó¥Ó¥Ë¤Î¼ïÎà 137 $arrRet['cv_company_code'] = $company_code; //´ë¶È¥³¡¼¥É 138 $arrRet['cv_order_no'] = $order_no; //¼õÉÕÈÖ¹æ 139 break; 140 //¥µ¡¼¥¯¥ëK¥µ¥ó¥¯¥¹ 141 case '3': 142 $mobile_url = preg_replace("/https:\/\/.+?\/JLPcon/","https://w2.kessai.info/JLM/JLMcon", $arrResult[RES_HARAIKOMI_URL]); 143 $arrRet['cv_type'] = '3'; //¥³¥ó¥Ó¥Ë¤Î¼ïÎà 144 $arrRet['cv_payment_url'] = $arrResult[RES_HARAIKOMI_URL]; //ʧ¹þɼURL 145 $arrRet['cv_payment_mobile_url'] = $mobile_url; //ʧ¹þɼURL(¥â¥Ð¥¤¥ë) 146 break; 147 //¥í¡¼¥½¥ó¡¢¥»¥¤¥³¡¼¥Þ¡¼¥È 148 case '4': 149 $arrRet['cv_type'] = '4'; //¥³¥ó¥Ó¥Ë¤Î¼ïÎà 150 $arrRet['cv_receipt_no'] = $arrResult[RES_RECEIPT_NO]; //ʧ¹þɼÈÖ¹æ 151 break; 152 //¥ß¥Ë¥¹¥È¥Ã¥×¡¢¥Ç¥¤¥ê¡¼¥ä¥Þ¥¶¥¡¢¥ä¥Þ¥¶¥¥Ç¥¤¥ê¡¼¥¹¥È¥¢ 153 case '5': 154 $arrRet['cv_type'] = '5'; //¥³¥ó¥Ó¥Ë¤Î¼ïÎà 155 $arrRet['cv_payment_url'] = $arrResult[RES_HARAIKOMI_URL]; //ʧ¹þɼURL(PC) 156 break; 157 } 158 //»Ùʧ´ü¸Â 159 $arrRet['cv_payment_limit'] = lfGetPayLimit(); 160 //¥³¥ó¥Ó¥Ë·èºÑ¾ðÊó¤ò³ÊǼ 161 $sqlval['conveni_data'] = serialize($arrRet); 162 $objQuery = new SC_Query; 163 $objQuery->update("dtb_order_temp", $sqlval, "order_temp_id = ? ", array($uniqid)); 164 // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµÏ¿¤·¤Æ¤ª¤¯ 165 $objSiteSess->setRegistFlag(); 166 //¹ØÆþ´°Î»¥Ú¡¼¥¸¤Ø 167 header("Location: " . URL_SHOP_COMPLETE); 168 //¼ºÇÔ 169 } else { 170 $objPage->arrErr = '¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£'; 171 } 172 173 # ¥í¥°½ÐÎÏ(¤³¤³¤Þ¤Ç) 174 $logger->logprint('DEBUG', '<<< »Ùʧ·ë²Ì²èÌ̽èÍý½ªÎ». >>>'); 175 176 } 177 break; 178 //Ìá¤ë 179 case 'return': 180 // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµÏ¿¤·¤Æ¤ª¤¯ 181 $objSiteSess->setRegistFlag(); 182 // ³Îǧ¥Ú¡¼¥¸¤Ø°Üư 183 header("Location: " . URL_SHOP_CONFIRM); 184 exit; 185 break; 66 // ¼õÃí°ì»þ¥Æ¡¼¥Ö¥ë¤Ë¹¹¿· 67 sfRegistTempOrder($uniqid, $arrVal); 68 69 // ´°Î»²èÌÌ¤Ø 70 header("Location: " . URL_SHOP_COMPLETE); 186 71 } 187 72 188 $objView->assignobj($objPage); 189 $objView->display(SITE_FRAME); 73 // Á÷¿®¥Ç¡¼¥¿À¸À® 74 $arrData = array( 75 'contract_code' => $arrPayment[0]["memo01"], // ·ÀÌ󥳡¼¥É 76 'user_id' => $arrData["customer_id"], // ¥æ¡¼¥¶ID 77 'user_name' => $arrData["order_name01"].$arrData["order_name02"], // ¥æ¡¼¥¶Ì¾ 78 'user_mail_add' => $arrData["order_email"], // ¥á¡¼¥ë¥¢¥É¥ì¥¹ 79 'order_number' => $arrData["order_id"], // ¥ª¡¼¥À¡¼ÈÖ¹æ 80 'item_code' => $arrMainProduct["product_code"], // ¾¦ÉÊ¥³¡¼¥É(Âåɽ) 81 'item_name' => $arrMainProduct["name"], // ¾¦ÉÊ̾(Âåɽ) 82 'item_price' => $arrData["payment_total"], // ¾¦ÉʲÁ³Ê(Àǹþ¤ßÁí³Û) 83 'st_code' => $arrPayment[0]["memo04"], // ·èºÑ¶èʬ 84 'mission_code' => '1', // ²Ý¶â¶èʬ(¸ÇÄê) 85 'process_code' => '1', // ½èÍý¶èʬ(¸ÇÄê) 86 'xml' => '1', // ±þÅú·Á¼°(¸ÇÄê) 87 'memo1' => ECCUBE_PAYMENT, // ͽÈ÷01 88 'memo2' => '' // ͽÈ÷02 89 ); 190 90 191 //------------------------------------------------------------------------------------------------------------- 91 // ¥Ç¡¼¥¿Á÷¿® 92 sfPostPaymentData($order_url, $arrData); 192 93 193 //»Ùʧ´ü¸Â¤ÎÀ¸À® 194 function lfGetPayLimit() { 195 $date = sprintf("%10s", 196 date("Y/m/d",mktime(0,0,0,date("m"), 197 date("d")+CV_PAYMENT_LIMIT,date("Y")))); 198 return $date; 199 } 200 201 //¥Ñ¥é¥á¡¼¥¿¤Î½é´ü²½ 202 function lfInitParam() { 203 global $objFormParam; 204 $objFormParam->addParam("¥³¥ó¥Ó¥Ë¤Î¼ïÎà", "convenience", INT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK")); 205 } 206 207 // ÆþÎÏÆâÍÆ¤Î¥Á¥§¥Ã¥¯ 208 function lfCheckError() { 209 global $objFormParam; 210 // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£ 211 $arrRet = $objFormParam->getHashArray(); 212 $objErr = new SC_CheckError($arrRet); 213 $objErr->arrErr = $objFormParam->checkError(); 214 215 return $objErr->arrErr; 216 } 94 //--------------------------------------------------------------------------------------------------------------------------------------------------------- 217 95 218 96 ?>
Note: See TracChangeset
for help on using the changeset viewer.
