首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PayPal SetExpressCheckoutReq >无法连接到远程服务器

问PayPal SetExpressCheckoutReq >无法连接到远程服务器
EN

Stack Overflow用户
提问于 2013-01-31 04:28:32
回答 1查看 1.3K关注 0票数 1

我被困住了,需要有人给我指明正确的方向。

在本地主机上工作得很好,但当我在我们的数据中心推送到站点的测试版本(带有沙箱设置)时会失败。我使用的是用于c#的SDK版本2.1.96。有什么想法吗?

谢谢

端点是:https://api-3t.sandbox.paypal.com/2.0/

当我尝试在数据中心服务器上测试时,我得到:

代码语言:javascript
复制
System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: 
A connection attempt failed because the connected party did not properly respond after a period of time, 
or established connection failed because connected host has failed to respond 173.0.82.83:443
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, 
IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
   at System.Net.HttpWebRequest.GetRequestStream()
   at PayPal.APIService.MakeRequestUsing(IAPICallPreHandler apiCallHandler)
   at PayPal.BasePayPalService.Call(IAPICallPreHandler apiCallHandler)
   at PayPal.PayPalAPIInterfaceService.PayPalAPIInterfaceServiceService.SetExpressCheckout(SetExpressCheckoutReq setExpressCheckoutReq, String apiUserName)
   at PayPalSetCheckoutModel.SetExpressCheckoutPP() in PayPal\PayPalCheckoutModel.cs:line 301

相关的代码是(直接来自SDK中的示例)://调用API

代码语言:javascript
复制
SetExpressCheckoutReq wrapper = new SetExpressCheckoutReq();
wrapper.SetExpressCheckoutRequest = checkoutRequest;
PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService();
SetExpressCheckoutResponseType setECResponse = service.SetExpressCheckout(wrapper);

要发送的请求(从我的本地主机)如下所示:

代码语言:javascript
复制
<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"urn:ebay:api:PayPalAPI\" xmlns:ebl=\"urn:ebay:apis:eBLBaseComponents\" xmlns:cc=\"urn:ebay:apis:CoreComponentTypes\" xmlns:ed=\"urn:ebay:apis:EnhancedDataTypes\">
  <soapenv:Header>
    <ns:RequesterCredentials>
     <ebl:Credentials>
       <ebl:Username>sandboxseller_1358951631_biz_api1.domain.com</ebl:Username>
       <ebl:Password>0000000000</ebl:Password>
       <ebl:Signature>xxxx</ebl:Signature>
     </ebl:Credentials>
   </ns:RequesterCredentials>
 </soapenv:Header>
 <soapenv:Body>
   <ns:SetExpressCheckoutReq>
     <ns:SetExpressCheckoutRequest>
       <ebl:Version>94.0</ebl:Version>
        <ebl:SetExpressCheckoutRequestDetails>
          <ebl:ReturnURL>https://localhost/Checkout/PayPalComplete</ebl:ReturnURL>
          <ebl:CancelURL>https://localhost/Checkout/PayPalCancel</ebl:CancelURL>
          <ebl:ReqConfirmShipping>0</ebl:ReqConfirmShipping>
          <ebl:NoShipping>1</ebl:NoShipping>
          <ebl:AddressOverride>0</ebl:AddressOverride>
      <ebl:cpp-header-image>https://www.cloudfront.net/logo.jpg</ebl:cpp-header-image>
      <ebl:SolutionType>Sole</ebl:SolutionType>
      <ebl:BuyerEmail>mrbill@test.com</ebl:BuyerEmail>
      <ebl:AllowNote>0</ebl:AllowNote>
      <ebl:BrandName>Domain.com</ebl:BrandName>
      <ebl:PaymentDetails>
        <ebl:OrderTotal currencyID=\"USD\">27</ebl:OrderTotal>
        <ebl:ItemTotal currencyID=\"USD\">27</ebl:ItemTotal>
        <ebl:Custom>42289</ebl:Custom>
        <ebl:InvoiceID>100029</ebl:InvoiceID>
        <ebl:PaymentDetailsItem>
          <ebl:Name>Item Name</ebl:Name>
          <ebl:Amount currencyID=\"USD\">27</ebl:Amount>
          <ebl:ItemCategory>Digital</ebl:ItemCategory>
        </ebl:PaymentDetailsItem>
        <ebl:PaymentAction>Sale</ebl:PaymentAction>
      </ebl:PaymentDetails>
    </ebl:SetExpressCheckoutRequestDetails>
  </ns:SetExpressCheckoutRequest>
</ns:SetExpressCheckoutReq>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-01-31 05:34:00

看起来可能是防火墙问题。

我会检查您是否可以从数据中心机器在浏览器中查看https://api-3t.sandbox.paypal.com/2.0/,并获得与您在笔记本电脑上相同的输出。下一件要检查的事情是端口443是否可用作数据中心机器的路由。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14613093

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档