source: branches/beta/data/downloads/module/mdl_paygent/paygent_atm.php @ 16795

Revision 16795, 3.4 KB checked in by satou, 15 years ago (diff)
Line 
1<?php
2/*
3 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7require_once(MODULE_PATH . "mdl_paygent/mdl_paygent.inc");
8
9class LC_Page {
10    function LC_Page() {
11        /** ɬ¤º»ØÄꤹ¤ë **/
12        $this->tpl_mainpage = MODULE_PATH . 'mdl_paygent/paygent_atm.tpl';      // ¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È
13        /*
14         session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç
15         ¡ÖÌá¤ë¡×¥Ü¥¿¥ó»ÈÍÑ»þ¤ÎÍ­¸ú´ü¸ÂÀÚ¤ìɽ¼¨¤òÍÞÀ©¤¹¤ë¡£
16         private-no-expire:¥¯¥é¥¤¥¢¥ó¥È¤Î¥­¥ã¥Ã¥·¥å¤òµö²Ä¤¹¤ë¡£
17        */
18        session_cache_limiter('private-no-expire');     
19    }
20}
21
22$objPage = new LC_Page();
23$objView = new SC_SiteView();
24$objCampaignSess = new SC_CampaignSession();
25$objSiteInfo = $objView->objSiteInfo;
26$arrInfo = $objSiteInfo->data;
27
28if (GC_MobileUserAgent::isMobile()) {
29    sfDispSiteError(FREE_ERROR_MSG, "", false, "ATM·èºÑ¤Ï¡¢¤´»ÈÍѤε¡¼ï¤Ë¤ÏÂбþ¤·¤Æ¤ª¤ê¤Þ¤»¤ó¡£", true);
30    exit;
31}
32
33// ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹
34$objFormParam = new SC_FormParam();
35
36// °ì»þ¼õÃí¥Æ¡¼¥Ö¥ë¤ÎÆɹþ
37$arrData = sfGetOrderTemp($uniqid);
38
39// ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½
40lfInitParam($arrData);
41// POSTÃͤμèÆÀ
42$objFormParam->setParam($_POST);
43
44// ¥«¡¼¥È½¸·×½èÍý
45$objPage = sfTotalCart($objPage, $objCartSess, $arrInfo);
46
47// ¥«¡¼¥È½¸·×¤ò¸µ¤ËºÇ½ª·×»»
48$arrData = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo);
49
50switch($_POST['mode']) {
51// Á°¤Î¥Ú¡¼¥¸¤ËÌá¤ë
52case 'return':
53    // Àµ¾ï¤Ê¿ä°Ü¤Ç¤¢¤ë¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
54    $objSiteSess->setRegistFlag();
55    header("Location: " . URL_SHOP_CONFIRM);
56    exit;
57    break;
58// ¼¡¤Ø
59case 'next':
60    // ÆþÎÏÃͤÎÊÑ´¹
61    $objFormParam->convParam();
62    $objPage->arrErr = lfCheckError($arrRet);
63    // ÆþÎÏ¥¨¥é¡¼¤Ê¤·¤Î¾ì¹ç
64    if(count($objPage->arrErr) == 0) {
65         // ÆþÎϥǡ¼¥¿¤Î¼èÆÀ¤ò¹Ô¤¦
66        $arrInput = $objFormParam->getHashArray();
67        // ¥¯¥ì¥¸¥Ã¥ÈÅÅʸÁ÷¿®
68        $arrRet = sfSendPaygentATM($arrData, $arrInput, $uniqid);
69       
70        // À®¸ù
71        if($arrRet['result'] === "0") {
72            // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
73            $objSiteSess->setRegistFlag();
74            header("Location: " . URL_SHOP_COMPLETE);
75        } else {
76            // ¼ºÇÔ
77            $objPage->tpl_error = "ǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£¤ª¼ê¿ô¤Ç¤¹¤¬ÆþÎÏÆâÍƤò¤´³Îǧ¤¯¤À¤µ¤¤¡£";
78        }
79    }
80    break;
81}
82
83// ¶¦Ä̤Îɽ¼¨½àÈ÷
84$objPage = sfPaygentDisp($objPage, $payment_id);
85
86$objPage->arrForm = $objFormParam->getFormParamList();
87$objView->assignobj($objPage);
88// ¥Õ¥ì¡¼¥à¤òÁªÂò(¥­¥ã¥ó¥Ú¡¼¥ó¥Ú¡¼¥¸¤«¤éÁ«°Ü¤Ê¤éÊѹ¹)
89$objCampaignSess->pageView($objView);
90
91//----------------------------------------------------------------------------------
92
93/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */
94function lfInitParam($arrData) {
95    global $objFormParam;
96    $objFormParam->addParam("ÍøÍѼÔÀ«", "customer_family_name", PAYGENT_BANK_STEXT_LEN / 2, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK"), $arrData['order_name01']);
97    $objFormParam->addParam("ÍøÍѼÔ̾", "customer_name", PAYGENT_BANK_STEXT_LEN / 2, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK"), $arrData['order_name02']);
98    $objFormParam->addParam("ÍøÍѼÔÀ«¥«¥Ê", "customer_family_name_kana", PAYGENT_BANK_STEXT_LEN, "CKVa", array("EXIST_CHECK", "KANA_CHECK", "MAX_LENGTH_CHECK"), $arrData['order_kana01']);
99    $objFormParam->addParam("ÍøÍѼÔ̾¥«¥Ê", "customer_name_kana", PAYGENT_BANK_STEXT_LEN, "CKVa", array("EXIST_CHECK", "KANA_CHECK", "MAX_LENGTH_CHECK"), $arrData['order_kana02']);
100}
101
102/* ÆþÎÏÆâÍƤΥÁ¥§¥Ã¥¯ */
103function lfCheckError() {
104    global $objFormParam;
105    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
106    $arrRet =  $objFormParam->getHashArray();
107    $objErr = new SC_CheckError($arrRet);
108    $objErr->arrErr = $objFormParam->checkError();
109   
110    return $objErr->arrErr;
111}
112?>
Note: See TracBrowser for help on using the repository browser.