[FIX] payment_paypal: wrong param expected in paypal_urls

Issue was blocking the system to confirm a SO/Invoice after redirection
from paypal.

In V13 is getting the value of the paypal_urls using
paypal_get_form_action_url() returning the correct string, not a dict
anymore.

Closing
opw-2119027
opw-2122833

closes odoo/odoo#40471

X-original-commit: b7f32e6451da75a9583d28686641fc328ab661da
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Baptiste Vergote
2019-11-19 08:16:47 +00:00
committed by fw-bot
parent a9a2fba683
commit ce57b34f43
+3 -4
View File
@@ -60,15 +60,14 @@ class PaypalController(http.Controller):
tx = None
if reference:
tx = request.env['payment.transaction'].search([('reference', '=', reference)])
paypal_urls = tx.acquirer_id.paypal_get_form_action_url()
pdt_request = bool(post.get('amt')) # check for spefific pdt param
paypal_url = tx.acquirer_id.paypal_get_form_action_url()
pdt_request = bool(post.get('amt')) # check for specific pdt param
if pdt_request:
# this means we are in PDT instead of DPN like before
# fetch the PDT token
post['at'] = tx and tx.acquirer_id.paypal_pdt_token or ''
post['cmd'] = '_notify-synch' # command is different in PDT than IPN/DPN
validate_url = paypal_urls['paypal_form_url']
urequest = requests.post(validate_url, post)
urequest = requests.post(paypal_url, post)
urequest.raise_for_status()
resp = urequest.text
if pdt_request: