- Timestamp:
- 2007/12/07 11:45:23 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 ?>
Note: See TracChangeset
for help on using the changeset viewer.