2014-10-07 1 views
0

PayPal 계정에서 거래를 푸시하려고합니다. 샌드 박스 환경에서 성공적인 호출을 만들었지 만 라이브 환경에서는이를 복제 할 수 없습니다.PayPal Classic API 서비스 호출 중 오류가 발생했습니다.

C# 콘솔 앱 (타겟팅 프레임 워크 4)이 있습니다. 내가 추가 한 서비스입니다 : 내가 전화 (의 마지막 줄을 만들 때

static void Main(string[] args) 
    { 
     using (var client = new PayPalService.PayPalAPIInterfaceClient()) 
     { 
      var credentials = new PayPalService.CustomSecurityHeaderType 
      { 
       Credentials = new PayPalService.UserIdPasswordType 
       { 
        Username = "MyUsername", 
        Password = "MyPassword", 
        Signature = "MySignature" 
       } 
      }; 




      TransactionSearchReq request = new TransactionSearchReq(); 

      request.TransactionSearchRequest = new TransactionSearchRequestType(); 


      request.TransactionSearchRequest.StartDate = DateTime.Now.AddHours(-12); 

      request.TransactionSearchRequest.EndDate = DateTime.Now; 

      TransactionSearchResponseType transactionSearchResponseType = client.TransactionSearch(ref credentials, request); 

     } 

    } 

엔드 포인트

  <endpoint address="https://api.paypal.com/2.0/" binding="wsHttpBinding" 
      bindingConfiguration="PayPalAPISoapBinding" contract="PayPayService.PayPalAPIInterface" 
      name="PayPalAPI" /> 

: 여기

https://www.paypal.com/wsdl/PayPalSvc.wsdl 내 코드 (지금까지의 개념을 분명히 유일한 증거)이다 코드) 오류가 발생합니다.

An error occurred while receiving the HTTP response to https://api.paypal.com/2.0/. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details. 

답변을 검색했지만 찾을 수 없습니다. 문제를 해결할 수 있습니다. 다른 기능은 필요하지 않습니다.

답변

1

정확한 엔드 포인트로 요청을 보내고 있는지 확인 했습니까?

자세한 내용 : https://developer.paypal.com/webapps/developer/docs/classic/api/endpoints/

업데이트 : 엔드 포인트가 참으로 문제입니다 것 같습니다. 코드에서 사용자 이름, 암호 및 서명을 사용하지만 서명 끝점 대신 끝점을 인증서 끝점으로 설정하고 있습니다.

+0

예 엔드 포인트가 정확하다는 것이 확실합니다. 나는 그것을 포스트에 추가했다. – Fred

+0

자, 그러면 인증서를 사용하고 있습니까? SSL 인증서를 설치하고 PayPal 계정으로 올바르게 구성 했습니까? 서명 방법은 작업하기가 훨씬 쉽습니다. –

+0

나는 당신에게 충분히 감사 할 수 없다! 필사적으로 두 종점을 모두 시도했지만 cert와 sig는 모두 효과가 없었습니다. 그런 다음 새 프로젝트를 만들어 모든 코드 (시그널 엔드 포인트)를 복사했고 두 번째로 (버전 번호를 추가 한 후) 작업했습니다. 에 자리를 뜨고 다시 감사드립니다. – Fred

관련 문제