Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Payment requests to Paypal fail due to empty parameters #411

Closed
lsc-dotsource opened this issue Aug 5, 2021 · 6 comments
Closed

Payment requests to Paypal fail due to empty parameters #411

lsc-dotsource opened this issue Aug 5, 2021 · 6 comments

Comments

@lsc-dotsource
Copy link

We noticed, and confirmed with payone, that requests for Paypal wallet payment fail when empty parameters are passed.

This results in the following error from Payone:
{“errormessage”:“Parameter {shipping_addressaddition} faulty or missing”,“customermessage”:“Ungültiger Liefer-Adresszusatz. Bitte überprüfen Sie die Angaben.“,”errorcode”:“1371”,“status”:“ERROR”}

the relevant request is this:
{request=authorization, country=, firstname=, city=, mid=45458, successurl=https://example.com/success?token=5E1ghZ84VREA&signature=AeTlqOq%2BOuWwOiGHwiBJ008a1PzGOkrQP%2B4cSeQJEew%3D, language=, integrator_name=commercetools-payone-integration, clearingtype=wlt, mode=test, reference=D00001017, errorurl=https://example.com/error, solution_name=commercetools-platform, street=, wallettype=PPE, currency=EUR, key=, email=, zip=, shipping_street=, amount=1999, shipping_company=, backurl=https://example.com/cancel, integrator_version=v2.19.0, encoding=UTF-8, api_version=3.9, lastname=, portalid=2036918, aid=45492, shipping_country=, solution_version=1}

I believe the parameters are parsed in the MappingUtil class and assume the problem can be solved by not setting empty strings as values;
but am not certain if that would impact payment methods other than Paypal.

After talking to payone we have been told that passing empty arguments can result in unpredictable complicatons (quote in german, translation follows):

Tatsächlich scheint PayPal hier etwas angepasst zu haben, sodass die Transaktionen mit leeren shipping-Paramtern bei PayPal abgelehnt werden. Folgendermaßen werden die Parameter von Ihnen derzeit übergeben:
shipping_company=
shipping_country=DE
shipping_street=

Ich empfehle Ihnen die übergabe der o. g. Parameter für die abweichende Lieferadresse einmal zu entfernen, da die Übergabe leerer Parameter immer wieder zu unvorhersehbaren Komplikationen führen kann.

Approximate translation:

Paypal seems to have changed something so that transaction with empty shipping parameters are refused. currently you are passing them as follows;
shipping_company=
shipping_country=DE
shipping_street=

I recommend removing these parameters [for differing delivery address], as passing empty parameters can always result in unpredictable complications.

@praveenkumarct
Copy link
Contributor

praveenkumarct commented Aug 13, 2021

@lsc-dotsource Thanks for the PR. Since we don't have Integration tests I am not confident to merge this PR. We are currently trying to reproduce this case and test it for the Paypal wallet payment type and also to make sure these changes doesn't affect other payment types.

@lsc-dotsource
Copy link
Author

lsc-dotsource commented Aug 17, 2021

@praveenkumarct could you perhaps push a beta version with this fix to a docker repository?
Our customer would probably be willing to try it out.

@praveenkumarct
Copy link
Contributor

@lsc-dotsource I could reproduce this issue locally and tried to fix it with your PR changes(by not setting empty values). Still I have the same issue.

"response": "{\"errormessage\":\"Parameter {shipping_addressaddition} faulty or missing\",\"customermessage\":\"Er is bij de bewerking van deze transactie een fout opgetreden (verkeerde parameters).\",\"errorcode\":\"1371\",\"status\":\"ERROR\"}",

The root cause for this problem seems to be the missing shipping address data which are required by paypal.
Note that the issue can be reproduced only with live\production payone account and not with the payone Sandbox account.

@lsc-dotsource
Copy link
Author

We now have new communication from PayPal Support which confirms your findings:
They looked at one of the requests and found Paypal-Errors 10727 10728 10730, which means: Shipping address missing, no shipping address city, no shipping address zipcode.
They told us we have to transmit shipping address data to paypal and (if a digital item, which it is) set the NOSHIPPING parameter to 1
So it seems we have to expand the integration to include this parameter;
The address can be duplicated on our systems - although it might be reasonable to use the billing address if it is missing?

@praveenkumarct
Copy link
Contributor

@lsc-dotsource Thanks for the update. Now it looks clear.
We will add a new parameter NOSHIPPING=1 to the request when Shipping address is missing(when Shipping address city and zipcode is null).
We will update you once the changes are released, for your testing.

@praveenkumarct
Copy link
Contributor

praveenkumarct commented Sep 13, 2021

@lsc-dotsource We are now adding a new parameter 'NoShipping' with value 1 to the paypal payment request to payone.
Hence I am closing this issue. Please let us know if you find any problems further.
https://github.com/commercetools/commercetools-payone-integration/releases/tag/v2.20.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants