Changeset 16902 for branches/feature-module-gmo-pg/data
- Timestamp:
- 2007/12/07 11:45:23 (15 years ago)
- Location:
- branches/feature-module-gmo-pg/data/downloads/module/mdl_gmo-pg
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-gmo-pg/data/downloads/module/mdl_gmo-pg/gmo-pg_credit.php
r16844 r16902 7 7 require_once(MODULE_PATH . "mdl_gmo-pg/mdl_gmo-pg.inc"); 8 8 9 /* 10 11 »ÙʧÊýË¡¤òɽ¤¹¥³¡¼¥É 12 13 1¡§ °ì³çʧ¤¤ 14 2¡§ ʬ³äʧ¤¤ 15 3¡§ ¥Ü¡¼¥Ê¥¹°ì³çʧ¤¤ 16 4¡§ ¥Ü¡¼¥Ê¥¹Ê¬³äʧ¤¤ 17 5¡§ ¥ê¥Üʧ¤¤ 18 19 */ 20 21 $arrPayMethod = array( 22 '1-0' => "°ì³çʧ¤¤", 23 '2-3' => "ʬ³ä3²óʧ¤¤", 24 '2-6' => "ʬ³ä6²óʧ¤¤", 25 '2-10'=> "ʬ³ä10²óʧ¤¤", 26 '2-15'=> "ʬ³ä15²óʧ¤¤", 27 '2-20'=> "ʬ³ä20²óʧ¤¤", 28 '5-0' => "¥ê¥Üʧ¤¤" 29 ); 30 9 31 class LC_Page { 10 11 $this->tpl_css = '/css/layout/shopping/card.css'; 12 13 14 15 16 17 18 19 20 /**21 *session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç22 *¡ÖÌá¤ë¡×¥Ü¥¿¥ó»ÈÍÑ»þ¤Î͸ú´ü¸ÂÀÚ¤ìɽ¼¨¤òÍÞÀ©¤¹¤ë¡£23 *private-no-expire:¥¯¥é¥¤¥¢¥ó¥È¤Î¥¥ã¥Ã¥·¥å¤òµö²Ä¤¹¤ë¡£24 25 session_cache_limiter('private-no-expire'); 26 32 function LC_Page() { 33 /** ɬ¤º»ØÄꤹ¤ë **/ 34 $this->tpl_css = '/css/layout/shopping/card.css'; // ¥á¥¤¥óCSS¥Ñ¥¹ 35 if (GC_MobileUserAgent::isMobile()) { 36 $this->tpl_mainpage = MODULE_PATH . "mdl_gmo-pg/gmo-pg_credit_mobile.tpl"; 37 } else { 38 $this->tpl_mainpage = MODULE_PATH . "mdl_gmo-pg/gmo-pg_credit.tpl"; 39 } 40 global $arrPayMethod; 41 $this->arrPayMethod = $arrPayMethod; 42 /* 43 session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç 44 ¡ÖÌá¤ë¡×¥Ü¥¿¥ó»ÈÍÑ»þ¤Î͸ú´ü¸ÂÀÚ¤ìɽ¼¨¤òÍÞÀ©¤¹¤ë¡£ 45 private-no-expire:¥¯¥é¥¤¥¢¥ó¥È¤Î¥¥ã¥Ã¥·¥å¤òµö²Ä¤¹¤ë¡£ 46 */ 47 session_cache_limiter('private-no-expire'); 48 } 27 49 } 28 50 29 51 $objPage = new LC_Page(); 30 $objView = GC_MobileUserAgent::isMobile() ? new SC_MobileView() : new SC_SiteView();52 $objView = (GC_MobileUserAgent::isMobile()) ? new SC_MobileView() : new SC_SiteView(); 31 53 $objSiteSess = new SC_SiteSession(); 32 54 $objCartSess = new SC_CartSession(); 33 $arrInfo = sf_getBasisData(); 34 $arrGMOConf = sfGetPaymentDB(); 55 $objSiteInfo = $objView->objSiteInfo; 56 $arrInfo = $objSiteInfo->data; 57 58 // ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹ 59 $objFormParam = new SC_FormParam(); 60 // ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ 61 lfInitParam(); 62 // POSTÃͤμèÆÀ 63 $objFormParam->setParam($_POST); 35 64 36 65 // ¥¢¥¯¥»¥¹¤ÎÀµÅöÀ¤ÎȽÄê 37 66 $uniqid = sfCheckNormalAccess($objSiteSess, $objCartSess); 38 67 39 // ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹ 40 $objFormParam = lfInitParam(); 41 42 switch(lfGetMode()) { 43 // ¡Ö¼¡¤Ø¡×¥Ü¥¿¥ó²¡²¼»þ 68 switch($_POST['mode']) { 69 // ÅÐÏ¿ 44 70 case 'regist': 45 gfPrintLog('### GMO PG MODULE Start ###', GMO_LOG_PATH); 46 // ÆþÎÏÃͤÎÊÑ´¹ 47 $objFormParam->convParam(); 48 $arrErr = $objFormParam->checkError(); 49 50 // ÆþÎÏ¥¨¥é¡¼¤ÎȽÄê 51 if (!empty($arrErr)) { 52 $objPage->arrErr = $arrErr; 53 break; 54 } 55 56 // ¥«¡¼¥È½¸·×½èÍý 57 $objPage = sfTotalCart($objPage, $objCartSess, $arrInfo); 58 // °ì»þ¼õÃí¥Æ¡¼¥Ö¥ë¤ÎÆÉ¹þ 59 $arrData = sfGetOrderTemp($uniqid); 60 // ¥«¡¼¥È½¸·×¤ò¸µ¤ËºÇ½ª·×»» 61 $arrData = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo); 62 // POST¥Ç¡¼¥¿¤ò¼èÆÀ 63 $arrVal = $objFormParam->getHashArray(); 64 65 // ¥¨¥é¡¼¥Õ¥é¥° 66 $err_flg = false; 67 // ÄÌ¿®¥¨¥é¡¼¤ÎȽÄê 68 $access_err = false; 69 // ŹÊÞ¾ðÊ󥨥顼¤ÎȽÄê 70 $credit_err = false; 71 // ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸ 72 $gmo_err_msg = ""; 73 74 // ¥¢¥¯¥»¥¹ID¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢EntryTrain¤Ø¥ê¥¯¥¨¥¹¥È¤òÁ÷¿®¤¹¤ë 75 if(empty($_SESSION['GMO']['ACCESS_ID'])) { 76 gfPrintLog('-> EntryTrain Start.', GMO_LOG_PATH); 77 // ŹÊÞ¾ðÊó¤ÎÁ÷¿® 78 $arrEntryRet = lfSendGMOEntry($arrData['order_id'], $arrData['payment_total']); 79 if (empty($arrEntryRet)) { 80 gfPrintLog('-> EntryTrain failed. access error.', GMO_LOG_PATH); 81 $access_err = true; 82 } 83 84 // ŹÊÞ¾ðÊ󥨥顼¤ÎȽÄê 85 if ($arrEntryRet['ERR_CODE'] == '0' && $arrEntryRet['ERR_INFO'] == 'OK') { 86 gfPrintLog('-> EntryTrain success.', GMO_LOG_PATH); 87 $_SESSION['GMO']['ACCESS_ID'] = $arrEntryRet['ACCESS_ID']; 88 $_SESSION['GMO']['ACCESS_PASS'] = $arrEntryRet['ACCESS_PASS']; 89 } else { 90 gfPrintLog('-> EntryTrain failed. credit error.', GMO_LOG_PATH); 91 unset($_SESSION['GMO']['ACCESS_ID']); 92 unset($_SESSION['GMO']['ACCESS_PASS']); 93 $credit_err = true; 94 $detail_code01 = substr($arrEntryRet['ERR_INFO'], 0, 5); 95 $detail_code02 = substr($arrEntryRet['ERR_INFO'], 5, 4); 96 $gmo_err_msg = $detail_code01 . "-" . $detail_code02; 97 } 98 } 99 100 // EntryTrain¤Ç¥¨¥é¡¼¤Ê¤·¤Î¾ì¹ç¤ÏExecTrain¤ò¼Â¹Ô¤¹¤ë 101 if(!$access_err && !$credit_err) { 102 gfPrintLog('-> ACESS_ID check Start.', GMO_LOG_PATH); 103 // ŹÊÞ¾ðÊóÁ÷¿®·ë²Ì 104 $sqlval['memo04'] = $arrEntryRet['ERR_CODE']; 105 $sqlval['memo05'] = $arrEntryRet['ERR_INFO']; 106 107 // ŹÊÞ¾ðÊ󥨥顼¤ÎȽÄê 108 if(!empty($_SESSION['GMO']['ACCESS_ID']) && !empty($_SESSION['GMO']['ACCESS_PASS'])) { 109 gfPrintLog('-> ACESS_ID check OK.', GMO_LOG_PATH); 110 gfPrintLog('-> ExecTrain Start.', GMO_LOG_PATH); 111 // ·èºÑ¾ðÊó¤ÎÁ÷¿® 112 $arrExecRet = lfSendGMOExec( 113 $_SESSION['GMO']['ACCESS_ID'], 114 $_SESSION['GMO']['ACCESS_PASS'], 115 $arrData['order_id'], 116 $arrVal['card_no01'], 117 $arrVal['card_no02'], 118 $arrVal['card_no03'], 119 $arrVal['card_no04'], 120 $arrVal['card_month'], 121 $arrVal['card_year'], 122 $arrVal['paymethod'] 123 ); 124 if (empty($arrExecRet)) { 125 gfPrintLog('-> ExecTrain failed. access error.', GMO_LOG_PATH); 126 $access_err = true; 127 } else { 128 gfPrintLog('-> ExecTrain success.', GMO_LOG_PATH); 129 } 130 } else { 131 gfPrintLog('-> ACESS_ID check failed.', GMO_LOG_PATH); 132 } 133 } 134 135 // ExecTrain¤ÇÄÌ¿®¥¨¥é¡¼¤Ê¤·¤Î¾ì¹ç 136 if (!$access_err && !$credit_err) { 137 // 3D¥»¥¥å¥¢¤¬Í¸ú¤Ê¾ì¹ç¤Ï¥ê¥À¥¤¥ì¥¯¥È¥Ú¡¼¥¸¤ò½ÐÎϤ¹¤ë 138 if (isset($arrGMOConf[0]['gmo_3d']) && $arrGMOConf[0]['gmo_3d'] == '1') { 139 gfPrintLog('-> 3D secure is enable.', GMO_LOG_PATH); 140 $objPage->tpl_onload = 'OnLoadEvent();'; 141 // TODO mobile 142 $objPage->tpl_mainpage = MODULE_PATH . "mdl_gmo-pg/gmo-pg-3d.tpl"; 143 $objPage->ACSUrl = $arrExecRet['ACSUrl']; 144 $objPage->PaReq = $arrExecRet['PaReq'];; 145 $objPage->TermUrl = GMO_RETURL; 146 $objPage->MD = $arrExecRet['MD']; 147 break; 148 149 // 3D¥»¥¥å¥¢Ìµ¸ú»þ¤Ï¡¢¥¨¥é¡¼¥Á¥§¥Ã¥¯¡¦¹ØÆþ´°Î»¥Ú¡¼¥¸¤Ø¥ê¥À¥¤¥ì¥¯¥È 150 } else { 151 gfPrintLog('-> 3D secure is not enable.', GMO_LOG_PATH); 152 // ÄɲþðÊó¤Ï¤Ê¤¤¤¿¤á¥À¥ß¡¼¥Ç¡¼¥¿¤ò³ÊǼ 153 $sqlval['memo02'] = serialize(array()); 154 // ±þÅúÆâÍÆ¤ÎµÏ¿ 155 $sqlval['memo03'] = $arrVal['card_name01'] . " " . $arrVal['card_name02']; 156 // ·èºÑ¾ðÊóÁ÷¿®·ë²Ì 157 $sqlval['memo06'] = $arrExecRet['ErrType']; 158 $sqlval['memo07'] = $arrExecRet['ErrInfo']; 159 160 $objQuery = new SC_Query(); 161 $objQuery->update("dtb_order_temp", $sqlval, "order_temp_id = ?", array($uniqid)); 162 163 // Í¿¿®½èÍýÀ®¸ù¤Î¾ì¹ç 164 if($arrExecRet['Html'] == "Receipt" && empty($arrExecRet['ErrType']) && empty($arrExecRet['ErrInfo'])) { 165 gfPrintLog('-> ExecTrain results success.', GMO_LOG_PATH); 166 // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµÏ¿¤·¤Æ¤ª¤¯ 167 $objSiteSess->setRegistFlag(); 168 // ¥¢¥¯¥»¥¹ID¤ò¥¯¥ê¥¢¤¹¤ë¡£ 169 unset($_SESSION['GMO']['ACCESS_ID']); 170 unset($_SESSION['GMO']['ACCESS_PASS']); 171 // ½èÍý´°Î»¥Ú¡¼¥¸¤Ø 172 if (GC_MobileUserAgent::isMobile()) { 173 header("Location: " . gfAddSessionId(URL_SHOP_COMPLETE)); 174 } else { 175 header("Location: " . URL_SHOP_COMPLETE); 176 } 177 } else { 178 gfPrintLog('-> ExecTrain results error.', GMO_LOG_PATH); 179 $credit_err = true; 180 $detail_code01 = substr($arrExecRet['ErrInfo'], 0, 5); 181 $detail_code02 = substr($arrExecRet['ErrInfo'], 5, 4); 182 $gmo_err_msg = $detail_code01 . "-" . $detail_code02; 183 } 184 } 185 } 186 187 if($access_err || $credit_err) { 188 if ($access_err) { 189 $objPage->tpl_error = "¢¨ ¥¯¥ì¥¸¥Ã¥È¾µÇ§¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡§ÄÌ¿®¥¨¥é¡¼"; 190 } else { 191 if (!empty($gmo_err_msg)) { 192 $objPage->tpl_error = "¢¨ ¥¯¥ì¥¸¥Ã¥È¾µÇ§¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡§" . $gmo_err_msg; 193 } else { 194 $objPage->tpl_error = "¢¨ ¥¯¥ì¥¸¥Ã¥È¾µÇ§¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡§ÉÔÌÀ¤Ê¥¨¥é¡¼"; 195 } 196 } 197 } 198 199 break; 200 201 // 3Dǧ¾Ú·ë²Ì¤ò¼õ¤±¼è¤ë 202 case '3dVerify': 203 gfPrintLog('-> 3D secure Post param check start.', GMO_LOG_PATH); 204 if (PEAR::isError($e = lfValidate3dVerify())) { 205 $objPage->tpl_error = $e->getMessage(); 206 gfPrintLog('-> 3D secure Post param check error.', GMO_LOG_PATH); 207 break; 208 } 209 gfPrintLog('-> 3D secure Post param check success.', GMO_LOG_PATH); 210 gfPrintLog('-> 3dVerify start.', GMO_LOG_PATH); 211 $arr3dRet = lfSend3dVerify(); 212 213 if (PEAR::isError($e = lf3dVerifyIsSuccess($arr3dRet))) { 214 gfPrintLog('-> 3dVerify failed. ' . $e->getMessage(), GMO_LOG_PATH); 215 $objPage->tpl_error = $e->getMessage(); 216 break; 217 } 218 gfPrintLog('-> 3dVerify success.', GMO_LOG_PATH); 219 220 // ÄɲþðÊó¤Ï¤Ê¤¤¤¿¤á¥À¥ß¡¼¥Ç¡¼¥¿¤ò³ÊǼ 221 $sqlval['memo02'] = serialize(array()); 222 223 // ·èºÑ¾ðÊóÁ÷¿®·ë²Ì 224 $sqlval['memo06'] = $arr3dRet['ErrType']; 225 $sqlval['memo07'] = $arr3dRet['ErrInfo']; 226 227 $objQuery = new SC_Query(); 228 $objQuery->update("dtb_order_temp", $sqlval, "order_temp_id = ?", array($uniqid)); 229 230 // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµÏ¿¤·¤Æ¤ª¤¯ 231 $objSiteSess->setRegistFlag(); 232 // ¥¢¥¯¥»¥¹ID¤ò¥¯¥ê¥¢¤¹¤ë¡£ 233 unset($_SESSION['GMO']['ACCESS_ID']); 234 unset($_SESSION['GMO']['ACCESS_PASS']); 235 // ½èÍý´°Î»¥Ú¡¼¥¸¤Ø 236 if (GC_MobileUserAgent::isMobile()) { 237 header("Location: " . gfAddSessionId(URL_SHOP_COMPLETE)); 238 } else { 239 header("Location: " . URL_SHOP_COMPLETE); 240 } 241 242 break; 243 244 // ³Îǧ¥Ú¡¼¥¸¤ËÌá¤ë 71 // ÆþÎÏÃͤÎÊÑ´¹ 72 $objFormParam->convParam(); 73 $objPage->arrErr = lfCheckError($arrRet); 74 75 // ÆþÎÏ¥¨¥é¡¼¤Ê¤·¤Î¾ì¹ç 76 if(count($objPage->arrErr) == 0) { 77 // ¥¨¥é¡¼¥Õ¥é¥° 78 $err_flg = false; 79 80 // ¥«¡¼¥È½¸·×½èÍý 81 $objPage = sfTotalCart($objPage, $objCartSess, $arrInfo); 82 // °ì»þ¼õÃí¥Æ¡¼¥Ö¥ë¤ÎÆÉ¹þ 83 $arrData = sfGetOrderTemp($uniqid); 84 // ¥«¡¼¥È½¸·×¤ò¸µ¤ËºÇ½ª·×»» 85 $arrData = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo); 86 // ¥«¡¼¥É¤Îǧ¾Ú¤ò¹Ô¤¦ 87 $arrVal = $objFormParam->getHashArray(); 88 89 // ÄÌ¿®¥¨¥é¡¼¤ÎȽÄê 90 $access_err = false; 91 // ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸ 92 $credit_err = false; 93 $gmo_err_msg = ""; 94 95 // ¥¢¥¯¥»¥¹ID¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç 96 if($_SESSION['GMO']['ACCESS_ID'] == "") { 97 // ŹÊÞ¾ðÊó¤ÎÁ÷¿® 98 $arrEntryRet = lfSendGMOEntry($arrData['order_id'], $arrData['payment_total']); 99 if($arrEntryRet == NULL) { 100 $access_err = true; 101 } 102 103 // ŹÊÞ¾ðÊ󥨥顼¤ÎȽÄê 104 if($arrEntryRet['ERR_CODE'] == '0' && $arrEntryRet['ERR_INFO'] == 'OK') { 105 $_SESSION['GMO']['ACCESS_ID'] = $arrEntryRet['ACCESS_ID']; 106 $_SESSION['GMO']['ACCESS_PASS'] = $arrEntryRet['ACCESS_PASS']; 107 } else { 108 $_SESSION['GMO']['ACCESS_ID'] = ""; 109 $_SESSION['GMO']['ACCESS_PASS'] = ""; 110 $credit_err = true; 111 $detail_code01 = substr($arrEntryRet['ERR_INFO'], 0, 5); 112 $detail_code02 = substr($arrEntryRet['ERR_INFO'], 5, 4); 113 $gmo_err_msg = $detail_code01 . "-" . $detail_code02; 114 } 115 } 116 117 // ¥¨¥é¡¼¤Ê¤·¤Î¾ì¹ç 118 if(!$access_err && !$credit_err) { 119 // ŹÊÞ¾ðÊóÁ÷¿®·ë²Ì 120 $sqlval['memo04'] = $arrEntryRet['ERR_CODE']; 121 $sqlval['memo05'] = $arrEntryRet['ERR_INFO']; 122 123 // ŹÊÞ¾ðÊ󥨥顼¤ÎȽÄê 124 if($_SESSION['GMO']['ACCESS_ID'] != "" && $_SESSION['GMO']['ACCESS_PASS'] != "" ) { 125 // ·èºÑ¾ðÊó¤ÎÁ÷¿® 126 $arrExecRet = lfSendGMOExec($_SESSION['GMO']['ACCESS_ID'], $_SESSION['GMO']['ACCESS_PASS'], $arrData['order_id'], $arrVal['card_no01'], $arrVal['card_no02'], $arrVal['card_no03'], $arrVal['card_no04'], $arrVal['card_month'], $arrVal['card_year'], $arrVal['paymethod']); 127 if($arrExecRet == NULL) { 128 $access_err = true; 129 } 130 } 131 } 132 133 // ¥¨¥é¡¼¤Ê¤·¤Î¾ì¹ç 134 if(!$access_err && !$credit_err) { 135 // ÄɲþðÊó¤Ï¤Ê¤¤¤¿¤á¥À¥ß¡¼¥Ç¡¼¥¿¤ò³ÊǼ 136 $sqlval['memo02'] = serialize(array()); 137 138 // ±þÅúÆâÍÆ¤ÎµÏ¿ 139 $sqlval['memo03'] = $arrVal['card_name01'] . " " . $arrVal['card_name02']; 140 141 // ·èºÑ¾ðÊóÁ÷¿®·ë²Ì 142 $sqlval['memo06'] = $arrExecRet['ErrType']; 143 $sqlval['memo07'] = $arrExecRet['ErrInfo']; 144 145 $objQuery = new SC_Query(); 146 $objQuery->update("dtb_order_temp", $sqlval, "order_temp_id = ?", array($uniqid)); 147 148 // Í¿¿®½èÍýÀ®¸ù¤Î¾ì¹ç 149 if($arrExecRet['Html'] == "Receipt" && $arrExecRet['ErrType'] == "" && $arrExecRet['ErrInfo'] == "") { 150 // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµÏ¿¤·¤Æ¤ª¤¯ 151 $objSiteSess->setRegistFlag(); 152 // ¥¢¥¯¥»¥¹ID¤ò¥¯¥ê¥¢¤¹¤ë¡£ 153 $_SESSION['GMO']['ACCESS_ID'] = ""; 154 $_SESSION['GMO']['ACCESS_PASS'] = ""; 155 // ½èÍý´°Î»¥Ú¡¼¥¸¤Ø 156 if (GC_MobileUserAgent::isMobile()) { 157 header("Location: " . gfAddSessionId(URL_SHOP_COMPLETE)); 158 } else { 159 header("Location: " . URL_SHOP_COMPLETE); 160 } 161 } else { 162 $credit_err = true; 163 $detail_code01 = substr($arrExecRet['ErrInfo'], 0, 5); 164 $detail_code02 = substr($arrExecRet['ErrInfo'], 5, 4); 165 $gmo_err_msg = $detail_code01 . "-" . $detail_code02; 166 } 167 } 168 169 if($access_err || $credit_err) { 170 if($access_err) { 171 $objPage->tpl_error = "¢¨ ¥¯¥ì¥¸¥Ã¥È¾µÇ§¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡§ÄÌ¿®¥¨¥é¡¼"; 172 } else { 173 if($gmo_err_msg != "") { 174 $objPage->tpl_error = "¢¨ ¥¯¥ì¥¸¥Ã¥È¾µÇ§¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡§".$gmo_err_msg; 175 } else { 176 $objPage->tpl_error = "¢¨ ¥¯¥ì¥¸¥Ã¥È¾µÇ§¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡§ÉÔÌÀ¤Ê¥¨¥é¡¼"; 177 } 178 } 179 } 180 } 181 break; 182 // Á°¤Î¥Ú¡¼¥¸¤ËÌá¤ë 245 183 case 'return': 246 // Àµ¾ï¤Ê¿ä°Ü¤Ç¤¢¤ë¤³¤È¤òµÏ¿¤·¤Æ¤ª¤¯ 247 $objSiteSess->setRegistFlag(); 248 header("Location: " . URL_SHOP_CONFIRM); 249 exit; 250 184 // Àµ¾ï¤Ê¿ä°Ü¤Ç¤¢¤ë¤³¤È¤òµÏ¿¤·¤Æ¤ª¤¯ 185 $objSiteSess->setRegistFlag(); 186 header("Location: " . URL_SHOP_CONFIRM); 187 exit; 251 188 default: 252 break; 189 190 break; 253 191 } 254 192 … … 266 204 $objView->assignobj($objPage); 267 205 $objView->display(SITE_FRAME); 268 269 /** 270 * mode¤ò¼èÆÀ¤¹¤ë. 271 * 272 * @retrun string 273 */ 274 function lfGetMode() { 275 $mode = ''; 276 277 if (isset($_POST['PaRes']) && isset($_POST['MD'])) { 278 $mode = '3dVerify'; 279 } elseif (isset($_POST['mode'])) { 280 $mode = $_POST['mode']; 281 } 282 283 return $mode; 284 } 285 286 /** 287 * ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ 288 * 289 * @return SC_FormParam 290 */ 206 //----------------------------------------------------------------------------------------------------------------------------------- 207 /* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */ 291 208 function lfInitParam() { 292 $objFormParam = new SC_FormParam();293 294 295 296 297 298 299 300 301 302 303 $objFormParam->setParam($_POST); 304 305 return $objFormParam; 306 } 307 308 /** 309 * ¼õÃí¾ðÊó¤òÅÐÏ¿¤¹¤ë. 310 * 311 * @param integer $order_id 312 * @param integer $amount 313 * @param integer $tax 314 * @return array 315 */ 209 global $objFormParam; 210 $objFormParam->addParam("¥«¡¼¥ÉÈÖ¹æ1", "card_no01", CREDIT_NO_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK")); 211 $objFormParam->addParam("¥«¡¼¥ÉÈÖ¹æ2", "card_no02", CREDIT_NO_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK")); 212 $objFormParam->addParam("¥«¡¼¥ÉÈÖ¹æ3", "card_no03", CREDIT_NO_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK")); 213 $objFormParam->addParam("¥«¡¼¥ÉÈÖ¹æ4", "card_no04", CREDIT_NO_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "NUM_CHECK")); 214 $objFormParam->addParam("¥«¡¼¥É´ü¸Âǯ", "card_year", 2, "n", array("EXIST_CHECK", "NUM_COUNT_CHECK", "NUM_CHECK")); 215 $objFormParam->addParam("¥«¡¼¥É´ü¸Â·î", "card_month", 2, "n", array("EXIST_CHECK", "NUM_COUNT_CHECK", "NUM_CHECK")); 216 $objFormParam->addParam("À«", "card_name01", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "ALPHA_CHECK")); 217 $objFormParam->addParam("̾", "card_name02", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK", "ALPHA_CHECK")); 218 $objFormParam->addParam("»ÙʧÊýË¡", "paymethod", STEXT_LEN, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK")); 219 } 220 221 /* ÆþÎÏÆâÍÆ¤Î¥Á¥§¥Ã¥¯ */ 222 function lfCheckError() { 223 global $objFormParam; 224 // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£ 225 $arrRet = $objFormParam->getHashArray(); 226 $objErr = new SC_CheckError($arrRet); 227 $objErr->arrErr = $objFormParam->checkError(); 228 229 return $objErr->arrErr; 230 } 231 232 // ŹÊÞ¾ðÊó¤ÎÁ÷¿® 316 233 function lfSendGMOEntry($order_id, $amount, $tax = 0) { 317 $arrGMOConf = sfGetPaymentDB(); 318 319 $TdTenantName = ''; 320 // 3D¥»¥¥å¥¢¤¬Í¸ú¤Ê¾ì¹ç¤Ï¡¢Å¹ÊÞ̾¤òÀßÄꤹ¤ë 321 if (!empty($arrGMOConf[0]['gmo_3d'])) { 322 $arrSiteInfo = sf_getBasisData(); 323 $TdTenantName = base64_encode($arrSiteInfo['shop_name']); 324 } 325 326 $arrSendData = array( 327 'OrderId' => $order_id, // ŹÊÞ¤´¤È¤Ë°ì°Õ¤ÊÃíʸID¤òÁ÷¿®¤¹¤ë¡£ 328 'TdTenantName' => $TdTenantName, // 3Dǧ¾Ú»þɽ¼¨ÍÑŹÊÞ̾ 329 'TdFlag' => $arrGMOConf[0]['gmo_3d'], // 3D¥Õ¥é¥° 330 'ShopId' => $arrGMOConf[0]['gmo_shopid'], // ¥·¥ç¥Ã¥×ID 331 'ShopPass' => $arrGMOConf[0]['gmo_shoppass'],// ¥·¥ç¥Ã¥×¥Ñ¥¹¥ï¡¼¥É 332 'Currency' => 'JPN', // Ä̲ߥ³¡¼¥É 333 'Amount' => $amount, // ¶â³Û 334 'Tax' => $tax, // ¾ÃÈñÀÇ 335 'JobCd' => 'AUTH', // ½èÍý¶èʬ 336 'TenantNo' => $arrGMOConf[0]['gmo_tenantno'],// ŹÊÞID¤òÁ÷¿®¤¹¤ë¡£ 337 ); 338 gfPrintLog('EntryTrain Request', GMO_LOG_PATH); 339 gfPrintLog(print_r($arrSendData, true), GMO_LOG_PATH); 340 $req = new HTTP_Request(GMO_ENTRY_URL); 341 $req->setMethod(HTTP_REQUEST_METHOD_POST); 342 $req->addPostDataArray($arrSendData); 343 344 if (!PEAR::isError($req->sendRequest())) { 345 $respBody = $req->getResponseBody(); 346 } 347 gfPrintLog('EntryTrain Response', GMO_LOG_PATH); 348 gfPrintLog(print_r(lfGetPostArray($respBody), true), GMO_LOG_PATH); 349 return lfGetPostArray($respBody); 350 } 351 352 /** 353 * ·èºÑ¤Î¼Â¹Ô 354 * 355 * @param string $access_id 356 * @param string $access_pass 357 * @param integer $order_id 358 * @param integer $cardno1 359 * @param integer $cardno2 360 * @param integer $cardno3 361 * @param integer $cardno4 362 * @param integer $ex_mm 363 * @param integer $ex_yy 364 * @param integer $paymethod 365 * @return array 366 */ 234 235 $arrRet = sfGetPaymentDB(); 236 237 $arrData = array( 238 'OrderId' => $order_id, // ŹÊÞ¤´¤È¤Ë°ì°Õ¤ÊÃíʸID¤òÁ÷¿®¤¹¤ë¡£ 239 'TdTenantName' => '', // 3Dǧ¾Ú»þɽ¼¨ÍÑŹÊÞ̾ 240 'TdFlag' => '', // 3D¥Õ¥é¥° 241 'ShopId' => $arrRet[0]['gmo_shopid'], // ¥·¥ç¥Ã¥×ID 242 'ShopPass' => $arrRet[0]['gmo_shoppass'], // ¥·¥ç¥Ã¥×¥Ñ¥¹¥ï¡¼¥É 243 'Currency' => 'JPN', // Ä̲ߥ³¡¼¥É 244 'Amount' => $amount, // ¶â³Û 245 'Tax' => $tax, // ¾ÃÈñÀÇ 246 'JobCd' => 'AUTH', // ½èÍý¶èʬ 247 'TenantNo' => $arrRet[0]['gmo_tenantno'], // ŹÊÞID¤òÁ÷¿®¤¹¤ë¡£ 248 ); 249 250 $req = new HTTP_Request(GMO_ENTRY_URL); 251 $req->setMethod(HTTP_REQUEST_METHOD_POST); 252 $req->addPostDataArray($arrData); 253 254 if (!PEAR::isError($req->sendRequest())) { 255 $response = $req->getResponseBody(); 256 } 257 $req->clearPostData(); 258 $arrRet = lfGetPostArray($response); 259 260 return $arrRet; 261 } 262 367 263 function lfSendGMOExec($access_id, $access_pass, $order_id, $cardno1, $cardno2, $cardno3, $cardno4, $ex_mm, $ex_yy, $paymethod) { 368 369 // »ÙʧÊýË¡¡¢²ó¿ô¤Î¼èÆÀ 370 list($method, $paytimes) = split("-", $paymethod); 371 372 if(!($paytimes > 0)) { 373 $paytimes = ""; 374 } 375 376 $arrData = array( 377 'AccessId' => $access_id, 378 'AccessPass' => $access_pass, 379 'OrderId' => $order_id, 380 'RetURL' => GMO_RETURL, 381 'CardType' => 'VISA, 11111, 111111111111111111111111111111111111, 1111111111', 382 'Method' => $method, 383 'PayTimes' => $paytimes, 384 'CardNo' => $cardno1 . $cardno2 . $cardno3 . $cardno4, 385 //'CardNo1' => $cardno1, 386 //'CardNo2' => $cardno2, 387 //'CardNo3' => $cardno3, 388 //'CardNo4' => $cardno4, 389 'ExpireYYMM' => $ex_yy . $ex_mm , 390 //'ExpireYY' => $ex_yy, 391 'ClientFieldFlag' => '1', 392 'ClientField1' => 'f1', 393 'ClientField2' => 'f2', 394 'ClientField3' => 'f3', 395 'ModiFlag' => '1', 396 'HTTP_ACCEPT' => $_SERVER['HTTP_ACCEPT'], 397 'HTTP_USER_AGENT' => $_SERVER['HTTP_USER_AGENT'] 398 ); 399 gfPrintLog('ExecTrain Request', GMO_LOG_PATH); 400 gfPrintLog(print_r($arrData, true), GMO_LOG_PATH); 401 $req = new HTTP_Request(GMO_EXEC_URL); 402 $req->setMethod(HTTP_REQUEST_METHOD_POST); 403 404 $req->addPostDataArray($arrData); 405 406 if (!PEAR::isError($req->sendRequest())) { 407 $response = $req->getResponseBody(); 408 } 409 410 $arrRet = lfParseExecResponse($response); 411 gfPrintLog('ExecTrain Response', GMO_LOG_PATH); 412 gfPrintLog(print_r($arrRet, true), GMO_LOG_PATH); 413 gfPrintLog($response, GMO_LOG_PATH); 414 return $arrRet; 264 265 // »ÙʧÊýË¡¡¢²ó¿ô¤Î¼èÆÀ 266 list($method, $paytimes) = split("-", $paymethod); 267 268 if(!($paytimes > 0)) { 269 $paytimes = ""; 270 } 271 272 $arrData = array( 273 'AccessId' => $access_id, 274 'AccessPass' => $access_pass, 275 'OrderId' => $order_id, 276 'RetURL' => GMO_RETURL, 277 // ¥×¥í¥Ñ¡¼¥«¡¼¥É¤ò°·¤ï¤Ê¤¤¾ì¹ç¤ÏVISA¸ÇÄê¤ÇOK 278 'CardType' => 'VISA, 11111, 111111111111111111111111111111111111, 1111111111', 279 // »Ùʧ¤¤ÊýË¡ 280 /* 281 1:°ì³ç 282 2:ʬ³ä 283 3:¥Ü¡¼¥Ê¥¹°ì³ç 284 4:¥Ü¡¼¥Ê¥¹Ê¬³ä 285 5:¥ê¥Üʧ¤¤ 286 */ 287 'Method' => $method, 288 // »Ùʧ²ó¿ô 289 'PayTimes' => $paytimes, 290 // ¥«¡¼¥ÉÈÖ¹æ 291 /* 292 »î¸³ÍÑ¥«¡¼¥ÉÈÖ¹æ¤Ï¡¢4111-1111-1111-1111 293 */ 294 'CardNo1' => $cardno1, 295 'CardNo2' => $cardno2, 296 'CardNo3' => $cardno3, 297 'CardNo4' => $cardno4, 298 'ExpireMM' => $ex_mm, 299 'ExpireYY' => $ex_yy, 300 // ²ÃÌÁʼ«Í³¹àÌÜÊֵѥե饰 301 'ClientFieldFlag' => '1', 302 'ClientField1' => 'f1', 303 'ClientField2' => 'f2', 304 'ClientField3' => 'f3', 305 // ¥ê¥À¥¤¥ì¥¯¥È¥Ú¡¼¥¸¤Ç¤Î±þÅú¤ò¼õ¤±¼è¤é¤Ê¤¤ 306 /* 307 0: HTML ¥ê¥À¥¤¥ì¥¯¥È¥Ú¡¼¥¸¡ÊDefault ÃÍ¡Ë 308 1: ¥Æ¥¥¹¥È 309 */ 310 'ModiFlag' => '1', 311 ); 312 313 $req = new HTTP_Request(GMO_EXEC_URL); 314 $req->setMethod(HTTP_REQUEST_METHOD_POST); 315 316 $req->addPostDataArray($arrData); 317 318 if (!PEAR::isError($req->sendRequest())) { 319 $response = $req->getResponseBody(); 320 } 321 $req->clearPostData(); 322 323 $arrRet = lfGetPostArray($response); 324 325 return $arrRet; 415 326 } 416 327 417 328 function lfGetPostArray($text) { 418 $arrRet = array(); 419 if($text != "") { 420 $text = ereg_replace("[\n\r]", "", $text); 421 $arrTemp = split("&", $text); 422 foreach($arrTemp as $ret) { 423 list($key, $val) = split("=", $ret); 424 $arrRet[$key] = $val; 425 } 426 } 427 return $arrRet; 428 } 429 430 function lfParseExecResponse($queryString) { 431 // 3D¥»¥¥å¥¢¤Ç¤Ê¤¤¾ì¹ç¤ÏlfGetPostArray()¤Çparse¤¹¤ë 432 if (!lfEnable3D()) { 433 return lfGetPostArray($queryString); 434 } 435 436 $arrRet = array(); 437 // 3D¥»¥¥å¥¢¤ò»ÈÍѤ¹¤ë¾ì¹ç¤ÏÀµµ¬É½¸½¤Ç¡£ 438 if (!empty($queryString)) { 439 $queryString = trim($queryString); 440 $regex = '|^ACSUrl\=(.+?)&PaReq\=(.+?)&MD\=(.+?)$|'; 441 $ret = preg_match_all($regex, $queryString, $matches); 442 443 gfPrintLog(print_r($matches, true), GMO_LOG_PATH); 444 445 if ($ret !== false && $ret > 0) { 446 gfPrintLog('REG STATUS:' . $ret, GMO_LOG_PATH); 447 $arrRet['ACSUrl'] = $matches[1][0]; 448 $arrRet['PaReq'] = $matches[2][0]; 449 $arrRet['MD'] = $matches[3][0]; 450 } else { 451 gfPrintLog(' STATUS:Failed', GMO_LOG_PATH); 452 } 453 } 454 455 return $arrRet; 456 } 457 458 459 /** 460 * 3D¥Ù¥ê¥Õ¥¡¥¤»þ¤Î¥ê¥¯¥¨¥¹¥È¥Ñ¥é¥á¡¼¥¿¤ò¸¡¾Ú¤¹¤ë 461 * 462 * @return array 463 */ 464 function lfValidate3dVerify() { 465 466 } 467 /** 468 * 3D¥Ù¥ê¥Õ¥¡¥¤¤ò¼Â¹Ô¤¹¤ë 469 * 470 * @return array 471 */ 472 function lfSend3dVerify() { 473 $arrSendData = array( 474 'PaRes' => $_POST['PaRes'], 475 'MD' => $_POST['MD'] 476 ); 477 $objReq =& new HTTP_Request(GMO_3D_URL); 478 $objReq->setMethod('POST'); 479 $objReq->addPostDataArray($arrSendData); 480 481 $respBody = ''; 482 483 if (!PEAR::isError($objReq->sendRequest())) { 484 $respBody = $objReq->getResponseBody(); 485 } 486 487 return lfGetPostArray($respBody); 488 } 489 490 /** 491 * 3D¥Ù¥ê¥Õ¥¡¥¤¤Î¼Â¹Ô·ë²Ì¤òȽÄꤹ¤ë 492 * 493 * @param array $arr3dRet 494 * @return boolean|PEAR::ERROR À®¸ù»þ:true|¼ºÇÔ»þ:PEAR::ERROR¥ª¥Ö¥¸¥§¥¯¥È 495 */ 496 function lf3dVerifyIsSuccess($arr3dRet) { 497 // ÄÌ¿®¥¨¥é¡¼ 498 if (empty($arr3dRet)) { 499 return PEAR::raiseError('ÄÌ¿®¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£'); 500 } 501 502 // À®¸ù 503 if ($arr3dRet['Html'] == "Receipt" 504 && empty($arr3dRet['ErrType']) 505 && empty($arr3dRet['ErrInfo'])) { 506 507 return true; 508 509 // ¼ºÇÔ 510 } else { 511 $detail_code01 = substr($arr3dRet['ErrInfo'], 0, 5); 512 $detail_code02 = substr($arr3dRet['ErrInfo'], 5, 4); 513 $gmo_err_msg = $detail_code01 . "-" . $detail_code02; 514 515 return PEAR::raiseError('ÄÌ¿®¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£¥¨¥é¡¼¥³¡¼¥É¡§' . $gmo_err_msg); 516 } 517 } 518 519 function lfEnable3D() { 520 global $arrGMOConf; 521 if (isset($arrGMOConf[0]['gmo_3d']) && $arrGMOConf[0]['gmo_3d'] == '1') { 522 return true; 523 } 524 return false; 329 $arrRet = array(); 330 if($text != "") { 331 $text = ereg_replace("[\n\r]", "", $text); 332 $arrTemp = split("&", $text); 333 foreach($arrTemp as $ret) { 334 list($key, $val) = split("=", $ret); 335 $arrRet[$key] = $val; 336 } 337 } 338 return $arrRet; 525 339 } 526 340 ?> -
branches/feature-module-gmo-pg/data/downloads/module/mdl_gmo-pg/gmo-pg_credit.tpl
r16844 r16902 62 62 <table width="700" border="0" cellspacing="0" cellpadding="0" summary=" "> 63 63 <tr> 64 <td><img src=" <!--{$smarty.const.URL_DIR}-->img/shopping/flow03.gif" width="700" height="36" alt="¹ØÆþ¼ê³¤¤Îή¤ì"></td>64 <td><img src="/img/shopping/flow03.gif" width="700" height="36" alt="¹ØÆþ¼ê³¤¤Îή¤ì"></td> 65 65 66 66 </tr> … … 72 72 <table width="666" border="0" cellspacing="0" cellpadding="0" summary=" "> 73 73 <tr> 74 <td colspan="3"><img src=" <!--{$smarty.const.URL_DIR}-->img/contents/contents_title_top.gif" width="666" height="7" alt=""></td>75 </tr> 76 <tr> 77 <td background=" <!--{$smarty.const.URL_DIR}-->img/contents/contents_title_left_bg.gif"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/contents_title_left.gif" width="22" height="12" alt=""></td>74 <td colspan="3"><img src="/img/contents/contents_title_top.gif" width="666" height="7" alt=""></td> 75 </tr> 76 <tr> 77 <td background="/img/contents/contents_title_left_bg.gif"><img src="/img/contents/contents_title_left.gif" width="22" height="12" alt=""></td> 78 78 <td bgcolor="#636469" width="638" class="fs16n"><strong><span class="white"><!--{$tpl_payment_method}--></span><strong></td> 79 <td background=" <!--{$smarty.const.URL_DIR}-->img/contents/contents_title_right_bg.gif"><img src="<!--{$smarty.const.URL_DIR}-->img/common/_.gif" width="18" height="1" alt=""></td>80 </tr> 81 <tr> 82 <td colspan="3"><img src=" <!--{$smarty.const.URL_DIR}-->img/contents/contents_title_bottom.gif" width="666" height="7" alt=""></td>79 <td background="/img/contents/contents_title_right_bg.gif"><img src="/img/common/_.gif" width="18" height="1" alt=""></td> 80 </tr> 81 <tr> 82 <td colspan="3"><img src="/img/contents/contents_title_bottom.gif" width="666" height="7" alt=""></td> 83 83 </tr> 84 84 <tr><td height="15"></td></tr> … … 215 215 <tr> 216 216 <td align="center" height="40" bgcolor="#f7f5f4"> 217 <a href="#" onclick="document.form2.submit(); return false;" onmouseover="chgImgImageSubmit(' <!--{$smarty.const.URL_DIR}-->img/common/b_back_on.gif',back03)" onmouseout="chgImgImageSubmit('<!--{$smarty.const.URL_DIR}-->img/common/b_back.gif',back03)"><img src="<!--{$smarty.const.URL_DIR}-->img/common/b_back.gif" width="150" height="30" alt="Ìá¤ë" border="0" name="back03" id="back03"/></a><img src="<!--{$smarty.const.URL_DIR}-->img/_.gif" width="12" height="" alt="" />218 <input type="image" onclick="return fnCheckSubmit();" onmouseover="chgImgImageSubmit(' <!--{$smarty.const.URL_DIR}-->img/common/b_next_on.gif',this)" onmouseout="chgImgImageSubmit('<!--{$smarty.const.URL_DIR}-->img/common/b_next.gif',this)" src="<!--{$smarty.const.URL_DIR}-->img/common/b_next.gif" width="150" height="30" alt="¼¡¤Ø" border="0" name="next" id="next" />217 <a href="#" onclick="document.form2.submit(); return false;" onmouseover="chgImgImageSubmit('/img/common/b_back_on.gif',back03)" onmouseout="chgImgImageSubmit('/img/common/b_back.gif',back03)"><img src="/img/common/b_back.gif" width="150" height="30" alt="Ìá¤ë" border="0" name="back03" id="back03"/></a><img src="/img/_.gif" width="12" height="" alt="" /> 218 <input type="image" onclick="return fnCheckSubmit();" onmouseover="chgImgImageSubmit('/img/common/b_next_on.gif',this)" onmouseout="chgImgImageSubmit('/img/common/b_next.gif',this)" src="/img/common/b_next.gif" width="150" height="30" alt="¼¡¤Ø" border="0" name="next" id="next" /> 219 219 </td> 220 220 </tr> -
branches/feature-module-gmo-pg/data/downloads/module/mdl_gmo-pg/mdl_gmo-pg.inc
r16844 r16902 1 1 <?php 2 2 /** 3 * @copyright 2000-2007 LOCKON CO.,LTD. All Rights Reserved. 3 * 4 * @copyright 2000-2007 LOCKON CO.,LTD. All Rights Reserved. 4 5 * @version CVS: $Id: mdl_epsilon.inc 7162 2006-11-18 09:53:33Z kakinaka $ 5 * @link http://www.lockon.co.jp/ 6 * @link http://www.lockon.co.jp/ 7 * 6 8 */ 7 9 require_once(DATA_PATH . "module/Request.php"); 8 10 9 // ¥â¥¸¥å¡¼¥ëID 11 /**** ¢§Äê¿ôÀë¸À *********************************************************************************************/ 12 10 13 define("MDL_GMOPG_ID", 11); 11 14 12 /** 13 * ¥¯¥ì¥¸¥Ã¥È·èºÑ 14 * ËÜÈÖ²ÔÆ¯¤ÎºÝ¤Ï²¼µURL¤òËÜÈÖÍѤ˽ñ¤´¹¤¨¤ë 15 */ 16 define("GMO_ENTRY_URL", "http://mod-i.ccsware.net/ohayou/EntryTran.php"); 17 define("GMO_EXEC_URL", "http://mod-i.ccsware.net/ohayou/ExecTran.php"); 18 define("GMO_3D_URL", "https://mod-i.ccsware.net/ohayou/3dVerify.php"); 19 20 // 3D¥»¥¥å¥¢Ìá¤êÍÑURL 21 define("GMO_RETURL", SSL_URL . "shopping/load_payment_module.php"); 22 23 // GMO¥í¥°¥Ñ¥¹ 24 define('GMO_LOG_PATH', DATA_PATH . 'logs/gmo-pg.log'); 15 /** ¥¯¥ì¥¸¥Ã¥È·èºÑ(»î¸³ÍÑ) **/ 16 define ("GMO_ENTRY_URL", "http://mod-i.ccsware.net/ohayou/EntryTran.php"); 17 define ("GMO_EXEC_URL", "http://mod-i.ccsware.net/ohayou/ExecTran.php"); 18 // ¥À¥ß¡¼¤Ç¤è¤¤¤Î¤ÇÆþ¤ì¤Æ¤ª¤«¤Ê¤¤¤ÈÀµ¤·¤¯Æ°¤«¤Ê¤¤ 19 define ("GMO_RETURL", SITE_URL . "mod-i/recv.php"); 25 20 26 21 // ¥¯¥ì¥¸¥Ã¥Èʬ³ä²ó¿ô 27 $arrPayMethod = array( 28 '1-0' => "°ì³çʧ¤¤", 29 '2-3' => "ʬ³ä3²óʧ¤¤", 30 '2-6' => "ʬ³ä6²óʧ¤¤", 31 '2-10'=> "ʬ³ä10²óʧ¤¤", 32 '2-15'=> "ʬ³ä15²óʧ¤¤", 33 '2-20'=> "ʬ³ä20²óʧ¤¤", 34 '5-0' => "¥ê¥Üʧ¤¤" 22 $arrPaymentClass = array( 23 '01' => '°ì³çʧ¤¤', 24 '03' => '3²óʧ¤¤', 25 '05' => '5²óʧ¤¤', 26 '06' => '6²óʧ¤¤', 27 '10' => '10²óʧ¤¤' 35 28 ); 36 29 37 /** 38 * ¥â¥¸¥å¡¼¥ëÀßÄê¤ò¼èÆÀ¤¹¤ë¡£ 39 * 40 * @param string $where 41 * @param array $arrWhereVal 42 * @return array 43 */ 30 // Á÷¿®¥Ñ¥é¥á¡¼¥¿ 31 define ("SECURE_LINK_URL", "https://linkpt.cardservice.co.jp/cgi-bin/secure.cgi"); 32 33 // ʸ»ú¿ôÀ©¸Â 34 define ("CLIENTIP_LEN", 5); 35 define ("SEND_LEN", 20); 36 37 38 /************************************************************************************************************** 39 * ´Ø¿ô̾ ¡§sfGetPaymentDB 40 * ½èÍýÆâÍÆ ¡§É¬Íפʥǡ¼¥¿¤ò¼èÆÀ¤¹¤ë¡£ 41 * °ú¿ô1 ¡§ 42 * °ú¿ô2 ¡§ 43 * °ú¿ô3 ¡§ 44 * Ìá¤êÃÍ ¡§¼èÆÀ·ë²Ì 45 **************************************************************************************************************/ 44 46 function sfGetPaymentDB($where = "", $arrWhereVal = array()){ 47 global $objQuery; 48 45 49 $arrVal = array(MDL_GMOPG_ID); 46 50 $arrVal = array_merge($arrVal, $arrWhereVal); 47 48 $sql =<<<END 49 SELECT 50 module_id, 51 memo01 as gmo_shopid, 52 memo02 as gmo_shoppass, 53 memo03 as gmo_tenantno, 54 memo04 as gmo_3d 55 FROM 56 dtb_payment 57 WHERE 58 module_id = ? 59 END; 60 61 $sql .= $where; 62 $objQuery = new SC_Query; 63 $arrRet = $objQuery->getAll($sql, $arrVal); 64 51 52 $arrRet = array(); 53 $sql = "SELECT 54 module_id, 55 memo01 as gmo_shopid, 56 memo02 as gmo_shoppass, 57 memo03 as gmo_tenantno 58 FROM dtb_payment WHERE module_id = ? " . $where; 59 $arrRet = $objQuery->getall($sql, $arrVal); 60 65 61 return $arrRet; 66 62 } 67 63 68 /** 69 * ¶¦Ä̤Îɽ¼¨½èÍý 70 * 71 * @param LC_Page $objPage 72 * @param integer $payment_id 73 * @return LC_Page $objPage 74 */ 64 /************************************************************************************************************** 65 * ´Ø¿ô̾ ¡§sfPostPaymentData 66 * ½èÍýÆâÍÆ ¡§·èºÑ¥Ç¡¼¥¿Á÷¿®½èÍý 67 * °ú¿ô1 ¡§ 68 * °ú¿ô2 ¡§ 69 * °ú¿ô3 ¡§ 70 * Ìá¤êÃÍ ¡§¼èÆÀ·ë²Ì 71 **************************************************************************************************************/ 72 function sfPostPaymentData($arrData, $arrInput, $quick_chage = false){ 73 $arrPaymentDB = sfGetPaymentDB(MDL_GMOPG_ID); 74 75 if(!$quick_chage) { 76 $arrPost = array( 77 'clientip' => $arrPaymentDB['clientip'], 78 'cardnumber' => $arrInput['card_no01'].$arrInput['card_no02'].$arrInput['card_no03'].$arrInput['card_no04'], 79 'expyy' => $arrInput['card_year'], 80 'expmm' => $arrInput['card_month'], 81 'telno' => $arrData['order_tel01'].$arrData['order_tel02'].$arrData['order_tel03'], 82 'email' => $arrData['order_email'], 83 'sendid' => $arrData['order_id'], 84 'username' => $arrInput['card_name01'].$arrInput['card_name02'], 85 'money' => $arrData['total'], 86 'sendpoint' => 'eccube', 87 'send' => 'mall', 88 'pubsec' => '', 89 'div' => $arrInput['payment_class'] 90 ); 91 } else { 92 // ¥¯¥¤¥Ã¥¯¥Á¥ã¡¼¥¸¤òÍøÍѤ¹¤ë¾ì¹ç 93 $objQuery = new SC_Query(); 94 $objQuery->setlimit(1); 95 $objQuery->setorder("create_date DESC"); 96 $col = "order_id, order_tel01, order_tel02, order_tel03"; 97 $where = "memo01 = ? AND memo03 = ? AND customer_id = ?"; 98 $arrRet = $objQuery->select($col, "dtb_order", $where, array(MDL_GMOPG_ID, 'Success_order', $arrData['customer_id'])); 99 100 $arrPost = array( 101 'send' => 'mall', 102 'clientip' => $arrPaymentDB['clientip'], 103 'money' => $arrData['total'], 104 'telno' => $arrRet[0]['order_tel01'].$arrRet[0]['order_tel02'].$arrRet[0]['order_tel03'], 105 'sendid' => $arrRet[0]['order_id'], 106 'cardnumber' => '8888888888888888', 107 'email' => $arrData['order_email'], 108 'sendpoint' => 'eccube', 109 'expyy' => '01', // ¥À¥ß¡¼ÃÍ 110 'expmm' => '01', // ¥À¥ß¡¼ÃÍ 111 'div' => '01', 112 'entry' => 'non', 113 'pubsec' => 'yes' 114 ); 115 116 sfPrintR($arrPost); 117 } 118 119 $req = new HTTP_Request(SECURE_LINK_URL); 120 $req->setMethod(HTTP_REQUEST_METHOD_POST); 121 $req->addPostDataArray($arrPost); 122 123 if (!PEAR::isError($req->sendRequest())) { 124 $response = $req->getResponseBody(); 125 $response = mb_convert_encoding($response, "EUC-JP", "Shift-JIS"); 126 } 127 $req->clearPostData(); 128 gfPrintLog("¥¼¥¦¥¹±þÅú·ë²Ì¡§".$response); 129 130 // ¼õÃí¥Æ¡¼¥Ö¥ë¤ËµÏ¿¤¹¤ë 131 $arrVal["memo01"] = MDL_GMOPG_ID; // ¥â¥¸¥å¡¼¥ëID 132 $arrVal["memo03"] = $response; // ½èÍý·ë²Ì 133 // ¼õÃí°ì»þ¥Æ¡¼¥Ö¥ë¤Ë¹¹¿· 134 sfRegistTempOrder($arrData['order_temp_id'], $arrVal); 135 136 if(ereg('Success_order', $response)) { 137 return true; 138 } else { 139 return false; 140 } 141 return $arrVal; 142 } 143 /************************************************************************************************************** 144 * ´Ø¿ô̾ ¡§sfGmoDisp 145 * ½èÍýÆâÍÆ ¡§¶¦Ä̤Îɽ¼¨½èÍý 146 * °ú¿ô1 ¡§ 147 * °ú¿ô2 ¡§ 148 * °ú¿ô3 ¡§ 149 * Ìá¤êÃÍ ¡§¼èÆÀ·ë²Ì 150 **************************************************************************************************************/ 75 151 function sfGmoDisp($objPage, $payment_id) { 76 77 78 79 80 81 152 $objQuery = new SC_Query(); 153 // »Ùʧ¤¤ÊýË¡¤ÎÀâÌÀ²èÁü¤ò¼èÆÀ¤¹¤ë¡£ 154 $arrRet = $objQuery->select("payment_method, payment_image", "dtb_payment", "payment_id = ?", array($payment_id)); 155 $objPage->tpl_payment_method = $arrRet[0]['payment_method']; 156 $objPage->tpl_payment_image = $arrRet[0]['payment_image']; 157 return $objPage; 82 158 } 83 159 ?> -
branches/feature-module-gmo-pg/data/downloads/module/mdl_gmo-pg/mdl_gmo-pg.php
r16844 r16902 1 1 <?php 2 2 /** 3 * 3 * 4 4 * @copyright 2000-2007 LOCKON CO.,LTD. All Rights Reserved. 5 * @version CVS: $Id: 1.0 2006-06-04 06:38:01Z kakinaka $ 5 * @version CVS: $Id: 1.0 2006-06-04 06:38:01Z kakinaka $ 6 6 * @link http://www.lockon.co.jp/ 7 7 * … … 15 15 //¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È¤Î»ØÄê 16 16 $this->tpl_mainpage = MODULE_PATH . 'mdl_gmo-pg/mdl_gmo-pg.tpl'; 17 $this->tpl_subtitle = ' GMO¥Ú¥¤¥á¥ó¥È¥²¡¼¥È¥¦¥§¥¤·èºÑ¥â¥¸¥å¡¼¥ë';17 $this->tpl_subtitle = '¥Ú¥¤¥á¥ó¥È¥²¡¼¥È¥¦¥§¥¤·èºÑ¥â¥¸¥å¡¼¥ë'; 18 18 } 19 19 } … … 35 35 sfAlterMemo(); 36 36 37 sfPrintR($_POST); 38 37 39 switch($_POST['mode']) { 38 40 case 'edit': 39 41 // ÆþÎÏ¥¨¥é¡¼È½Äê 40 42 $objPage->arrErr = lfCheckError(); 41 42 // ¥¨¥é¡¼¤Ê¤·¤Î¾ì¹ç¤Ë¤Ï¥Ç¡¼¥¿¤ò¹¹¿· 43 44 // ¥¨¥é¡¼¤Ê¤·¤Î¾ì¹ç¤Ë¤Ï¥Ç¡¼¥¿¤ò¹¹¿· 43 45 if(count($objPage->arrErr) == 0) { 44 46 // ¥Ç¡¼¥¿¹¹¿· 45 lfUpdPaymentDB( $objFormParam->getHashArray());46 47 lfUpdPaymentDB(); 48 47 49 // javascript¼Â¹Ô 48 50 $objPage->tpl_onload = 'alert("ÅÐÏ¿´°Î»¤·¤Þ¤·¤¿¡£\n´ðËܾðÊó¡ä»ÙʧÊýË¡ÀßÄê¤è¤ê¾ÜºÙÀßÄê¤ò¤·¤Æ¤¯¤À¤µ¤¤¡£"); window.close();'; … … 58 60 default: 59 61 // ¥Ç¡¼¥¿¤Î¥í¡¼¥É 60 lfLoadData(); 62 lfLoadData(); 61 63 break; 62 64 } … … 75 77 /* Ⱦ³Ñ±Ñ¿ô»ú10 ·å°ÊÆâ */ 76 78 $objFormParam->addParam("ŹÊÞ´ÉÍýÈÖ¹æ", "gmo_tenantno", 10, "KVa", array("EXIST_CHECK", "ALNUM_CHECK", "MAX_LENGTH_CHECK", "SPTAB_CHECK")); 77 $objFormParam->addParam("3D¥»¥¥å¥¢Ç§¾Ú", "gmo_3d", 1, "a", array("NUM_CHECK", "MAX_LENGTH_CHECK"));78 79 return $objFormParam; 79 80 } … … 82 83 function lfCheckError(){ 83 84 global $objFormParam; 84 85 85 86 $arrErr = $objFormParam->checkError(); 86 87 87 88 return $arrErr; 88 89 } … … 91 92 function lfLoadData(){ 92 93 global $objFormParam; 93 94 94 95 //¥Ç¡¼¥¿¤ò¼èÆÀ 95 96 $arrRet = sfGetPaymentDB("AND del_flg = '0'"); 96 97 97 98 // Ãͤò¥»¥Ã¥È 98 99 $objFormParam->setParam($arrRet[0]); … … 107 108 108 109 // ¥Ç¡¼¥¿¤Î¹¹¿·½èÍý 109 function lfUpdPaymentDB( $arrPostData){110 $objQuery = new SC_Query;111 $objSess = new SC_Session;110 function lfUpdPaymentDB(){ 111 global $objQuery; 112 global $objSess; 112 113 113 114 // del_flg¤òºï½ü¤Ë¤·¤Æ¤ª¤¯ 114 // XXX115 115 $del_sql = "UPDATE dtb_payment SET del_flg = 1 WHERE module_id = ? "; 116 116 $objQuery->query($del_sql, array(MDL_GMOPG_ID)); 117 117 118 118 // ¥Ç¡¼¥¿ÅÐÏ¿ 119 $arrData = array(); 119 $arrData = array(); 120 120 $arrData["payment_method"] = "¥Ú¥¤¥á¥ó¥È¥²¡¼¥È¥¦¥§¥¤¥¯¥ì¥¸¥Ã¥È"; 121 121 $arrData["fix"] = 3; 122 122 $arrData["module_id"] = MDL_GMOPG_ID; 123 123 $arrData["module_path"] = MODULE_PATH . "mdl_gmo-pg/gmo-pg_credit.php"; 124 $arrData["memo01"] = $ arrPostData["gmo_shopid"];125 $arrData["memo02"] = $ arrPostData["gmo_shoppass"];126 $arrData["memo03"] = $ arrPostData["gmo_tenantno"];127 $arrData["memo04"] = isset($arrPostData["gmo_3d"]) ? '1' : '0';124 $arrData["memo01"] = $_POST["gmo_shopid"]; 125 $arrData["memo02"] = $_POST["gmo_shoppass"]; 126 $arrData["memo03"] = $_POST["gmo_tenantno"]; 127 $arrData["memo04"] = ""; 128 128 $arrData["memo05"] = ""; 129 129 $arrData["del_flg"] = "0"; 130 130 $arrData["creator_id"] = $objSess->member_id; 131 131 $arrData["update_date"] = "now()"; 132 132 133 133 // ¥é¥ó¥¯¤ÎºÇÂçÃͤò¼èÆÀ¤¹¤ë 134 134 $max_rank = $objQuery->getone("SELECT max(rank) FROM dtb_payment"); 135 135 $arrData['rank'] = $max_rank; 136 137 // »ÙʧÊýË¡¥Ç¡¼¥¿¤ò¼èÆÀ 138 // XXX 139 $arrPaymentData = sfGetPaymentDB(); 140 // ¥Ç¡¼¥¿¤¬Â¸ºß¤·¤Æ¤¤¤ì¤ÐUPDATE¡¢Ìµ¤±¤ì¤ÐINSERT 141 if(!empty($arrPaymentData)){ 142 $objQuery->update("dtb_payment", $arrData, "module_id = ?", array(MDL_GMOPG_ID)); 143 }else{ 144 $objQuery->insert("dtb_payment", $arrData); 136 137 sfPrintR($arrData); 138 139 // ¹¹¿·¥Ç¡¼¥¿¤¬¤¢¤ì¤Ð¹¹¿·¤¹¤ë¡£ 140 if(count($arrData) > 0){ 141 // »ÙʧÊýË¡¥Ç¡¼¥¿¤ò¼èÆÀ 142 $arrPaymentData = lfGetPaymentDB(); 143 // ¥Ç¡¼¥¿¤¬Â¸ºß¤·¤Æ¤¤¤ì¤ÐUPDATE¡¢Ìµ¤±¤ì¤ÐINSERT 144 if(count($arrPaymentData) > 0){ 145 $objQuery->update("dtb_payment", $arrData, " module_id = '" . MDL_GMOPG_ID . "'"); 146 }else{ 147 $objQuery->insert("dtb_payment", $arrData); 148 } 145 149 } 146 150 } -
branches/feature-module-gmo-pg/data/downloads/module/mdl_gmo-pg/mdl_gmo-pg.tpl
r16844 r16902 80 80 <tr class="fs12n"> 81 81 <td bgcolor="#ffffff"> 82 £Ç£Í£Ï¥Ú¥¤¥á¥ó¥È¥²¡¼¥È¥¦¥§¥¤·èºÑ¥â¥¸¥å¡¼¥ë¤ò¤´ÍøÍÑĺ¤¯°Ù¤Ë¤Ï¡¢¥æ¡¼¥¶Íͤ´¼«¿È¤Ç83 £Ç£Í£Ï¥Ú¥¤¥á¥ó¥È¥²¡¼¥È¥¦¥§¥¤³ô¼°²ñ¼ÒÍͤȤ´·ÀÌó¤ò¹Ô¤Ã¤Æ¤¤¤¿¤À¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ <br/>82 ¥¼¥¦¥¹·èºÑ¥â¥¸¥å¡¼¥ë¤ò¤´ÍøÍÑĺ¤¯°Ù¤Ë¤Ï¡¢¥æ¡¼¥¶Íͤ´¼«¿È¤Ç 83 ³ô¼°²ñ¼Ò£Ç£Í£Ï¥Ú¥¤¥¸¥§¥ó¥È¥²¡¼¥È¥¦¥§¥¤ÍͤȤ´·ÀÌó¤ò¹Ô¤Ã¤Æ¤¤¤¿¤À¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ <br/> 84 84 ¤ª¿½¤·¹þ¤ß¤Ë¤Ä¤¤Þ¤·¤Æ¤Ï¡¢²¼µ¤Î¥Ú¡¼¥¸¤«¤é¡¢¤ª¿½¤·¹þ¤ß¤ò¹Ô¤Ã¤Æ²¼¤µ¤¤¡£<br/><br/> 85 <a href="http://www.gmo-pg.com/" target="_blank"> ¡ä¡ä £Ç£Í£Ï¥Ú¥¤¥ á¥ó¥È¥²¡¼¥È¥¦¥§¥¤·èºÑ¥·¥¹¥Æ¥à¤Ë¤Ä¤¤¤Æ</a>85 <a href="http://www.gmo-pg.com/" target="_blank"> ¡ä¡ä £Ç£Í£Ï¥Ú¥¤¥¸¥§¥ó¥È¥²¡¼¥È¥¦¥§¥¤·èºÑ¥·¥¹¥Æ¥à¤Ë¤Ä¤¤¤Æ</a> 86 86 </td> 87 87 </tr> 88 88 </table> 89 89 90 90 <table width="442" border="0" cellspacing="0" cellpadding="0" summary=" "> 91 91 <tr><td><img src="<!--{$smarty.const.URL_DIR}-->img/contents/main_bar.jpg" width="442" height="10" alt=""></td></tr> … … 97 97 </tr> 98 98 <tr class="fs12n"> 99 <td width="" bgcolor="#f3f3f3">¥·¥ç¥Ã¥×I D<span class="red"> ¢¨</span></td>99 <td width="" bgcolor="#f3f3f3">¥·¥ç¥Ã¥×IP<span class="red"> ¢¨</span></td> 100 100 <td width="300" bgcolor="#ffffff"> 101 101 <!--{assign var=key value="gmo_shopid"}--> … … 120 120 </td> 121 121 </tr> 122 <tr class="fs12n">123 <td width="" bgcolor="#f3f3f3">3D¥»¥¥å¥¢Ç§¾Ú</td>124 <td width="300" bgcolor="#ffffff" aligin="left">125 <!--{assign var=key value="gmo_3d"}-->126 <span class="red12"><!--{$arrErr[$key]}--></span>127 <input type="checkbox"128 name="<!--{$key}-->"129 style="<!--{$arrErr[$key]|sfGetErrorColor}-->"130 value="1"131 maxlength="<!--{$arrForm[$key].length}-->" <!--{if $arrForm[$key].value}--> checked <!--{/if}-->> »ÈÍѤ¹¤ë¾ì¹ç¤Ï¥Á¥§¥Ã¥¯¤òÆþ¤ì¤Æ¤¯¤À¤µ¤¤132 </td>133 </tr>134 122 </table> 135 123 136 124 <table width="442" border="0" cellspacing="0" cellpadding="0" summary=" "> 137 125 <tr>
Note: See TracChangeset
for help on using the changeset viewer.