Adaptive payments: svcs endpoint very slow response

filipporonco
Contributor
Contributor

Hi,

 

starting from the second half of July, we have a big issue with the time response from the svcs endpoint for all adaptive payments soap requests made to these two enpoints:

https://svcs.paypal.com/AdaptivePayments/Pay/
https://svcs.paypal.com/AdaptivePayments/Preapproval/

 

Paypal servers responds after 50-60 seconds, really too much.

 

Any help?

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

filipporonco
Contributor
Contributor

After weeks of troubleshooting and countless attempts to get any advice from the PayPal MTS (without having any useful one), we finally figured out what was really happening and how to fix it (not a quick and easy fix), I'm going to post this solution for the few who might fall in the same time response issue on the soap request to adaptive payments API endopoint.

 

First, we worked to check that there was no issues at all on our hand due to firwalls, networking problems or coding, we performed a lot of test (but real) orders in the production (live) environment, both using the Pay operation of the adaptive payments API for chained payments and the Preapproval operation and we stated that the 49 seconds time response from any of the svcs endpoint connection attempts we were doing was due to something on the PayPal server configuration, something (that we can't know) specifically regarding the SOAP connection (nothing regarding the subsequent data envelope).

 

We've so rewritten a big part of our code switching from a SOAP connection to a cURL connection and everything started working again with good time response in order of 1-3 seconds, absolutely acceptable again.

 

All of this in the production environment and, unfortunately, everything without any advice from the PayPal status websites or notifications to mechants and app developers, nor from the MTS Team.

 

So, the final advice for the PayPal Tech Team is that there's something that has changed on PayPal adaptive payments svcs endpoint server configuration that approximatively from July 2019 between 10 and 20 July (unfortunately we can't state the precise day) stopped to give quick responses to SOAP requests and started fiving very long response (always 49-51 secs).

 

Changing the whole code to open the connection and transfer data via cURL instead than via SOAP we've solved the problem but this was a tech adventure because no-one gave us any advice on this. And this is a pity.

 

Hope this can be useful for someone, were nightmare weeks for us.

 

 

Cheers, Fil.

View solution in original post

Login to Me Too
3 REPLIES 3

filipporonco
Contributor
Contributor

@angelleye @MTS_Ciaran , apologize for it, this is the second time in a week I ask for your help but issues comes up as mushrooms here.

As I told in the previous thread we have just fixed the previous issue (odd unknown content enconding error as response to the soap request to the svcs endpoint for adaptives) adding a simple compression line in the SOAP request:
'compression' => SOAP_COMPRESSION_ACCEPT,

This wasn't requested since july and noone at paypal ever told us to make any change to the code but in july we started having this issue and trying a lot of workarounds we noticed that this worked for us (maybe they have renewsd the servers and they have a different soap configuration with this compression_accept parameter enabled, don't know).

Our problem now, the slow response issue, however started in July, before this patch, and persists right now, from almost 3 weeks.
We've opened a ticket to paypal MTS but the time of the support is devastating.

Do you (or anyone else) think that the issue could be generated on our side in the way we make the soap request (but this worked just fine since the end of June 2019 and till the first 1-2 week of July) or are just paypal servers with some temporary (but very long) issue on their side?

We've checked and between the call and the response we do absolutely nothing than waiting for almost 51-52 seconds.

Our headers are something like that:

$http_headers = "X-PAYPAL-SECURITY-USERID: " . config_item("paypal", "api_username") . "\r\n" .
"X-PAYPAL-SECURITY-SIGNATURE: " . config_item("paypal", "api_signature") . "\r\n" .
"X-PAYPAL-SECURITY-PASSWORD: " . config_item("paypal", "api_password") . "\r\n" .
"X-PAYPAL-APPLICATION-ID: " . config_item("paypal", "application_id") . "\r\n" .
"X-PAYPAL-MESSAGE-PROTOCOL: " . config_item("paypal", "api_messageProtocol") . "\r\n".
"X-PAYPAL-DEVICE-IPADDRESS: " . $_SERVER['REMOTE_ADDR'] . "\r\n" ;

$opts = array( 'http' => array('method'=>'POST','header'=>$http_headers, 'protocol_version' => 1.1));

//creating the stream context option containing the http headers
$ctx = stream_context_create($opts);

 

And our request is something like that:

$soapClient = new SoapClient($this->wsdl,
array('location' => $this->EndPointURL."AdaptivePayments/Preapproval/",
'uri' => "urn:Preapproval",
'soap_version' => SOAP_1_1,
'trace' => 1, //debugging option
'compression' => SOAP_COMPRESSION_ACCEPT,
'stream_context' => $ctx)); //adding the stream context option containing the http headers

$response = objectToArray($soapClient->Preapproval($params));

} catch (SoapFault $e) {
$response = objectToArray($e);
}

return $response;

}

 

 

Can you see anything wrong in the way we do it?
We don't get any error, just a long long wait for the paypal response from svcs endpoint.

Login to Me Too
Solved

filipporonco
Contributor
Contributor

After weeks of troubleshooting and countless attempts to get any advice from the PayPal MTS (without having any useful one), we finally figured out what was really happening and how to fix it (not a quick and easy fix), I'm going to post this solution for the few who might fall in the same time response issue on the soap request to adaptive payments API endopoint.

 

First, we worked to check that there was no issues at all on our hand due to firwalls, networking problems or coding, we performed a lot of test (but real) orders in the production (live) environment, both using the Pay operation of the adaptive payments API for chained payments and the Preapproval operation and we stated that the 49 seconds time response from any of the svcs endpoint connection attempts we were doing was due to something on the PayPal server configuration, something (that we can't know) specifically regarding the SOAP connection (nothing regarding the subsequent data envelope).

 

We've so rewritten a big part of our code switching from a SOAP connection to a cURL connection and everything started working again with good time response in order of 1-3 seconds, absolutely acceptable again.

 

All of this in the production environment and, unfortunately, everything without any advice from the PayPal status websites or notifications to mechants and app developers, nor from the MTS Team.

 

So, the final advice for the PayPal Tech Team is that there's something that has changed on PayPal adaptive payments svcs endpoint server configuration that approximatively from July 2019 between 10 and 20 July (unfortunately we can't state the precise day) stopped to give quick responses to SOAP requests and started fiving very long response (always 49-51 secs).

 

Changing the whole code to open the connection and transfer data via cURL instead than via SOAP we've solved the problem but this was a tech adventure because no-one gave us any advice on this. And this is a pity.

 

Hope this can be useful for someone, were nightmare weeks for us.

 

 

Cheers, Fil.

Login to Me Too

filipporonco
Contributor
Contributor

For those impacted, consider that the solution is ok but it need a little integration (just discovered patching the mobile app).
For requests via cURL coming from our desktop website everything works fine with a request header that set the format in XML and a response header in JSON. For some reason that we don't know (almost incredible) the same identical code from the minibrowser of the app doesen't work, we had to change the headers requests from XML to NV (NVP).

So we have this odd difference, this works for desktop API calls in cURL:

"X-PAYPAL-REQUEST-DATA-FORMAT: XML",
"X-PAYPAL-RESPONSE-DATA-FORMAT: JSON",

while this works for mobile API calls in cURL:

"X-PAYPAL-REQUEST-DATA-FORMAT: NV",
"X-PAYPAL-RESPONSE-DATA-FORMAT: JSON",


Hope this helps.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.