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

Revision 15180, 15.7 KB checked in by naka, 14 years ago (diff)
Line 
1<?php
2/**
3 *
4 * @copyright   2000-2006 LOCKON CO.,LTD. All Rights Reserved.
5 * @version CVS: $Id: mdl_epsilon.inc 7162 2006-11-18 09:53:33Z kakinaka $
6 * @link        http://www.lockon.co.jp/
7 *
8 */
9$paygent_credit_php_dir = realpath(dirname( __FILE__));
10ini_set('include_path', $paygent_credit_php_dir . PATH_SEPARATOR . ini_get('include_path'));
11
12$check_path = $paygent_credit_php_dir . "/" . "jp/co/ks/merchanttool/connectmodule/";
13
14// paygent¥â¥¸¥å¡¼¥ë¤ÎÆɹþ
15include_once("jp/co/ks/merchanttool/connectmodule/entity/ResponseDataFactory.php");
16include_once("jp/co/ks/merchanttool/connectmodule/system/PaygentB2BModule.php");
17include_once("jp/co/ks/merchanttool/connectmodule/exception/PaygentB2BModuleConnectException.php");
18include_once("jp/co/ks/merchanttool/connectmodule/exception/PaygentB2BModuleException.php");
19
20// ¥Ú¥¤¥¸¥§¥ó¥È·èºÑ¤Î¥â¥¸¥å¡¼¥ëID¡Êdtb_module¤È¹ç¤ï¤»¤ë¡Ë
21define("MDL_PAYGENT_ID", 9);
22
23// ¥Ú¥¤¥¸¥§¥ó¥È¤Î³Æʧ¹þ¤ÎÂбþÈÖ¹æ
24/*
25    ÅÅʸ¼ïÊ̤òɽ¤¹¶èʬ
26    010¡§ATM·èºÑ¿½¹þ
27    020¡§Ž¶Ž°ŽÄŽÞ·èºÑŽµŽ°Ž¿ŽØ
28    021¡§Ž¶Ž°ŽÄŽÞ·èºÑŽµŽ°Ž¿ŽØŽ·Ž¬ŽÝŽ¾ŽÙ
29    022¡§Ž¶Ž°ŽÄŽÞ·èºÑÇä¾å
30    023¡§Ž¶Ž°ŽÄŽÞ·èºÑÇä¾åŽ·Ž¬ŽÝŽ¾ŽÙ
31    024¡§Ž¶Ž°ŽÄŽÞ·èºÑ3DŽµŽ°Ž¿ŽØ
32    030¡§ŽºŽÝŽËŽÞŽÆ·èºÑ(ÈÖ¹æÊý¼°)¿½¹þ
33    040¡§ŽºŽÝŽËŽÞŽÆ·èºÑ(ʧ¹þɼÊý¼°)¿½¹þ
34    050¡§¶ä¹ÔŽÈŽ¯ŽÄ·èºÑ¿½¹þ
35    060¡§¶ä¹Ô¥Í¥Ã¥È·èºÑASP
36    090¡§·èºÑ¾ðÊó¾È²ñ
37 */
38define("PAYGENT_BANK", '050');
39define("PAYGENT_ATM", '010');
40define("PAYGENT_CONVENI", '030');
41define("PAYGENT_CREDIT", '020');
42
43// »Ùʧ¤¤ÊýË¡¤Î̾Á°
44define("MDL_PAYGENT_CREDIT_NAME", "PAYGENT¥¯¥ì¥¸¥Ã¥È·èºÑ");
45define("MDL_PAYGENT_CONVENI_NAME", "PAYGENT¥³¥ó¥Ó¥Ë·èºÑ");
46
47define ("CHARGE_MAX", 500000);
48define ("SEVEN_CHARGE_MAX", 300000);
49
50// ÅÅʸ¥Ð¡¼¥¸¥ç¥ó
51define ("TELEGRAM_VERSION", '1.0');
52
53//¥³¥ó¥Ó¥Ë¤Î¼ïÎà
54$arrConvenience = array(
55    '00C016' => '¥»¥¤¥³¡¼¥Þ¡¼¥È',
56    '00C002' => '¥í¡¼¥½¥ó',
57    '00C004' => '¥ß¥Ë¥¹¥È¥Ã¥×',
58    '00C005' => '¥Õ¥¡¥ß¥ê¡¼¥Þ¡¼¥È',
59    '00C006' => '¥µ¥ó¥¯¥¹',
60    '00C007' => '¥µ¡¼¥¯¥ëK',
61    '00C014' => '¥Ç¥¤¥ê¡¼¥ä¥Þ¥¶¥­',
62    '00C001' => '¥»¥Ö¥ó¥¤¥ì¥Ö¥ó'
63);
64   
65// ¥Í¥Ã¥È¥Ð¥ó¥¯¤Î¼ïÎà
66$arrNetBank = array(
67    'D005' => 'e-payment',
68    'D008' => '¥Í¥Ã¥È¿¶¹þEDI',
69    'D009' => 'One\'s ¥À¥¤¥ì¥¯¥È',
70    'D033' => '¥¸¥ã¥Ñ¥ó¥Í¥Ã¥È¶ä¹Ô',
71    'D036' => '¥¤¡¼¥Ð¥ó¥¯' 
72);
73   
74// ¥¯¥ì¥¸¥Ã¥Èʬ³ä²ó¿ô
75$arrPaymentClass = array(
76    '10' => '°ì³çʧ¤¤',
77    '61-2' => 'ʬ³ä2²óʧ¤¤',
78    '61-3' => 'ʬ³ä3²óʧ¤¤',
79    '61-6' => 'ʬ³ä6²óʧ¤¤',
80    '61-10' => 'ʬ³ä10²óʧ¤¤',
81    '61-15' => 'ʬ³ä15²óʧ¤¤',
82    '61-20' => 'ʬ³ä20²óʧ¤¤',
83    '80' => '¥ê¥Üʧ¤¤'
84);
85
86/**************************************************************************************************************
87 * ´Ø¿ô̾   ¡§sfGetPaygentShare
88 * ½èÍýÆâÍÆ ¡§¥Ú¥¤¥¸¥§¥ó¥È¾ðÊóÁ÷¿®¤Î¶¦Ä̽èÍý
89 * °ú¿ô1    ¡§
90 * °ú¿ô2    ¡§
91 * °ú¿ô3    ¡§
92 * Ìá¤êÃÍ   ¡§¼èÆÀ·ë²Ì
93 **************************************************************************************************************/
94function sfGetPaygentShare($telegram_kind, $arrData, $arrParam) {
95   
96    /** ¶¦ÄÌÅÅʸ **/   
97    // ¥Þ¡¼¥Á¥ã¥ó¥ÈID
98    $arrSend['merchant_id'] = $arrParam['merchant_id'];
99    // ÀܳID
100    $arrSend['connect_id'] = $arrParam['connect_id'];
101    // Àܳ¥Ñ¥¹¥ï¡¼¥É
102    $arrSend['connect_password'] = $arrParam['connect_password'];
103    // ÅÅʸ¼ïÊÌID
104    $arrSend['telegram_kind'] = $telegram_kind;
105    // ÅÅʸ¥Ð¡¼¥¸¥ç¥ó
106    $arrSend['telegram_version'] = TELEGRAM_VERSION;
107    // ¥Þ¡¼¥Á¥ã¥ó¥È¼è°úID
108    $arrSend['trading_id'] = $arrData['order_id'];
109
110    return $arrSend;
111}
112   
113/**************************************************************************************************************
114 * ´Ø¿ô̾   ¡§sfSendPaygentCredit
115 * ½èÍýÆâÍÆ ¡§¥¯¥ì¥¸¥Ã¥È¾ðÊó¤ÎÁ÷¿®
116 * °ú¿ô1    ¡§
117 * °ú¿ô2    ¡§
118 * °ú¿ô3    ¡§
119 * Ìá¤êÃÍ   ¡§¼èÆÀ·ë²Ì
120 **************************************************************************************************************/
121function sfSendPaygentCredit($arrData, $arrInput, $uniqid) {
122// Àܳ¥â¥¸¥å¡¼¥ë¤Î¥¤¥ó¥¹¥¿¥ó¥¹¼èÆÀ (¥³¥ó¥¹¥È¥é¥¯¥¿)¤È½é´ü²½
123    $p = new PaygentB2BModule();
124    $p->init();
125   
126    //¡¡¥¯¥ì¥¸¥Ã¥ÈÍѥѥé¥á¡¼¥¿¤Î¼èÆÀ
127    $arrPaymentDB = sfGetPaymentDB(MDL_PAYGENT_ID, "AND memo03 = 1");
128    $arrOtherParam = unserialize($arrPaymentDB[0]['other_param']);
129   
130    // ¶¦Ḁ̈ǡ¼¥¿¤Î¼èÆÀ
131    $arrSend = sfGetPaygentShare(PAYGENT_CREDIT, $arrData, $arrPaymentDB[0]);
132   
133    /** ¸ÄÊÌÅÅʸ **/
134   
135    // ·èºÑ¶â³Û
136    $arrSend['payment_amount'] = $arrData['payment_total'];
137    // ¥«¡¼¥ÉÈÖ¹æ
138    $arrSend['card_number'] = $arrInput['card_no01'].$arrInput['card_no02'].$arrInput['card_no03'].$arrInput['card_no04'];
139    // ¥«¡¼¥ÉÍ­¸ú´ü¸Â(MMYY)
140    $arrSend['card_valid_term'] = $arrInput['card_month'].$arrInput['card_year'];
141    // »Ùʧ¤¤¶èʬ¡¢Ê¬³ä²ó¿ô¤Î¼èÆÀ
142    list($payment_class, $split_count) = split("-", $arrInput['payment_class']);
143       
144    // »Ùʧ¤¤¶èʬ
145    /*
146     * 10:1²ó
147     * 23:¥Ü¡¼¥Ê¥¹1²ó
148     * 61:ʬ³ä
149     * 80:¥ê¥Ü¥ë¥Ó¥ó¥°
150     */
151    $arrSend['payment_class'] = $payment_class;
152    // ʬ³ä²ó¿ô
153    $arrSend['split_count'] = $split_count;
154    // 3D¥»¥­¥å¥¢ÉÞÍܶèʬ
155    $arrSend['3dsecure_ryaku'] = '1';
156   
157    // ÅÅʸ¤ÎÁ÷ÉÕ
158    foreach($arrSend as $key => $val) {
159        $p->reqPut($key, $val);
160    }
161   
162    // ÅÅʸ¤ÎÁ÷¿®
163    $p->post();
164
165    // ±þÅú¤ò½èÍý
166    $arrRet = sfPaygentResponse(PAYGENT_CREDIT, $p, $uniqid);
167   
168    return $arrRet;
169}
170
171/**************************************************************************************************************
172 * ´Ø¿ô̾   ¡§sfSendPaygentConveni
173 * ½èÍýÆâÍÆ ¡§¥³¥ó¥Ó¥Ë¾ðÊó¤ÎÁ÷¿®
174 * °ú¿ô1    ¡§
175 * °ú¿ô2    ¡§
176 * °ú¿ô3    ¡§
177 * Ìá¤êÃÍ   ¡§¼èÆÀ·ë²Ì
178 **************************************************************************************************************/
179function sfSendPaygentConveni($arrData, $arrInput, $uniqid) {
180// Àܳ¥â¥¸¥å¡¼¥ë¤Î¥¤¥ó¥¹¥¿¥ó¥¹¼èÆÀ (¥³¥ó¥¹¥È¥é¥¯¥¿)¤È½é´ü²½
181    $p = new PaygentB2BModule();
182    $p->init();
183   
184    //¡¡¥³¥ó¥Ó¥ËÍѥѥé¥á¡¼¥¿¤Î¼èÆÀ
185    $arrPaymentDB = sfGetPaymentDB(MDL_PAYGENT_ID, "AND memo03 = 2");
186    $arrOtherParam = unserialize($arrPaymentDB[0]['other_param']);
187   
188    // ¶¦Ḁ̈ǡ¼¥¿¤Î¼èÆÀ
189    $arrSend = sfGetPaygentShare(PAYGENT_CONVENI, $arrData, $arrPaymentDB[0]);
190   
191    /** ¸ÄÊÌÅÅʸ **/
192   
193    // ·èºÑ¶â³Û
194    $arrSend['payment_amount'] = $arrData['payment_total'];
195    // ÍøÍѼÔÀ«
196    $arrSend['customer_family_name'] = $arrInput['customer_family_name'];
197    // ÍøÍѼÔ̾
198    $arrSend['customer_name'] = $arrInput['customer_name'];
199    // ÍøÍѼÔÀ«È¾³Ñ¥«¥Ê
200    $arrSend['customer_family_name_kana'] = mb_convert_kana($arrInput['customer_family_name_kana'],'k');
201    // ÍøÍѼÔ̾Ⱦ³Ñ¥«¥Ê
202    $arrSend['customer_name_kana'] = mb_convert_kana($arrInput['customer_name_kana'],'k');
203    // ÍøÍѼÔÅÅÏÃÈÖ¹æ
204    $arrSend['customer_tel'] = $arrInput['customer_tel'];
205    // »Ùʧ´ü¸ÂÆü
206    $arrSend['payment_limit_date'] = $arrOtherParam['payment_limit_date'];
207    // ¥³¥ó¥Ó¥Ë´ë¶È¥³¡¼¥É
208    $arrSend['cvs_company_id'] = $arrInput['cvs_company_id'];
209    // »Ùʧ¼ïÊÌ
210    $arrSend['sales_type'] = '1';
211   
212    // ÅÅʸ¤ÎÁ÷ÉÕ
213    foreach($arrSend as $key => $val) {
214        // Shift-JIS¤Ë¥¨¥ó¥³¡¼¥É¤¹¤ëɬÍפ¢¤ê
215        $enc_val = mb_convert_encoding($val, "Shift-JIS", CHAR_CODE);       
216        $p->reqPut($key, $enc_val);
217    }
218   
219    // ÅÅʸ¤ÎÁ÷¿®
220    $p->post();
221
222    // ±þÅú¤ò½èÍý
223    $arrRet = sfPaygentResponse(PAYGENT_CONVENI, $p, $uniqid);
224       
225    return $arrRet;
226}
227
228/**************************************************************************************************************
229 * ´Ø¿ô̾   ¡§sfSendPaygentATM
230 * ½èÍýÆâÍÆ ¡§ATM·èºÑ¾ðÊó¤ÎÁ÷¿®
231 * °ú¿ô1    ¡§
232 * °ú¿ô2    ¡§
233 * °ú¿ô3    ¡§
234 * Ìá¤êÃÍ   ¡§¼èÆÀ·ë²Ì
235 **************************************************************************************************************/
236function sfSendPaygentATM($arrData, $arrInput, $uniqid) {
237// Àܳ¥â¥¸¥å¡¼¥ë¤Î¥¤¥ó¥¹¥¿¥ó¥¹¼èÆÀ (¥³¥ó¥¹¥È¥é¥¯¥¿)¤È½é´ü²½
238    $p = new PaygentB2BModule();
239    $p->init();
240   
241    //¡¡ATM·èºÑÍѥѥé¥á¡¼¥¿¤Î¼èÆÀ
242    $arrPaymentDB = sfGetPaymentDB(MDL_PAYGENT_ID, "AND memo03 = 3");
243    $arrOtherParam = unserialize($arrPaymentDB[0]['other_param']);
244   
245    // ¶¦Ḁ̈ǡ¼¥¿¤Î¼èÆÀ
246    $arrSend = sfGetPaygentShare(PAYGENT_ATM, $arrData, $arrPaymentDB[0]);
247   
248   
249    /** ¸ÄÊÌÅÅʸ **/
250   
251    // ·èºÑ¶â³Û
252    $arrSend['payment_amount'] = $arrData['payment_total'];
253
254    // ÍøÍѼÔÀ«
255    $arrSend['customer_family_name'] = $arrInput['customer_family_name'];
256    // ÍøÍѼÔ̾
257    $arrSend['customer_name'] = $arrInput['customer_name'];
258    // ÍøÍѼÔÀ«È¾³Ñ¥«¥Ê
259    $arrSend['customer_family_name_kana'] = mb_convert_kana($arrInput['customer_family_name_kana'],'k');
260    // ÍøÍѼÔ̾Ⱦ³Ñ¥«¥Ê
261    $arrSend['customer_name_kana'] = mb_convert_kana($arrInput['customer_name_kana'],'k');
262    // ·èºÑÆâÍÆ
263    $arrSend['payment_detail'] = $arrOtherParam['payment_detail'];
264    // ·èºÑÆâÍÆȾ³Ñ¥«¥Ê
265    $arrSend['payment_detail_kana'] = mb_convert_kana($arrOtherParam['payment_detail'],'k');
266    // »Ùʧ´ü¸ÂÆü
267    $arrSend['payment_limit_date'] = $arrOtherParam['payment_limit_date'];
268   
269    // ÅÅʸ¤ÎÁ÷ÉÕ
270    foreach($arrSend as $key => $val) {
271        // Shift-JIS¤Ë¥¨¥ó¥³¡¼¥É¤¹¤ëɬÍפ¢¤ê
272        $enc_val = mb_convert_encoding($val, "Shift-JIS", CHAR_CODE);       
273        $p->reqPut($key, $enc_val);
274    }
275   
276    // ÅÅʸ¤ÎÁ÷¿®
277    $p->post();
278   
279    // ±þÅú¤ò½èÍý
280    $arrRet = sfPaygentResponse(PAYGENT_ATM, $p, $uniqid);
281   
282    return $arrRet;
283}
284
285/**************************************************************************************************************
286 * ´Ø¿ô̾   ¡§sfSendPaygentBANK
287 * ½èÍýÆâÍÆ ¡§¶ä¹ÔNET·èºÑ¾ðÊó¤ÎÁ÷¿®
288 * °ú¿ô1    ¡§
289 * °ú¿ô2    ¡§
290 * °ú¿ô3    ¡§
291 * Ìá¤êÃÍ   ¡§¼èÆÀ·ë²Ì
292 **************************************************************************************************************/
293function sfSendPaygentBANK($arrData, $arrInput, $uniqid) {
294// Àܳ¥â¥¸¥å¡¼¥ë¤Î¥¤¥ó¥¹¥¿¥ó¥¹¼èÆÀ (¥³¥ó¥¹¥È¥é¥¯¥¿)¤È½é´ü²½
295    $p = new PaygentB2BModule();
296    $p->init();
297   
298    //¡¡¶ä¹ÔNETÍѥѥé¥á¡¼¥¿¤Î¼èÆÀ
299    $arrPaymentDB = sfGetPaymentDB(MDL_PAYGENT_ID, "AND memo03 = 4");
300    $arrOtherParam = unserialize($arrPaymentDB[0]['other_param']);
301   
302    // ¶¦Ḁ̈ǡ¼¥¿¤Î¼èÆÀ
303    $arrSend = sfGetPaygentShare(PAYGENT_BANK, $arrData, $arrPaymentDB[0]);
304
305    /** ¸ÄÊÌÅÅʸ **/
306   
307    $arrSend['bank_code'] = $arrInput['bank_code'];
308    // ·èºÑ¶â³Û
309    $arrSend['amount'] = $arrData['payment_total'];
310    // ÀÁµáÆâÍÆ¥«¥Ê
311    $arrSend['claim_kana'] = '¥«¥Ê';
312    // ÀÁµáÆâÍÆ´Á»ú
313    $arrSend['claim_kanji'] = '´Á»ú';   
314    // ÍøÍѼÔÀ«
315    $arrSend['customer_family_name'] = $arrInput['customer_family_name'];
316    // ÍøÍѼÔ̾
317    $arrSend['customer_name'] = $arrInput['customer_name'];
318    // ÍøÍѼÔÀ«È¾³Ñ¥«¥Ê
319    $arrSend['customer_family_name_kana'] = mb_convert_kana($arrInput['customer_family_name_kana'],'k');
320    // ÍøÍѼÔ̾Ⱦ³Ñ¥«¥Ê
321    $arrSend['customer_name_kana'] = mb_convert_kana($arrInput['customer_name_kana'],'k');
322    // PC-Mobile¶èʬ
323    /*
324     * 0:PC
325     * 1:docomo
326     * 2:au
327     * 3:softbank
328     */
329    $arrSend['pc_mobile_type'] = '0';
330    // Ìá¤ê£Õ£Ò£Ì
331    $arrSend['return_url'] = "http://www.ec-cube.net/";
332       
333    // ÅÅʸ¤ÎÁ÷ÉÕ
334    foreach($arrSend as $key => $val) {
335        // Shift-JIS¤Ë¥¨¥ó¥³¡¼¥É¤¹¤ëɬÍפ¢¤ê
336        $enc_val = mb_convert_encoding($val, "Shift-JIS", CHAR_CODE);
337        $p->reqPut($key, $enc_val);
338    }
339   
340    // ÅÅʸ¤ÎÁ÷¿®
341    $p->post();
342   
343    // ±þÅú¤ò½èÍý
344    $arrRet = sfPaygentResponse(PAYGENT_BANK, $p, $uniqid);
345   
346    return $arrRet;
347}
348
349/**************************************************************************************************************
350 * ´Ø¿ô̾   ¡§sfPaygentResponse
351 * ½èÍýÆâÍÆ ¡§±þÅú¤ò½èÍý¤¹¤ë
352 * °ú¿ô1    ¡§
353 * °ú¿ô2    ¡§
354 * °ú¿ô3    ¡§
355 * Ìá¤êÃÍ   ¡§¼èÆÀ·ë²Ì
356 **************************************************************************************************************/
357
358function sfPaygentResponse($telegram_kind, $objPaygent, $uniqid) {
359    global $arrConvenience;
360   
361    // ½èÍý·ë²Ì¼èÆÀ¡Ê¶¦ÄÌ¡Ë
362    $resultStatus = $objPaygent->getResultStatus(); # ½èÍý·ë²Ì 0=Àµ¾ï½ªÎ», 1=°Û¾ï½ªÎ»
363    $responseCode = $objPaygent->getResponseCode(); # °Û¾ï½ªÎ»»þ¡¢¥ì¥¹¥Ý¥ó¥¹¥³¡¼¥É¤¬¼èÆÀ¤Ç¤­¤ë
364    $responseDetail = $objPaygent->getResponseDetail(); # °Û¾ï½ªÎ»»þ¡¢¥ì¥¹¥Ý¥ó¥¹¾ÜºÙ¤¬¼èÆÀ¤Ç¤­¤ë
365
366    // Shift-JIS¤Ç±þÅú¤¬¤¢¤ë¤Î¤Ç¡¢¥¨¥ó¥³¡¼¥É¤¹¤ë¡£
367    $responseDetail = mb_convert_encoding($responseDetail, CHAR_CODE, "Shift-JIS");
368       
369   
370    // ¥ì¥¹¥Ý¥ó¥¹¤Î¼èÆÀ
371    while($objPaygent->hasResNext()) {
372        # ¥Ç¡¼¥¿¤¬Â¸ºß¤¹¤ë¸Â¤ê¡¢¼èÆÀ
373        $arrRes[] = $objPaygent->resNext(); # Í×µá·ë²Ì¼èÆÀ
374    }
375
376    switch($telegram_kind) {
377    // ¥³¥ó¥Ó¥Ë·èºÑ¤Î¾ì¹ç
378    case PAYGENT_CONVENI:       
379        // ¥¿¥¤¥È¥ë¤òÀßÄꤹ¤ë
380        $arrMemo['title'] = sfSetConvMSG("¥³¥ó¥Ó¥Ë¤ª»Ùʧ¾ðÊó", true);   
381        //ʧ¹þɼURL(PC)
382        if($arrRes[0]['receipt_print_url'] != "") {
383            $arrMemo['receipt_print_url'] = sfSetConvMSG("ʧ¹þɼURL", $arrRes[0]['receipt_print_url']);
384        }
385        //ʧ¹þɼÈÖ¹æ
386        $arrMemo['receipt_number'] = sfSetConvMSG("ʧ¹þɼÈÖ¹æ", $arrRes[0]['receipt_number']);
387        $arrCVS = split("-", $arrRes[0]['usable_cvs_company_id']);
388        foreach($arrCVS as $val) {
389            if($cvsLine != "") {
390                $cvsLine.= ",".$arrConvenience[$val];               
391            } else {
392                $cvsLine = $arrConvenience[$val];
393            }
394        }
395        //Âоݥ³¥ó¥Ó¥Ë
396        $arrMemo['usable_cvs_company_id'] = sfSetConvMSG("¤ª»Ùʧ²Äǽ¤Ê¥³¥ó¥Ó¥Ë", $cvsLine);         
397        // »Ùʧ´üÆü
398        $arrMemo['payment_limit_date'] = sfSetConvMSG("¤ª»Ùʧ´üÆü", date("Yǯm·îdÆü", strtotime($arrRes[0]['payment_limit_date'])));
399        // ¼õÃí¥Æ¡¼¥Ö¥ë¤ËÊݸ
400        $arrVal["memo02"] = serialize($arrMemo);
401        break;
402    // ATM·èºÑ¤Î¾ì¹ç
403    case PAYGENT_ATM:
404        // ¥¿¥¤¥È¥ë¤òÀßÄꤹ¤ë
405        $arrMemo['title'] = sfSetConvMSG("ATM¤ª»Ùʧ¾ðÊó", true);   
406        $arrMemo['pay_center_number'] = sfSetConvMSG("¼ýǼµ¡´ØÈÖ¹æ", $arrRes[0]['pay_center_number']);
407        $arrMemo['customer_number'] = sfSetConvMSG("¤ªµÒÍÍÈÖ¹æ", $arrRes[0]['customer_number']);
408        $arrMemo['conf_number'] = sfSetConvMSG("³ÎǧÈÖ¹æ", $arrRes[0]['pay_center_number']);
409        // »Ùʧ´üÆü
410        $arrMemo['payment_limit_date'] = sfSetConvMSG("¤ª»Ùʧ´üÆü", date("Yǯm·îdÆü", strtotime($arrRes[0]['payment_limit_date'])));
411        // ¼õÃí¥Æ¡¼¥Ö¥ë¤ËÊݸ
412        $arrVal["memo02"] = serialize($arrMemo);       
413        break;
414    default:
415        // ¶õ¤ÎÇÛÎó¤ò³ÊǼ¤·¤Æ¤ª¤¯
416        $arrVal["memo02"] = serialize(array());
417        break;
418    }
419   
420    // ¼õÃí¥Æ¡¼¥Ö¥ë¤Ëµ­Ï¿¤¹¤ë
421    $arrVal["memo01"] = $resultStatus;      // ½èÍý·ë²Ì
422    $arrVal["memo03"] = $responseCode;      // ¥ì¥¹¥Ý¥ó¥¹¥³¡¼¥É
423    $arrVal["memo04"] = $responseDetail;    // ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸
424    $arrVal["memo05"] = $arrRes[0]['payment_id'];       // ¾µÇ§ÈÖ¹æ
425
426    // ¼õÃí°ì»þ¥Æ¡¼¥Ö¥ë¤Ë¹¹¿·
427    sfRegistTempOrder($uniqid, $arrVal);
428   
429    // ¾µÇ§ÈÖ¹æ¤È¥á¥Ã¥»¡¼¥¸¤òÊÖ¤¹
430    return $arrRes[0];
431}
432
433/**************************************************************************************************************
434 * ´Ø¿ô̾   ¡§sfSetConvMSG
435 * ½èÍýÆâÍÆ ¡§¥³¥ó¥Ó¥Ë¾ðÊóɽ¼¨ÍÑ
436 * °ú¿ô1    ¡§
437 * °ú¿ô2    ¡§
438 * °ú¿ô3    ¡§
439 * Ìá¤êÃÍ   ¡§¼èÆÀ·ë²Ì
440 **************************************************************************************************************/
441function sfSetConvMSG($name, $value){
442    return array("name" => $name, "value" => $value);
443}
444
445/**************************************************************************************************************
446 * ´Ø¿ô̾   ¡§sfPaygentDisp
447 * ½èÍýÆâÍÆ ¡§¶¦Ä̤Îɽ¼¨½èÍý
448 * °ú¿ô1    ¡§
449 * °ú¿ô2    ¡§
450 * °ú¿ô3    ¡§
451 * Ìá¤êÃÍ   ¡§¼èÆÀ·ë²Ì
452 **************************************************************************************************************/
453function sfPaygentDisp($objPage, $payment_id) {
454    $objQuery = new SC_Query();
455    // »Ùʧ¤¤ÊýË¡¤ÎÀâÌÀ²èÁü¤ò¼èÆÀ¤¹¤ë¡£
456    $arrRet = $objQuery->select("payment_method, payment_image", "dtb_payment", "payment_id = ?", array($payment_id));
457    $objPage->tpl_payment_method = $arrRet[0]['payment_method'];
458    $objPage->tpl_payment_image = $arrRet[0]['payment_image'];
459    return $objPage;
460}
461
462/**************************************************************************************************************
463 * ´Ø¿ô̾   ¡§sfGetPaymentDB
464 * ½èÍýÆâÍÆ ¡§É¬Íפʥǡ¼¥¿¤ò¼èÆÀ¤¹¤ë¡£
465 * °ú¿ô1    ¡§
466 * °ú¿ô2    ¡§
467 * °ú¿ô3    ¡§
468 * Ìá¤êÃÍ   ¡§¼èÆÀ·ë²Ì
469 **************************************************************************************************************/
470function sfGetPaymentDB($module_id, $where, $arrWhereVal = array()){
471    $objQuery = new SC_Query();
472       
473    $arrVal = array($module_id);
474    $arrVal = array_merge($arrVal, $arrWhereVal);
475   
476    $arrRet = array();
477    $sql = "SELECT
478                module_id,
479                memo01 as merchant_id,
480                memo02 as connect_id,
481                memo03 as payment,
482                memo04 as connect_password,
483                memo05 as other_param
484            FROM dtb_payment WHERE module_id = ? " . $where;
485    $arrRet = $objQuery->getall($sql, $arrVal);
486
487    return $arrRet;
488}
489?>
Note: See TracBrowser for help on using the repository browser.