source: branches/beta/data/downloads/module/mdl_paygent/paygent_conveni.php @ 16746

Revision 16746, 3.7 KB checked in by naka, 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_conveni.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// ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹
28$objFormParam = new SC_FormParam();
29
30if (GC_MobileUserAgent::isMobile()) {
31    sfDispSiteError(FREE_ERROR_MSG, "", false, "¥³¥ó¥Ó¥Ë·èºÑ¤Ï¡¢¤´»ÈÍѤε¡¼ï¤Ë¤ÏÂбþ¤·¤Æ¤ª¤ê¤Þ¤»¤ó¡£", true);
32    exit;
33}
34
35// °ì»þ¼õÃí¥Æ¡¼¥Ö¥ë¤ÎÆɹþ
36$arrData = sfGetOrderTemp($uniqid);
37
38// ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½
39lfInitParam($arrData);
40// POSTÃͤμèÆÀ
41$objFormParam->setParam($_POST);
42
43// ¥«¡¼¥È½¸·×½èÍý
44$objPage = sfTotalCart($objPage, $objCartSess, $arrInfo);
45
46// ¥«¡¼¥È½¸·×¤ò¸µ¤ËºÇ½ª·×»»
47$arrData = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo);
48
49switch($_POST['mode']) {
50// Á°¤Î¥Ú¡¼¥¸¤ËÌá¤ë
51case 'return':
52    // Àµ¾ï¤Ê¿ä°Ü¤Ç¤¢¤ë¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
53    $objSiteSess->setRegistFlag();
54    header("Location: " . URL_SHOP_CONFIRM);
55    exit;
56    break;
57// ¼¡¤Ø
58case 'next':
59    // ÆþÎÏÃͤÎÊÑ´¹
60    $objFormParam->convParam();
61    $objPage->arrErr = lfCheckError($arrRet);
62    // ÆþÎÏ¥¨¥é¡¼¤Ê¤·¤Î¾ì¹ç
63    if(count($objPage->arrErr) == 0) {
64         // ÆþÎϥǡ¼¥¿¤Î¼èÆÀ¤ò¹Ô¤¦
65        $arrInput = $objFormParam->getHashArray();
66        // ¥¯¥ì¥¸¥Ã¥ÈÅÅʸÁ÷¿®
67        $arrRet = sfSendPaygentConveni($arrData, $arrInput, $uniqid);       
68       
69        // À®¸ù
70        if($arrRet['result'] == 0) {
71            // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
72            $objSiteSess->setRegistFlag();
73            header("Location: " . URL_SHOP_COMPLETE);
74        } else {
75            // ¼ºÇÔ
76            $objPage->tpl_error = "ǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£¤ª¼ê¿ô¤Ç¤¹¤¬ÆþÎÏÆâÍƤò¤´³Îǧ¤¯¤À¤µ¤¤¡£";
77        }
78    }
79    break;
80}
81
82
83// ¶¦Ä̤Îɽ¼¨½àÈ÷
84$objPage = sfPaygentDisp($objPage, $payment_id);
85
86$objPage->arrConvenience = $arrConvenience;
87$objPage->arrForm = $objFormParam->getFormParamList();
88$objView->assignobj($objPage);
89// ¥Õ¥ì¡¼¥à¤òÁªÂò(¥­¥ã¥ó¥Ú¡¼¥ó¥Ú¡¼¥¸¤«¤éÁ«°Ü¤Ê¤éÊѹ¹)
90$objCampaignSess->pageView($objView);
91//-------------------------------------------------------------------------------------------------------
92/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */
93function lfInitParam($arrData) {
94    global $objFormParam;
95    $objFormParam->addParam("¥³¥ó¥Ó¥Ë", "cvs_company_id", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK")); 
96    $objFormParam->addParam("ÍøÍѼÔÀ«", "customer_family_name", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK"), $arrData['order_name01']);
97    $objFormParam->addParam("ÍøÍѼÔ̾", "customer_name", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK"), $arrData['order_name02']);
98    $objFormParam->addParam("ÍøÍѼÔÀ«¥«¥Ê", "customer_family_name_kana", STEXT_LEN, "CKVa", array("EXIST_CHECK", "KANA_CHECK", "MAX_LENGTH_CHECK"), $arrData['order_kana01']);
99    $objFormParam->addParam("ÍøÍѼÔ̾¥«¥Ê", "customer_name_kana", STEXT_LEN, "CKVa", array("EXIST_CHECK", "KANA_CHECK", "MAX_LENGTH_CHECK"), $arrData['order_kana02']);
100    $objFormParam->addParam("¤ªÅÅÏÃÈÖ¹æ", "customer_tel", 11, "n", array("EXIST_CHECK", "MAX_LENGTH_CHECK" ,"NUM_CHECK"), $arrData['order_tel01'].$arrData['order_tel02'].$arrData['order_tel03']);
101}
102
103/* ÆþÎÏÆâÍƤΥÁ¥§¥Ã¥¯ */
104function lfCheckError() {
105    global $objFormParam;
106    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
107    $arrRet =  $objFormParam->getHashArray();
108    $objErr = new SC_CheckError($arrRet);
109    $objErr->arrErr = $objFormParam->checkError();
110   
111    return $objErr->arrErr;
112}
113?>
Note: See TracBrowser for help on using the repository browser.