source: branches/beta/data/downloads/module/mdl_epsilon/card.php @ 16799

Revision 16799, 5.1 KB checked in by satou, 15 years ago (diff)

#108
不要コードの削除。

#110
モバイル決済でのバグを修正。

Line 
1<?php
2/*
3 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7
8require_once("../require.php");
9require_once(DATA_PATH . "module/Request.php");
10require_once(MODULE_PATH . "mdl_epsilon/mdl_epsilon.inc");
11
12class LC_Page {
13    function LC_Page() {
14        /*
15         session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç
16         ¡ÖÌá¤ë¡×¥Ü¥¿¥ó»ÈÍÑ»þ¤ÎÍ­¸ú´ü¸ÂÀÚ¤ìɽ¼¨¤òÍÞÀ©¤¹¤ë¡£
17         private-no-expire:¥¯¥é¥¤¥¢¥ó¥È¤Î¥­¥ã¥Ã¥·¥å¤òµö²Ä¤¹¤ë¡£
18        */
19        session_cache_limiter('private-no-expire');     
20    }
21}
22
23$objPage = new LC_Page();
24$objView = new SC_SiteView();
25$objCampaignSess = new SC_CampaignSession();
26$objSiteInfo = $objView->objSiteInfo;
27$arrInfo = $objSiteInfo->data;
28
29// ¥æ¡¼¥¶¥æ¥Ë¡¼¥¯ID¤Î¼èÆÀ¤È¹ØÆþ¾õÂÖ¤ÎÀµÅöÀ­¤ò¥Á¥§¥Ã¥¯
30$uniqid = sfCheckNormalAccess($objSiteSess, $objCartSess);
31
32// ¥«¡¼¥È½¸·×½èÍý
33$objPage = sfTotalCart($objPage, $objCartSess, $arrInfo);
34
35// °ì»þ¼õÃí¥Æ¡¼¥Ö¥ë¤ÎÆɹþ
36$arrData = sfGetOrderTemp($uniqid);
37
38// ¥«¡¼¥È½¸·×¤ò¸µ¤ËºÇ½ª·×»»
39$arrData = sfTotalConfirm($arrData, $objPage, $objCartSess, $arrInfo);
40
41// Âåɽ¾¦ÉʾðÊó
42$arrMainProduct = $objPage->arrProductsClass[0];
43
44// »Ùʧ¤¤¾ðÊó¤ò¼èÆÀ
45$arrPayment = $objQuery->getall("SELECT module_id, memo01, memo02, memo03, memo04, memo05, memo06, memo07, memo08, memo09, memo10 FROM dtb_payment WHERE payment_id = ? ", array($arrData["payment_id"]));
46
47// trans_code¤ËÃͤ¬¤¢¤ê³î¤Ä¡¢Àµ¾ï½ªÎ»¤Î¤È¤­¤Ï¥ª¡¼¥À¡¼³Îǧ¤ò¹Ô¤¦¡£
48if($_GET["result"] == "1"){
49   
50    // Àµ¾ï¤Ê¿ä°Ü¤Ç¤¢¤ë¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
51    $objSiteSess->setRegistFlag();
52   
53    // GET¥Ç¡¼¥¿¤òÊݸ
54    $arrVal["credit_result"] = $_GET["result"];
55    $arrVal["memo01"] = PAYMENT_CREDIT_ID;
56    $arrVal["memo03"] = $arrPayment[0]["module_id"];
57    $sqlval["memo04"] = sfGetXMLValue($arrXML,'RESULT','TRANS_CODE');
58
59    // ¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¥³¡¼¥É
60    $arrMemo["trans_code"] = array("name"=>"Epsilon¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¥³¡¼¥É", "value" => $_GET["trans_code"]);
61    $arrVal["memo02"] = serialize($arrMemo);
62
63    // ·èºÑÁ÷¿®¥Ç¡¼¥¿ºîÀ®
64    $arrModule['module_id'] = MDL_EPSILON_ID;
65    $arrModule['payment_total'] = $arrPayment[0]["payment_total"];
66    $arrModule['payment_id'] = PAYMENT_CREDIT_ID;
67    $arrVal["memo05"] = serialize($arrModule);
68
69    // ¼õÃí°ì»þ¥Æ¡¼¥Ö¥ë¤Ë¹¹¿·
70    sfRegistTempOrder($uniqid, $arrVal);
71
72    // ´°Î»²èÌ̤Ø
73    if (is_callable("GC_MobileUserAgent", "isMobile") && GC_MobileUserAgent::isMobile()) {
74        header("Location: " .  gfAddSessionId(URL_SHOP_COMPLETE));
75    } else {
76        header("Location: " .  URL_SHOP_COMPLETE);
77    }
78}
79
80// ¥Ç¡¼¥¿Á÷¿®
81lfSendCredit($arrData, $arrPayment, $arrMainProduct);
82
83//---------------------------------------------------------------------------------------------------------------------------------------------------------
84
85// ¥Ç¡¼¥¿Á÷¿®½èÍý
86function lfSendCredit($arrData, $arrPayment, $arrMainProduct, $again = true){
87    global $objSiteSess;
88    global $objCampaignSess;
89   
90    // ¥Ç¡¼¥¿Á÷¿®ÀèCGI
91    $order_url = $arrPayment[0]["memo02"];
92
93    // Èó²ñ°÷¤Î¤È¤­¤Ï user_id ¤Ë not_member¤ÈÁ÷¤ë
94    ($arrData["customer_id"] == 0) ? $user_id = "not_member" : $user_id = $arrData["customer_id"]; 
95   
96    // Á÷¿®¥Ç¡¼¥¿À¸À®
97    $item_name = $arrMainProduct["name"] . "¡ß" . $arrMainProduct["quantity"] . "¸Ä (Âåɽ)";
98    $arrSendData = array(
99        'contract_code' => $arrPayment[0]["memo01"],                        // ·ÀÌ󥳡¼¥É
100        'user_id' => $user_id ,                                             // ¥æ¡¼¥¶ID
101        'user_name' => $arrData["order_name01"].$arrData["order_name02"],   // ¥æ¡¼¥¶Ì¾
102        'user_mail_add' => $arrData["order_email"],                         // ¥á¡¼¥ë¥¢¥É¥ì¥¹
103        'order_number' => $arrData["order_id"],                             // ¥ª¡¼¥À¡¼ÈÖ¹æ
104        'item_code' => $arrMainProduct["product_code"],                     // ¾¦ÉÊ¥³¡¼¥É(Âåɽ)
105        'item_name' => $item_name,                                          // ¾¦ÉÊ̾(Âåɽ)
106        'item_price' => $arrData["payment_total"],                          // ¾¦ÉʲÁ³Ê(Àǹþ¤ßÁí³Û)
107        'st_code' => $arrPayment[0]["memo04"],                              // ·èºÑ¶èʬ
108        'mission_code' => '1',                                              // ²Ý¶â¶èʬ(¸ÇÄê)
109        'process_code' => '1',                                              // ½èÍý¶èʬ(¸ÇÄê)
110        'xml' => '1',                                                       // ±þÅú·Á¼°(¸ÇÄê)
111        'memo1' => "",                                                      // ͽÈ÷01
112        'memo2' => ECCUBE_PAYMENT . "_" . date("YmdHis"),                   // ͽÈ÷02
113    );
114
115    // ¥Ç¡¼¥¿Á÷¿®
116    $arrXML = sfPostPaymentData($order_url, $arrSendData);
117   
118    // ¥¨¥é¡¼¤¬¤¢¤ë¤«¥Á¥§¥Ã¥¯¤¹¤ë
119    $err_code = sfGetXMLValue($arrXML,'RESULT','ERR_CODE');
120   
121    if($err_code != "") {
122        $err_detail = sfGetXMLValue($arrXML,'RESULT','ERR_DETAIL');
123       
124        // ·èºÑ¶èʬ¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï VISA,MASTER ¤Î¤ß¤ÇºÆÁ÷¿®¤ò»î¤ß¤ë
125        if($err_code == "909" and $again){
126            $arrPayment[0]["memo04"] = "10000-0000-00000";
127            lfSendCredit($arrData, $arrPayment, $arrMainProduct, false);
128        }
129        sfDispSiteError(FREE_ERROR_MSG, "", true, "¹ØÆþ½èÍýÃæ¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£<br /><br /><br />¡¦" . $err_detail . "<br /><br /><br />¤³¤Î¼ê³¤­¤Ï̵¸ú¤È¤Ê¤ê¤Þ¤·¤¿¡£");
130    } else {
131        // Àµ¾ï¤Ê¿ä°Ü¤Ç¤¢¤ë¤³¤È¤òµ­Ï¿¤·¤Æ¤ª¤¯
132        $objSiteSess->setRegistFlag();
133       
134        // ·ÈÂÓüËö¤Î¾ì¹ç¤Ï¡¢¥»¥Ã¥·¥ç¥óID¡¦¥ª¡¼¥À¡¼Èֹ桦Ìá¤Ã¤Æ¤¯¤ëURL¤òÊݸ¤·¤Æ¤ª¤¯¡£
135        if (is_callable("GC_MobileUserAgent", "isMobile") && GC_MobileUserAgent::isMobile()) {
136            sfMobileSetExtSessionId('order_number', $arrData['order_id'], 'mobile/shopping/load_payment_module.php');
137            sfMobileSetExtSessionId('order_number', $arrData['order_id'], 'mobile/shopping/confirm.php');
138        }
139
140        $url = sfGetXMLValue($arrXML,'RESULT','REDIRECT');
141        header("Location: " . $url);
142    }
143}
144
145?>
Note: See TracBrowser for help on using the repository browser.