Skip to content
Snippets Groups Projects
Commit fab913e7 authored by Loan (LSE)'s avatar Loan (LSE)
Browse files

[FIX] payment_payulatam: Adapt rounding method if webhook

backward port of:
https://github.com/odoo/odoo/pull/113768

Before this commit:
 If a payulatam payment is received from the confirmation
 page (so, with the webhook). If the value have some decimals
 it might be rounded in the wrong way.
 As such, the generated signature to compare with is wrong
 and the payment validation cancelled

After this commit
 If we cross compare the signature generation documentation:
 https://developers.payulatam.com/latam/en/docs/integrations/webcheckout-integration/response-page.html#signature-validation
 https://developers.payulatam.com/latam/en/docs/integrations/webcheckout-integration/confirmation-page.html#signature-validation


 We notice that the `new_value` computation is slightly different
 depending on the return.
 The one we currently use for both method is the "return"
 one which is computed differently from the "confirm" one.

 With this change of code a "confirmation" page payment
 will be validated as intended.

I also changed the log level from warning to exception
so that the traceback and exception message is logged.
Before this commit there was just a generic warning message

opw-3018628

closes odoo/odoo#113987

X-original-commit: 0e29f948
Signed-off-by: default avatarLoan (LSE) <lse@odoo.com>
Signed-off-by: default avatarAntoine Vandevenne (anv) <anv@odoo.com>
parent df74fb68
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment