source: branches/beta/data/downloads/module/mdl_zeus/mdl_zeus.inc @ 16860

Revision 16860, 5.2 KB checked in by naka, 15 years ago (diff)

ゼウスクイックチャージバグ修正

Line 
1<?php
2/**
3 *
4 * @copyright   2000-2007 LOCKON CO.,LTD. All Rights Reserved.
5 * @version CVS: $Id: mdl_epsilon.inc 7162 2006-11-18 09:53:33Z kakinaka $
6 * @link        http://www.lockon.co.jp/
7 *
8 */
9require_once(DATA_PATH . "module/Request.php");
10
11/**** ¢§Äê¿ôÀë¸À *********************************************************************************************/
12
13define("MDL_ZEUS_ID", 10);
14
15// ¥¯¥ì¥¸¥Ã¥Èʬ³ä²ó¿ô
16$arrPaymentClass = array(
17    '01' => '°ì³çʧ¤¤',
18    '03' => '3²óʧ¤¤',
19    '05' => '5²óʧ¤¤',
20    '06' => '6²óʧ¤¤',
21    '10' => '10²óʧ¤¤'     
22);
23
24// Á÷¿®¥Ñ¥é¥á¡¼¥¿
25define ("SECURE_LINK_URL", "https://linkpt.cardservice.co.jp/cgi-bin/secure.cgi");
26
27// ʸ»ú¿ôÀ©¸Â
28define ("CLIENTIP_LEN", 5);
29define ("SEND_LEN", 20);
30
31/**************************************************************************************************************
32 * ´Ø¿ô̾   ¡§sfGetPaymentDB
33 * ½èÍýÆâÍÆ ¡§É¬Íפʥǡ¼¥¿¤ò¼èÆÀ¤¹¤ë¡£
34 * °ú¿ô1    ¡§
35 * °ú¿ô2    ¡§
36 * °ú¿ô3    ¡§
37 * Ìá¤êÃÍ   ¡§¼èÆÀ·ë²Ì
38 **************************************************************************************************************/
39function sfGetPaymentDB($module_id, $where = "", $arrWhereVal = array()){
40    $objQuery = new SC_Query();
41       
42    $arrVal = array($module_id);
43    $arrVal = array_merge($arrVal, $arrWhereVal);
44   
45    $arrRet = array();
46    $sql = "SELECT
47                module_id,
48                memo01 as clientip
49            FROM dtb_payment WHERE module_id = ? " . $where;
50    $arrRet = $objQuery->getall($sql, $arrVal);
51
52    return $arrRet[0];
53}
54
55/**************************************************************************************************************
56 * ´Ø¿ô̾   ¡§sfPostPaymentData
57 * ½èÍýÆâÍÆ ¡§·èºÑ¥Ç¡¼¥¿Á÷¿®½èÍý
58 * °ú¿ô1    ¡§
59 * °ú¿ô2    ¡§
60 * °ú¿ô3    ¡§
61 * Ìá¤êÃÍ   ¡§¼èÆÀ·ë²Ì
62 **************************************************************************************************************/
63function sfPostPaymentData($arrData, $arrInput, $quick_chage = false){
64    $arrPaymentDB = sfGetPaymentDB(MDL_ZEUS_ID);
65   
66    if(!$quick_chage) {
67        $arrPost = array(
68            'clientip' => $arrPaymentDB['clientip'],
69            'cardnumber' =>  $arrInput['card_no01'].$arrInput['card_no02'].$arrInput['card_no03'].$arrInput['card_no04'],
70            'expyy' => $arrInput['card_year'],
71            'expmm' => $arrInput['card_month'],
72            'telno' => $arrData['order_tel01'].$arrData['order_tel02'].$arrData['order_tel03'],
73            'email' => $arrData['order_email'],
74            'sendid' => $arrData['order_id'],
75            'username' => $arrInput['card_name01'].$arrInput['card_name02'],
76            'money' => $arrData['total'],
77            'sendpoint' => 'eccube',
78            'send' => 'mall',
79            'pubsec' => '',
80            'div' => $arrInput['payment_class']
81        );
82    } else {
83        // ¥¯¥¤¥Ã¥¯¥Á¥ã¡¼¥¸¤òÍøÍѤ¹¤ë¾ì¹ç
84        $objQuery = new SC_Query();
85        $objQuery->setlimit(1);
86        $objQuery->setorder("create_date DESC");
87        $col = "order_id, order_tel01, order_tel02, order_tel03";
88        $where = "memo01 = ? AND memo03 = ? AND customer_id = ?";
89        $arrRet = $objQuery->select($col, "dtb_order", $where, array(MDL_ZEUS_ID, 'Success_order', $arrData['customer_id']));
90       
91        // ²áµî¤ÎÃíʸ¤¬¤¢¤ê¡¢¸ÜµÒÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¡£
92        if(count($arrRet) > 0 && $arrData['customer_id'] > 0) {
93           $arrPost = array(
94                'send' => 'mall',
95                'clientip' => $arrPaymentDB['clientip'],
96                'money' => $arrData['total'],
97                'telno' => $arrRet[0]['order_tel01'].$arrRet[0]['order_tel02'].$arrRet[0]['order_tel03'],
98                'sendid' => $arrRet[0]['order_id'],
99                'cardnumber' => '8888888888888888',
100                'email' => $arrData['order_email'],
101                'sendpoint' => 'eccube',
102                'expyy' => '01',    // ¥À¥ß¡¼ÃÍ
103                'expmm' => '01',    // ¥À¥ß¡¼ÃÍ
104                'div' => '01',
105                'entry' => 'non',
106                'pubsec' => 'yes'           
107            );
108        } else {
109           gfPrintLog("²áµî¤ÎÃíʸ¤¬¤Ê¤¤¤«¡¢²ñ°÷ID¤¬¤¢¤ê¤Þ¤»¤ó¡£");
110        }
111    }
112   
113    $req = new HTTP_Request(SECURE_LINK_URL);
114    $req->setMethod(HTTP_REQUEST_METHOD_POST);
115    $req->addPostDataArray($arrPost);
116   
117    if (!PEAR::isError($req->sendRequest())) {
118        $response = $req->getResponseBody();
119        $response = mb_convert_encoding($response, "EUC-JP", "Shift-JIS");
120    }
121    $req->clearPostData();
122    gfPrintLog("¥¼¥¦¥¹±þÅú·ë²Ì¡§".$response);
123
124    // ¼õÃí¥Æ¡¼¥Ö¥ë¤Ëµ­Ï¿¤¹¤ë
125    $arrVal["memo01"] = MDL_ZEUS_ID;    // ¥â¥¸¥å¡¼¥ëID
126    $arrVal["memo03"] = $response;      // ½èÍý·ë²Ì
127    // ¼õÃí°ì»þ¥Æ¡¼¥Ö¥ë¤Ë¹¹¿·
128    sfRegistTempOrder($arrData['order_temp_id'], $arrVal);
129   
130    if(ereg('Success_order', $response)) {
131        return true;
132    } else {
133        return false;
134    }
135    return $arrVal;
136}
137/**************************************************************************************************************
138 * ´Ø¿ô̾   ¡§sfZeusDisp
139 * ½èÍýÆâÍÆ ¡§¶¦Ä̤Îɽ¼¨½èÍý
140 * °ú¿ô1    ¡§
141 * °ú¿ô2    ¡§
142 * °ú¿ô3    ¡§
143 * Ìá¤êÃÍ   ¡§¼èÆÀ·ë²Ì
144 **************************************************************************************************************/
145function sfZeusDisp($objPage, $payment_id) {
146    $objQuery = new SC_Query();
147    // »Ùʧ¤¤ÊýË¡¤ÎÀâÌÀ²èÁü¤ò¼èÆÀ¤¹¤ë¡£
148    $arrRet = $objQuery->select("payment_method, payment_image", "dtb_payment", "payment_id = ?", array($payment_id));
149    $objPage->tpl_payment_method = $arrRet[0]['payment_method'];
150    $objPage->tpl_payment_image = $arrRet[0]['payment_image'];
151    return $objPage;
152}
153?>
Note: See TracBrowser for help on using the repository browser.