Adaptive payments flow is broken

filipporonco
Contributor
Contributor

Since few days the adaptive payments (both preapprovals and chained) seems to be broken.
When we send the user to paypal to complete the order (chained) or to authorize the preapproval (preapprovals), they get a generic "invalid transaction" error. Tested the flow, we get the same error and looking to the console we can see this error on the checkout.js file in the paypal object directory:

Uncaught TypeError: PAYPAL.AP.Subflow is not a constructor
at checkout.js:11
(anonymous) @ checkout.js:11

Seems something has broken on paypal side.
Can you please pass it to the tech team for investigation?
It's totally blocking for us.

Cheers, Filpaypal-error.jpg

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

filipporonco
Contributor
Contributor

Hi @angelleye, thanks a lot for your time.
We've finally figured out what was wrong.

 

Trying the complete debugging of the call to the svcs endpoint we've discovered that since few days (first time from 2013), we started getting an odd response from the paypal server to our SOAP request as: 

{"faultstring":"Unknown Content-Encoding","faultcode":"HTTP"}

We've then thined to some issue in the "transportation" of the call to paypal servers and we've tryed to add something in the headers.

First, we discovered that in our http header request some line that we've never used before was missing, for example:
"X-PAYPAL-DEVICE-IPADDRESS: " . $_SERVER['REMOTE_ADDR'] . "\r\n" ;

But this didn't solve the issue.
Then we've added a new line in the soap client call:

'compression' => SOAP_COMPRESSION_ACCEPT,

Adding this solved the issue but no one ever adviced us about the requirement of this part of the code (we're using one of your old PayPal PHP class I think). Probably, this is a linux issue, maybe paypal have sobsituted some server with a newer one and while the older accepted the SOAP request even if it was not with this "compression" parameter, in the newer environment it seems required.

Anyway, everything is back to normality adding this line, we just have an odd time response for the Pay operation than for the Preapproval operation but this might depend on different paypal servers managing one or the other operation.

A complete set of the required http headers and other stuff could be useful for those, like us, with very old adaptive integrations, just to refresh the things. Another question is about SOAP protocol, we're sending everything in 1.1 version but, maybe we should send in SOAP 1.2 ?

Thanks again.


Filippo Ronco
Italy

View solution in original post

Login to Me Too
7 REPLIES 7

filipporonco
Contributor
Contributor

Just to add some details, the endopoint we're using for adaptive payments calls since 2013 is:
https://svcs.paypal.com/

and this is the wsdl:
https://svcs.paypal.com/AdaptivePayments?wsdl

 

when we make the call now we don't get a response from the paypal endopoint for several seconds and then we arrive on paypal with that "invalid trasaction" error in the page and with the previous javascript error in the console. The javascript error seems related to the checkout.js object in the paypalobject repository.

Since this completely blocking ALL transactions for us, both orders through preapprovals and chained payments, hope that @MTS_Ciaran or someone else can bring the thing to the kind attention of the paypal tech team.

Thank you.

Filippo Ronco
Italy

Login to Me Too

filipporonco
Contributor
Contributor

Maybe some super user as @angelleye could give us a hint or tell the thing to a paypal tech team 🙂

Login to Me Too

angelleye
Advisor
Advisor

I don't see any other reports of this, and the sandbox seems to be working fine.  Are you able to reproduce the problem in the sandbox?

 

Have you tried clearing cache/cookies in your website and browser to see if that helps?  

 

 

Angell EYE - www.angelleye.com
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
Login to Me Too
Solved

filipporonco
Contributor
Contributor

Hi @angelleye, thanks a lot for your time.
We've finally figured out what was wrong.

 

Trying the complete debugging of the call to the svcs endpoint we've discovered that since few days (first time from 2013), we started getting an odd response from the paypal server to our SOAP request as: 

{"faultstring":"Unknown Content-Encoding","faultcode":"HTTP"}

We've then thined to some issue in the "transportation" of the call to paypal servers and we've tryed to add something in the headers.

First, we discovered that in our http header request some line that we've never used before was missing, for example:
"X-PAYPAL-DEVICE-IPADDRESS: " . $_SERVER['REMOTE_ADDR'] . "\r\n" ;

But this didn't solve the issue.
Then we've added a new line in the soap client call:

'compression' => SOAP_COMPRESSION_ACCEPT,

Adding this solved the issue but no one ever adviced us about the requirement of this part of the code (we're using one of your old PayPal PHP class I think). Probably, this is a linux issue, maybe paypal have sobsituted some server with a newer one and while the older accepted the SOAP request even if it was not with this "compression" parameter, in the newer environment it seems required.

Anyway, everything is back to normality adding this line, we just have an odd time response for the Pay operation than for the Preapproval operation but this might depend on different paypal servers managing one or the other operation.

A complete set of the required http headers and other stuff could be useful for those, like us, with very old adaptive integrations, just to refresh the things. Another question is about SOAP protocol, we're sending everything in 1.1 version but, maybe we should send in SOAP 1.2 ?

Thanks again.


Filippo Ronco
Italy

Login to Me Too

eddave
New Community Member

 

Hello,
The problem seems to be recurring, please resolve it

paypal_error.jpg

PAYPAL.AP.Subflow is not a constructor

Login to Me Too

PiotrRob
Contributor
Contributor

I'm having the exact same issue, any help would be appreciated. 

Login to Me Too

ThAppbakkers
Member
Member

Same here. Many requests fail on the Paypal frontend with the JS error, only some will go thru without a problem.

 

We are using the latest AdaptivePayments PHP SDK.

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.