Files
odoo_source/addons/payment_paypal/controllers
Antoine Vandevenne (anv) 10180ac660 [FIX] payment_paypal: use the correct method to validate PDT data
With commit 7b165cd5, it was incorrectly assumed that PDT notifications
sent by PayPal could not be verified with the suggested method
(dedicated to PDT notifications) because they were missing some required
parameters. The code was thus adapted to have their verification done
with the method already in place for IPN notifications, as it seemed to
do the job. It turns out that the PayPal sandbox account that was used
at that time was not properly configured, and that PayPal was then
sending IPN-like notifications instead of actual PDT notifications,
which is the reason why the swap of methods worked.

Actually, once the account is properly configured, PayPal sends
correctly populated PDT notifications that must be verified with the
method dedicated to PDT notifications, as the one dedicated to IPN
notifications stops working in that case.

With this commit, the method used to verify the origin and integrity of
PDT notifications is replaced by the one that was previously removed.
The method is however implemented in a more defensive manner to:
1. accept and process the notification without verification if the
   account is not properly configured on PayPal.
2. silently discard the notification if the acquirer is not properly
   configured on Odoo. We then rely on the IPN (webhook) to confirm the
   transaction.

task-2744043

closes odoo/odoo#83659

X-original-commit: 7367f543498810bbdb018aa3566c7afed5684436
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-02-01 08:56:51 +00:00
..