gpt4 book ai didi

PayPal SetExpressCheckout Req > 无法连接到远程服务器

转载 作者:太空宇宙 更新时间:2023-11-03 15:53:44 25 4
gpt4 key购买 nike

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

在本地主机上运行良好,但当我推送到我们数据中心(使用沙箱设置)中站点的测试版本时失败。我正在为 c# 使用 SDK 版本 2.1.96。有什么想法吗?

谢谢

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

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

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

SetExpressCheckoutReq wrapper = new SetExpressCheckoutReq();
wrapper.SetExpressCheckoutRequest = checkoutRequest;
PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService();
SetExpressCheckoutResponseType setECResponse = service.SetExpressCheckout(wrapper);

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

<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>

最佳答案

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

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

关于PayPal SetExpressCheckout Req > 无法连接到远程服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14613093/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com