質問 > フロント機能 > EC-CUBE2 ソフトバンクペイメントへの接続について |
フロント機能
フラット表示 | 前のトピック | 次のトピック |
投稿者 | スレッド |
---|---|
12AI24 |
投稿日時: 2023/1/10 18:31
対応状況: −−−
|
常連 登録日: 2017/3/8 居住地: 投稿: 31 |
EC-CUBE2 ソフトバンクペイメントへの接続について 現在、EC-CUBEの2.13系で、決済処理を組み込んでいます
他のサーバーでソフトバンクペイメントへの接続ができたため、同じように組み込んだところ、エラーが出ます。 何が原因かお教えください。 const PAYMENT_URL = "https://stbfep.sps-system.com/api/xmlapi.do"; $postXML = "<?xml version="1.0" encoding="Shift_JIS"?>" . "<sps-api-request id="ST11-00111-101">" . "・・・・決済情報"; // 接続URL $url = PAYMENT_URL; // データ送信処理 $ch = curl_init(); $merchant_id = mb_convert_encoding(MERCHANT_ID, 'Shift_JIS', 'UTF-8'); $service_id = mb_convert_encoding(SERVICE_ID, 'Shift_JIS', 'UTF-8'); $hashkey = mb_convert_encoding(HASH_KEY, 'Shift_JIS', 'UTF-8'); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERPWD, $merchant_id . $service_id . ":" . $hashkey); curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml')); curl_setopt($ch, CURLOPT_SSLVERSION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_POSTFIELDS, $postXml); $result = curl_exec( $ch ); if(curl_errno($ch) > 0){ } else { $xml = simplexml_load_string( $result ); // ここでエラーが発生する } [エラー内容] <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>401 Unauthorized</title> </head><body> <h1>Unauthorized</h1> <p>This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn\'t understand how to supply the credentials required.</p> </body></html> $postXMLの内容は、他のサーバーでは、同じパラメータを送信した場合、正常に決済処理を行うことができます。 環境は、UTF-8です、よろしくお願いします。 |
フラット表示 | 前のトピック | 次のトピック |
題名 | 投稿者 | 日時 |
---|---|---|
» EC-CUBE2 ソフトバンクペイメントへの接続について | 12AI24 | 2023/1/10 18:31 |
Re: EC-CUBE2 ソフトバンクペイメントへの接続について | mcontact | 2023/1/10 18:54 |
Re: EC-CUBE2 ソフトバンクペイメントへの接続について | 12AI24 | 2023/1/10 19:08 |
Re: EC-CUBE2 ソフトバンクペイメントへの接続について | mcontact | 2023/1/11 10:51 |
Re: EC-CUBE2 ソフトバンクペイメントへの接続について | 12AI24 | 2023/1/11 11:11 |