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

Revision 15195, 4.4 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_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            $objSiteSess->setRegistFlag();
71            $objPage->tpl_mainpage = MODULE_PATH . 'mdl_paygent/paygent_bank_redirect.tpl';
72            $objPage->tpl_bank = $arrNetBank[$arrInput['bank_code']];
73            $objPage->tpl_form = mb_convert_encoding($arrRet['redirect_html'], CHAR_CODE, "Shift-JIS");
74        } else {
75            // ¼ºÇÔ
76            $objPage->tpl_error = "ǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£¤ª¼ê¿ô¤Ç¤¹¤¬ÆþÎÏÆâÍƤò¤´³Îǧ¤¯¤À¤µ¤¤¡£";
77        }
78    }
79    break;
80// ·èºÑ¥Ú¡¼¥¸¤Ø¤ÎÁ«°Ü¸å¤Î±þÅú
81default:
82    // ±þÅú¤Î¤¢¤Ã¤¿¼õÃíID¤¬¼õÃí°ì»þ¥Æ¡¼¥Ö¥ë¤ÎID¤È°ìÃפ·¤Æ¤¤¤ë¡£
83    if($_GET['trading_id'] == $arrData['order_id']) {
84        if($_GET['result'] == '0' && $_GET['payment_id'] != "") {
85            // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
86            $objSiteSess->setRegistFlag();
87            header("Location: " . URL_SHOP_COMPLETE);
88        } else {
89            // ¼ºÇÔ
90            $objPage->tpl_error = "·èºÑ¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£¤ª¼ê¿ô¤Ç¤¹¤¬ºÆÅÙ¤ª¼ê³¤­¤ò¹Ô¤¦¤«¡¢Ê̤Τª»Ùʧ¤¤ÊýË¡¤òÁªÂò¤·¤Æ²¼¤µ¤¤¡£";
91        }
92    }   
93    break;
94}
95
96$objDate = new SC_Date();
97$objDate->setStartYear(RELEASE_YEAR);
98$objDate->setEndYear(RELEASE_YEAR + CREDIT_ADD_YEAR);
99$objPage->arrYear = $objDate->getZeroYear();
100$objPage->arrMonth = $objDate->getZeroMonth();
101
102// ¶¦Ä̤Îɽ¼¨½àÈ÷
103$objPage = sfPaygentDisp($objPage, $payment_id);
104
105$objPage->arrNetBank = $arrNetBank;
106$objPage->arrForm = $objFormParam->getFormParamList();
107$objView->assignobj($objPage);
108// ¥Õ¥ì¡¼¥à¤òÁªÂò(¥­¥ã¥ó¥Ú¡¼¥ó¥Ú¡¼¥¸¤«¤éÁ«°Ü¤Ê¤éÊѹ¹)
109$objCampaignSess->pageView($objView);
110//-------------------------------------------------------------------------------------------------------
111/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */
112function lfInitParam($arrData) {
113    global $objFormParam;
114    $objFormParam->addParam("¶âÍ»µ¡´Ø", "bank_code", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK"));   
115    $objFormParam->addParam("ÍøÍѼÔÀ«", "customer_family_name", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK"), $arrData['order_name01']);
116    $objFormParam->addParam("ÍøÍѼÔ̾", "customer_name", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK"), $arrData['order_name02']);
117    $objFormParam->addParam("ÍøÍѼÔÀ«¥«¥Ê", "customer_family_name_kana", STEXT_LEN, "CKVa", array("EXIST_CHECK", "KANA_CHECK", "MAX_LENGTH_CHECK"), $arrData['order_kana01']);
118    $objFormParam->addParam("ÍøÍѼÔ̾¥«¥Ê", "customer_name_kana", STEXT_LEN, "CKVa", array("EXIST_CHECK", "KANA_CHECK", "MAX_LENGTH_CHECK"), $arrData['order_kana02']);
119}
120
121/* ÆþÎÏÆâÍƤΥÁ¥§¥Ã¥¯ */
122function lfCheckError() {
123    global $objFormParam;
124    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
125    $arrRet =  $objFormParam->getHashArray();
126    $objErr = new SC_CheckError($arrRet);
127    $objErr->arrErr = $objFormParam->checkError();
128   
129    return $objErr->arrErr;
130}
131?>
Note: See TracBrowser for help on using the repository browser.