source: temp/trunk/html/test/naka/shopcgi.php @ 7782

Revision 7782, 3.0 KB checked in by naka, 20 years ago (diff)

* empty log message *

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?php
2
3require_once("../../require.php");
4require_once(DATA_PATH . "module/Request.php");
5
6/*
7
8from index2.html
9
10Array
11(
12    [TenantNo] => 11111111
13    [OrderId] => 2006-11-08-11-39-53-966
14    [JobCd] => CHECK
15    [Amount] =>
16    [Tax] =>
17    [Currency] =>
18    [Memo] =>
19)
20
21*/
22
23/*
24
25¥»¥ó¥¿¤Ø¤ÎÁ÷¿®¥Ç¡¼¥¿
26
27OrderId=>2006-11-08-12-43-21-935
28TdTenantName=>
29TdFlag=>
30ShopId=>test
31Amount=>0
32ShopPass=>test
33Currency=>
34Tax=>0
35JobCd=>CHECK
36TenantNo=>TenantNo
37
38*/
39
40$entry_url = "http://mod-i.ccsware.net/ohayou/EntryTran.php";
41$exec_url = "http://mod-i.ccsware.net/ohayou/ExecTran.php";
42$order_id = sfGetUniqRandomId();
43
44// ŹÊÞ¾ðÊó¤ÎÁ÷¿®
45$arrData = array(
46    'OrderId' => $order_id,     // ŹÊÞ¤´¤È¤Ë°ì°Õ¤ÊÃíʸID¤òÁ÷¿®¤¹¤ë¡£
47    'TdTenantName' => '',
48    'TdFlag' => '',
49    'ShopId' => 'test',
50    'Amount' => '100',
51    'ShopPass' => 'test',
52    'Currency' => 'JPN',
53    'Tax' => '5',
54    'JobCd' => 'CHECK',
55    'TenantNo' => '111111111',  // cgi-4¤ÇºîÀ®¤·¤¿Å¹ÊÞID¤òÁ÷¿®¤¹¤ë¡£
56);
57
58$req = new HTTP_Request($entry_url);
59$req->setMethod(HTTP_REQUEST_METHOD_POST);
60       
61$req->addPostDataArray($arrData);
62
63if (!PEAR::isError($req->sendRequest())) {
64    $response = $req->getResponseBody();
65} else {
66    $response = "";
67}
68$req->clearPostData();
69
70if($response != "") {
71    $response = ereg_replace("[\n\r]", "", $response);
72    $arrTemp = split("&", $response);
73    foreach($arrTemp as $ret) {
74        list($key, $val) = split("=", $ret);
75        $arrRet[$key] = $val;
76    }
77}
78
79sfPrintR($arrRet);
80
81// ·èºÑ¾ðÊó¤ÎÁ÷¿®
82/*
83    [AccessId] => 60f511479544541eb1ec9dc6f700b8c1
84    [AccessPass] => 925a413ce991e7b9230fbc575b9dc430
85    [OrderId] => 2006-11-08-13-08-07-732
86    [RetURL] => http://test.ec-cube.net/cgi-bin/ShopCGI/cgi-1/ShopBuy.pl
87    [CardType] => VISA,     11111, 111111111111111111111111111111111111, 1111111111
88    [Method] => 2
89    [PayTimes] => 4
90    [CardNo1] => 4111
91    [CardNo2] => 1111
92    [CardNo3] => 1111
93    [CardNo4] => 1111
94    [ExpireMM] => 06
95    [ExpireYY] => 07
96    [ClientFieldFlag] => 1
97    [ClientField1] => f1
98    [ClientField2] => f2
99    [ClientField3] => f3
100*/
101$arrData = array(
102    'AccessId' => $arrRet['ACCESS_ID'],
103    'AccessPass' => $arrRet['ACCESS_PASS'],
104    'OrderId' => sfGetUniqRandomId(),
105    'RetURL' => 'http://test.ec-cube.net/ec-cube/test/naka/recv.php',
106    'CardType' => 'VISA,     11111, 111111111111111111111111111111111111, 1111111111',
107    'Method' => '2',
108    'PayTimes' => '4',
109    'CardNo1' => '4111',
110    'CardNo2' => '1111',
111    'CardNo3' => '1111',
112    'CardNo4' => '1111',
113    'ExpireMM' => '06',
114    'ExpireYY' => '07',
115    'ClientFieldFlag' => '1',
116    'ClientField1' => 'f1',
117    'ClientField2' => 'f2',
118    'ClientField3' => 'f3'
119);
120
121sfPrintR($arrData);
122
123$req = new HTTP_Request($exec_url);
124$req->setMethod(HTTP_REQUEST_METHOD_POST);
125
126$req->addPostDataArray($arrData);
127
128if (!PEAR::isError($req->sendRequest())) {
129    $response = $req->getResponseBody();
130} else {
131    $response = "";
132}
133$req->clearPostData();
134
135/*
136if($response != "") {
137    $arrTemp = split("&", $response);
138    foreach($arrTemp as $ret) {
139        list($key, $val) = split("=", $ret);
140        $arrRet[$key] = $val;
141    }
142}
143*/
144sfPrintR($response);
145?>
Note: See TracBrowser for help on using the repository browser.