source: branches/feature-module-paygent/data/downloads/module/mdl_paygent/paygent_bank.php @ 15180

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