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

Revision 15433, 3.5 KB checked in by naka, 13 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    '1' => '°ì³çʧ¤¤',
18);
19
20// Á÷¿®¥Ñ¥é¥á¡¼¥¿
21define ("SECURE_LINK_URL", "https://linkpt.cardservice.co.jp/cgi-bin/secure.cgi");
22
23// ʸ»ú¿ôÀ©¸Â
24define ("CLIENTIP_LEN", 5);
25define ("SEND_LEN", 20);
26
27/**************************************************************************************************************
28 * ´Ø¿ô̾   ¡§sfGetPaymentDB
29 * ½èÍýÆâÍÆ ¡§É¬Íפʥǡ¼¥¿¤ò¼èÆÀ¤¹¤ë¡£
30 * °ú¿ô1    ¡§
31 * °ú¿ô2    ¡§
32 * °ú¿ô3    ¡§
33 * Ìá¤êÃÍ   ¡§¼èÆÀ·ë²Ì
34 **************************************************************************************************************/
35function sfGetPaymentDB($module_id, $where = "", $arrWhereVal = array()){
36    $objQuery = new SC_Query();
37       
38    $arrVal = array($module_id);
39    $arrVal = array_merge($arrVal, $arrWhereVal);
40   
41    $arrRet = array();
42    $sql = "SELECT
43                module_id,
44                memo01 as clientip
45            FROM dtb_payment WHERE module_id = ? " . $where;
46    $arrRet = $objQuery->getall($sql, $arrVal);
47
48    return $arrRet[0];
49}
50
51/**************************************************************************************************************
52 * ´Ø¿ô̾   ¡§sfPostPaymentData
53 * ½èÍýÆâÍÆ ¡§·èºÑ¥Ç¡¼¥¿Á÷¿®½èÍý
54 * °ú¿ô1    ¡§
55 * °ú¿ô2    ¡§
56 * °ú¿ô3    ¡§
57 * Ìá¤êÃÍ   ¡§¼èÆÀ·ë²Ì
58 **************************************************************************************************************/
59function sfPostPaymentData($arrData, $arrInput){
60    $arrPaymentDB = sfGetPaymentDB(MDL_ZEUS_ID);
61    $arrPost = array(
62        'clientip' => $arrPaymentDB['clientip'],
63        'cardnumber' => $arrInput['card_no01'].$arrInput['card_no02'].$arrInput['card_no03'].$arrInput['card_no04'],
64        'expyy' => $arrInput['card_year'],
65        'expmm' => $arrInput['card_month'],
66        'telno' => $arrData['order_tel01'].$arrData['order_tel02'].$arrData['order_tel03'],
67        'email' => $arrData['order_email'],
68        'sendid' => $arrData['order_id'],
69        'username' => $arrInput['card_name01'].$arrInput['card_name02'],
70        'money' => $arrData['total'],
71        'sendpoint' => 'eccube',
72        'send' => 'mall',
73        'pubsec' => ''
74    );
75   
76    sfPrintR($arrPost);
77   
78    $req = new HTTP_Request(SECURE_LINK_URL);
79    $req->setMethod(HTTP_REQUEST_METHOD_POST);
80    $req->addPostDataArray($arrPost);
81   
82    if (!PEAR::isError($req->sendRequest())) {
83        $response = $req->getResponseBody();
84        $response = mb_convert_encoding($response, "EUC-JP", "Shift-JIS");
85    }
86    $req->clearPostData();
87
88    if(ereg('Success_order', $response)) {
89        gfPrintLog($response);
90    } else {
91        gfPrintLog($response);
92    }
93    return $arrVal;
94}
95/**************************************************************************************************************
96 * ´Ø¿ô̾   ¡§sfZeusDisp
97 * ½èÍýÆâÍÆ ¡§¶¦Ä̤Îɽ¼¨½èÍý
98 * °ú¿ô1    ¡§
99 * °ú¿ô2    ¡§
100 * °ú¿ô3    ¡§
101 * Ìá¤êÃÍ   ¡§¼èÆÀ·ë²Ì
102 **************************************************************************************************************/
103function sfZeusDisp($objPage, $payment_id) {
104    $objQuery = new SC_Query();
105    // »Ùʧ¤¤ÊýË¡¤ÎÀâÌÀ²èÁü¤ò¼èÆÀ¤¹¤ë¡£
106    $arrRet = $objQuery->select("payment_method, payment_image", "dtb_payment", "payment_id = ?", array($payment_id));
107    $objPage->tpl_payment_method = $arrRet[0]['payment_method'];
108    $objPage->tpl_payment_image = $arrRet[0]['payment_image'];
109    return $objPage;
110}
111?>
Note: See TracBrowser for help on using the repository browser.