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

Revision 16746, 4.1 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
28if (GC_MobileUserAgent::isMobile()) {
29    sfDispSiteError(FREE_ERROR_MSG, "", false, "¶ä¹Ô¥Í¥Ã¥È·èºÑ¤Ï¡¢¤´»ÈÍѤε¡¼ï¤Ë¤ÏÂбþ¤·¤Æ¤ª¤ê¤Þ¤»¤ó¡£", 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 = sfGetOrderTemp($uniqid);
49
50// ¥«¡¼¥È½¸·×¤ò¸µ¤ËºÇ½ª·×»»
51$arrData = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo);
52
53switch($_POST['mode']) {
54// Á°¤Î¥Ú¡¼¥¸¤ËÌá¤ë
55case 'return':
56    // Àµ¾ï¤Ê¿ä°Ü¤Ç¤¢¤ë¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
57    $objSiteSess->setRegistFlag();
58    header("Location: " . URL_SHOP_CONFIRM);
59    exit;
60    break;
61// ¼¡¤Ø
62case 'next':
63    // ÆþÎÏÃͤÎÊÑ´¹
64    $objFormParam->convParam();
65    $objPage->arrErr = lfCheckError($arrRet);
66    // ÆþÎÏ¥¨¥é¡¼¤Ê¤·¤Î¾ì¹ç
67    if(count($objPage->arrErr) == 0) {
68         // ÆþÎϥǡ¼¥¿¤Î¼èÆÀ¤ò¹Ô¤¦
69        $arrInput = $objFormParam->getHashArray();
70        // ¥¯¥ì¥¸¥Ã¥ÈÅÅʸÁ÷¿®
71        $arrRet = sfSendPaygentBANK($arrData, $arrInput, $uniqid);     
72       
73        // À®¸ù
74        if($arrRet['asp_url'] != "") {
75            // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
76            $objSiteSess->setRegistFlag();
77            header("Location: " . $arrRet['asp_url']);
78        } else {
79            // ¼ºÇÔ
80            $objPage->tpl_error = "ǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£¤ª¼ê¿ô¤Ç¤¹¤¬ÆþÎÏÆâÍƤò¤´³Îǧ¤¯¤À¤µ¤¤¡£";
81        }
82    }
83    break;
84// ·èºÑ¥Ú¡¼¥¸¤Ø¤ÎÁ«°Ü¸å¤Î±þÅú
85default:
86    // ±þÅú¤Î¤¢¤Ã¤¿¼õÃíID¤¬¼õÃí°ì»þ¥Æ¡¼¥Ö¥ë¤ÎID¤È°ìÃפ·¤Æ¤¤¤ë¡£
87    if($_GET['trading_id'] == $arrData['order_id']) {
88        if($_GET['result'] == '0' && $_GET['payment_id'] != "") {
89            // Àµ¾ï¤ËÅÐÏ¿¤µ¤ì¤¿¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
90            $objSiteSess->setRegistFlag();
91            header("Location: " . URL_SHOP_COMPLETE);
92        } else {
93            // ¼ºÇÔ
94            $objPage->tpl_error = "·èºÑ¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£¤ª¼ê¿ô¤Ç¤¹¤¬ºÆÅÙ¤ª¼ê³¤­¤ò¹Ô¤¦¤«¡¢Ê̤Τª»Ùʧ¤¤ÊýË¡¤òÁªÂò¤·¤Æ²¼¤µ¤¤¡£";
95        }
96    }   
97    break;
98}
99
100$objDate = new SC_Date();
101$objDate->setStartYear(RELEASE_YEAR);
102$objDate->setEndYear(RELEASE_YEAR + CREDIT_ADD_YEAR);
103$objPage->arrYear = $objDate->getZeroYear();
104$objPage->arrMonth = $objDate->getZeroMonth();
105
106// ¶¦Ä̤Îɽ¼¨½àÈ÷
107$objPage = sfPaygentDisp($objPage, $payment_id);
108
109$objPage->arrNetBank = $arrNetBank;
110$objPage->arrForm = $objFormParam->getFormParamList();
111$objView->assignobj($objPage);
112// ¥Õ¥ì¡¼¥à¤òÁªÂò(¥­¥ã¥ó¥Ú¡¼¥ó¥Ú¡¼¥¸¤«¤éÁ«°Ü¤Ê¤éÊѹ¹)
113$objCampaignSess->pageView($objView);
114//-------------------------------------------------------------------------------------------------------
115/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */
116function lfInitParam($arrData) {
117    global $objFormParam;
118    $objFormParam->addParam("ÍøÍѼÔÀ«", "customer_family_name", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK"), $arrData['order_name01']);
119    $objFormParam->addParam("ÍøÍѼÔ̾", "customer_name", STEXT_LEN, "KVa", array("EXIST_CHECK", "MAX_LENGTH_CHECK"), $arrData['order_name02']);
120    $objFormParam->addParam("ÍøÍѼÔÀ«¥«¥Ê", "customer_family_name_kana", STEXT_LEN, "CKVa", array("EXIST_CHECK", "KANA_CHECK", "MAX_LENGTH_CHECK"), $arrData['order_kana01']);
121    $objFormParam->addParam("ÍøÍѼÔ̾¥«¥Ê", "customer_name_kana", STEXT_LEN, "CKVa", array("EXIST_CHECK", "KANA_CHECK", "MAX_LENGTH_CHECK"), $arrData['order_kana02']);
122}
123
124/* ÆþÎÏÆâÍƤΥÁ¥§¥Ã¥¯ */
125function lfCheckError() {
126    global $objFormParam;
127    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
128    $arrRet =  $objFormParam->getHashArray();
129    $objErr = new SC_CheckError($arrRet);
130    $objErr->arrErr = $objFormParam->checkError();
131   
132    return $objErr->arrErr;
133}
134?>
Note: See TracBrowser for help on using the repository browser.