| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | require_once("../../require.php"); |
|---|
| 4 | require_once(DATA_PATH . "module/Request.php"); |
|---|
| 5 | |
|---|
| 6 | $order_url = "http://beta.epsilon.jp/cgi-bin/order/receive_order3.cgi"; |
|---|
| 7 | |
|---|
| 8 | $arrData = array( |
|---|
| 9 | 'order_number' => '93963923', |
|---|
| 10 | 'st_code' => '10100-0000-00000', |
|---|
| 11 | 'memo1' => '»î¸³ÍÑ¥ª¡¼¥À¡¼¾ðÊó', |
|---|
| 12 | 'user_mail_add' => '[email protected]', |
|---|
| 13 | 'item_name' => '¥×¥ê¥ó¥¿', |
|---|
| 14 | 'contract_code' => '13094800', |
|---|
| 15 | 'user_name' => 'naka', |
|---|
| 16 | 'process_code' => '2', |
|---|
| 17 | 'mission_code' => '1', |
|---|
| 18 | 'item_price' => '34800', |
|---|
| 19 | 'xml' => '1', |
|---|
| 20 | 'item_code' => 'abc12345', |
|---|
| 21 | 'memo2' => '', |
|---|
| 22 | 'user_id' => 'test' |
|---|
| 23 | ); |
|---|
| 24 | |
|---|
| 25 | $req = new HTTP_Request($order_url); |
|---|
| 26 | $req->setMethod(HTTP_REQUEST_METHOD_POST); |
|---|
| 27 | |
|---|
| 28 | $arrSendData = array(); |
|---|
| 29 | $req->addPostDataArray($arrData); |
|---|
| 30 | |
|---|
| 31 | if (!PEAR::isError($req->sendRequest())) { |
|---|
| 32 | $response = $req->getResponseBody(); |
|---|
| 33 | } else { |
|---|
| 34 | $response = ""; |
|---|
| 35 | } |
|---|
| 36 | $req->clearPostData(); |
|---|
| 37 | |
|---|
| 38 | $parser = xml_parser_create(); |
|---|
| 39 | xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1); |
|---|
| 40 | xml_parse_into_struct($parser,$response,$arrVal,$idx); |
|---|
| 41 | xml_parser_free($parser); |
|---|
| 42 | |
|---|
| 43 | //sfPrintR($arrVal); |
|---|
| 44 | |
|---|
| 45 | /* |
|---|
| 46 | $decode = urldecode($arrVal[3]['attributes']['ERR_DETAIL']); |
|---|
| 47 | |
|---|
| 48 | print(mb_convert_encoding($decode, 'EUC-JP', 'Shift_JIS')); |
|---|
| 49 | |
|---|
| 50 | $decode = urldecode($arrVal[4]['attributes']['MEMO1']); |
|---|
| 51 | |
|---|
| 52 | print(mb_convert_encoding($decode, 'EUC-JP', 'Shift_JIS')); |
|---|
| 53 | */ |
|---|
| 54 | |
|---|
| 55 | ?> |
|---|