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

Revision 17012, 4.0 KB checked in by satou, 15 years ago (diff)

[ペイジェント決済モジュール]3Dセキュア対応

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