source: branches/feature-module-zeus/data/downloads/module/mdl_zeus/mdl_zeus.inc @ 15488

Revision 15488, 4.1 KB checked in by naka, 17 years ago (diff)
RevLine 
[15418]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(
[15450]17    '01' => '°ì³çʧ¤¤',
18    '03' => '3²óʧ¤¤',
19    '05' => '5²óʧ¤¤',
20    '06' => '6²óʧ¤¤',
21    '10' => '10²óʧ¤¤'     
[15418]22);
23
24// Á÷¿®¥Ñ¥é¥á¡¼¥¿
[15429]25define ("SECURE_LINK_URL", "https://linkpt.cardservice.co.jp/cgi-bin/secure.cgi");
[15418]26
27// ʸ»ú¿ôÀ©¸Â
28define ("CLIENTIP_LEN", 5);
29define ("SEND_LEN", 20);
30
[15429]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,
[15431]48                memo01 as clientip
[15429]49            FROM dtb_payment WHERE module_id = ? " . $where;
50    $arrRet = $objQuery->getall($sql, $arrVal);
51
[15431]52    return $arrRet[0];
[15429]53}
[15418]54
55/**************************************************************************************************************
56 * ´Ø¿ô̾   ¡§sfPostPaymentData
57 * ½èÍýÆâÍÆ ¡§·èºÑ¥Ç¡¼¥¿Á÷¿®½èÍý
58 * °ú¿ô1    ¡§
59 * °ú¿ô2    ¡§
60 * °ú¿ô3    ¡§
61 * Ìá¤êÃÍ   ¡§¼èÆÀ·ë²Ì
62 **************************************************************************************************************/
[15425]63function sfPostPaymentData($arrData, $arrInput){
[15431]64    $arrPaymentDB = sfGetPaymentDB(MDL_ZEUS_ID);
[15487]65    $telno = $arrData['order_tel01'].$arrData['order_tel02'].$arrData['order_tel03'];
66    $cardnumber = $arrInput['card_no01'].$arrInput['card_no02'].$arrInput['card_no03'].$arrInput['card_no04'];
[15420]67    $arrPost = array(
[15431]68        'clientip' => $arrPaymentDB['clientip'],
[15487]69        'cardnumber' => $cardnumber,
[15425]70        'expyy' => $arrInput['card_year'],
71        'expmm' => $arrInput['card_month'],
[15487]72        'telno' => $telno,
[15426]73        'email' => $arrData['order_email'],
[15425]74        'sendid' => $arrData['order_id'],
75        'username' => $arrInput['card_name01'].$arrInput['card_name02'],
76        'money' => $arrData['total'],
[15420]77        'sendpoint' => 'eccube',
78        'send' => 'mall',
[15477]79        'pubsec' => '',
80        'div' => $arrInput['payment_class']
[15420]81    );
[15477]82   
[15429]83    $req = new HTTP_Request(SECURE_LINK_URL);
[15420]84    $req->setMethod(HTTP_REQUEST_METHOD_POST);
[15422]85    $req->addPostDataArray($arrPost);
[15420]86   
87    if (!PEAR::isError($req->sendRequest())) {
88        $response = $req->getResponseBody();
89        $response = mb_convert_encoding($response, "EUC-JP", "Shift-JIS");
90    }
91    $req->clearPostData();
[15452]92    gfPrintLog("¥¼¥¦¥¹±þÅú·ë²Ì¡§".$response);
[15436]93   
[15488]94    gfDebugLog($arrData);
95   
[15425]96    if(ereg('Success_order', $response)) {
[15475]97        // ¼õÃí¥Æ¡¼¥Ö¥ë¤Ëµ­Ï¿¤¹¤ë
98        $arrVal["memo01"] = MDL_ZEUS_ID;    // ¥â¥¸¥å¡¼¥ëID
[15487]99        $arrVal["memo03"] = $response;      // ½èÍý·ë²Ì
100        // QuickChargeÍѤÎÅÅʸ¤òÊݸ¡Ê2²óÌܰʹßÆþÎϾÊάÍÑ¡Ë
101        /*
102            clientip ¡Ü telno ¡Ü sendid ¤Ç¥«¡¼¥É¾ðÊó¤ò¸¡º÷
103         */
104        $arrVal["memo04"] = $arrPost['clientip'].$arrPost['telno'].$arrPost['sendid'];
[15475]105        // ¼õÃí°ì»þ¥Æ¡¼¥Ö¥ë¤Ë¹¹¿·
106        sfRegistTempOrder($arrData['order_temp_id'], $arrVal);
[15436]107        return true;
[15425]108    } else {
[15436]109        return false;
[15425]110    }
[15418]111    return $arrVal;
112}
113/**************************************************************************************************************
114 * ´Ø¿ô̾   ¡§sfZeusDisp
115 * ½èÍýÆâÍÆ ¡§¶¦Ä̤Îɽ¼¨½èÍý
116 * °ú¿ô1    ¡§
117 * °ú¿ô2    ¡§
118 * °ú¿ô3    ¡§
119 * Ìá¤êÃÍ   ¡§¼èÆÀ·ë²Ì
120 **************************************************************************************************************/
121function sfZeusDisp($objPage, $payment_id) {
122    $objQuery = new SC_Query();
123    // »Ùʧ¤¤ÊýË¡¤ÎÀâÌÀ²èÁü¤ò¼èÆÀ¤¹¤ë¡£
124    $arrRet = $objQuery->select("payment_method, payment_image", "dtb_payment", "payment_id = ?", array($payment_id));
125    $objPage->tpl_payment_method = $arrRet[0]['payment_method'];
126    $objPage->tpl_payment_image = $arrRet[0]['payment_image'];
127    return $objPage;
128}
129?>
Note: See TracBrowser for help on using the repository browser.