0

magento.i에서 authorized.net의 정기 구독을 만들고 있습니다. 구독을 성공적으로 만들었습니다. 가입을 취소하고 xml을 전달하는 옵션을 추가했으나이를 수락하지 않습니다.HTTP/1.1 405 메서드가 허용되지 않습니다. authorized.net 허용

   $loginname="******"; 
      $transactionkey="*******"; 
      $host = "apitest.authorize.net"; 

        $content= 
        "<?xml version=\"1.0\" encoding=\"utf-8\"?>". 
        "<ARBCancelSubscriptionRequest xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\">". 
        "<merchantAuthentication>". 
        "<name>" . $loginname . "</name>". 
        "<transactionKey>" . $transactionkey . "</transactionKey>". 
        "</merchantAuthentication>" . 
        "<subscriptionId>" . 2179811 . "</subscriptionId>". 
        "</ARBCancelSubscriptionRequest>"; 

        echo $response = send_request_via_curl($host,$path,$content);die; 

허용되지 않는 405 방법을 제공하고 있습니다. 도와주세요!

+0

로했다! – rohitnetgains

답변

1

마지막으로 내 code.Basically 문제를 수정하여 그것을 해결 난 여전히 it.Anyone이 도움을 주시기 바랍니다에 찾고 있어요 헤더

`public function cancelSubscriptionAction() 
     { 
       $xml_str ='<?xml version="1.0" encoding="utf-8"?> 
       <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
       <soap:Body> 
       <ARBCancelSubscription xmlns="https://api.authorize.net/soap/v1/"> 
       <merchantAuthentication> 
       <name>******</name> 
       <transactionKey>******</transactionKey> 
       </merchantAuthentication> 
       <subscriptionId>******</subscriptionId> 
       </ARBCancelSubscription> 
       </soap:Body> 
       </soap:Envelope>'; 

       $headers = array( 
       'Content-Type: text/xml; charset="utf-8"', 
       'Content-Length: '.strlen($xml_str), 
       'Accept: text/xml', 
       'Cache-Control: no-cache', 
       'Pragma: no-cache', 
       ); 

       $remote_url = 'https://apitest.authorize.net/soap/v1/Service.asmx'; 
       $process = curl_init($remote_url); 
       curl_setopt($process, CURLOPT_HTTPHEADER, $headers); 
       curl_setopt($process, CURLOPT_HEADER, 1); 
       curl_setopt($process, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); 
       curl_setopt($process, CURLOPT_TIMEOUT, 30); 
       curl_setopt($process, CURLOPT_POST, 1); 
       curl_setopt($process, CURLOPT_POSTFIELDS, $xml_str); 
       curl_setopt($process, CURLOPT_RETURNTRANSFER, TRUE); 
       $return = curl_exec($process); 
       $finale = list ($resultCode, $code, $text, $subscriptionId) =parse_return($return); 
       print_r($finale); 
       curl_close($process); 

     }` 
관련 문제