Je suis coincé et j'ai besoin de quelqu'un pour me diriger dans la bonne direction.PayPal SetExpressCheckoutReq> Impossible de se connecter au serveur distant
Fonctionne très bien sur localhost, mais échoue lorsque j'appuie sur la version de test du site dans notre centre de données (avec les paramètres sandbox). J'utilise le SDK version 2.1.96 pour C#. Des idées?
Merci
Le critère d'évaluation est: https://api-3t.sandbox.paypal.com/2.0/
Lorsque je tente de tester sur le serveur de centre de données, je reçois:
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
Le pertinant code lié est (directement à partir de l'échantillon dans le SDK): // Invoquer l'API
SetExpressCheckoutReq wrapper = new SetExpressCheckoutReq();
wrapper.SetExpressCheckoutRequest = checkoutRequest;
PayPalAPIInterfaceServiceService service = new PayPalAPIInterfaceServiceService();
SetExpressCheckoutResponseType setECResponse = service.SetExpressCheckout(wrapper);
La demande à envoyer (de mon localhost) ressemble à:
<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>[email protected]</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>
me> facepalm. Je n'ai pas pensé à cela, et ce n'est pas un problème, mais cela semble être un problème de réseau. Merci. Parfois, je me perds dans la forêt ... –