Skip to content
Snippets Groups Projects
Commit 7348cda6 authored by Valentin Chevalier's avatar Valentin Chevalier
Browse files

[FIX] adyen_paybylink: fix the return of customers


Before this commit, customers might see a "transaction not found" page
when returning from Adyen Pay By Link Payment Page.

Now, they'll see a "waiting for payment" page if they returned before
the webhook notification or the confirmation of payment if they
returned after the webhook notification.

opw-3006401

closes odoo/odoo#103063

X-original-commit: 4fcf2600
Signed-off-by: default avatarAntoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: default avatarValentin Chevalier <vcr@odoo.com>
parent 356f3563
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
import logging
from odoo import _, api, models
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
......@@ -12,6 +12,18 @@ _logger = logging.getLogger(__name__)
class PaymentTransaction(models.Model):
_inherit = 'payment.transaction'
@api.model
def adyen_create(self, values):
"""
When the customer lands on the `/payment/process` route, `/payment/process/poll` try to find
the transaction whose `date` field is between yesterday and now.
Since the `date` field is only set when the state of the transaction is changed, if the
customer comes back before the webhook, he will see a "transaction not found" page because
the value of the `date` field would be `False`.
"""
return dict(date=fields.Datetime.now())
# --------------------------------------------------
# FORM RELATED METHODS
# --------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment