Merge pull request #6067 from expsa/store_hyperpay_response

[FIX] payment_hyperpay_tokenization, donation_request: unbound reques…
This commit is contained in:
abdurrahman-saber 2026-01-08 14:33:49 +04:00 committed by GitHub
commit 51a2c3814c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,7 @@
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError,UserError
from dateutil.relativedelta import relativedelta
import traceback
class DonationRecurring(models.Model):
@ -311,8 +312,8 @@ class DonationRecurring(models.Model):
date_ref = fields.Date.context_today(self)
domain = self._get_donations_to_process_domain(date_ref)
records = self.search(domain)
try:
for rec in records:
try:
new_line = rec._create_donation_line()
unprocessed_lines = rec.recurring_line_ids.filtered(lambda l: not l.sale_order_id)
for line in unprocessed_lines:
@ -321,7 +322,7 @@ class DonationRecurring(models.Model):
continue
rec._advance_next_date()
except Exception as e:
self.message_post(body=_("⛔ Unexpected error:<br/><pre>%s</pre>") % str(e))
rec.message_post(body=_("⛔ Unexpected error:<br/><pre>%s</pre>") % traceback.format_exc())
return True
@api.model

View File

@ -47,7 +47,7 @@ class HyperPayTransaction(models.Model):
return self._hyperpay_s2s_validate_transaction(data)
def _hyperpay_get_s2s_transaction_payload(self, data):
base_url = request.httprequest.host_url
base_url = self.acquirer_id.get_base_url()
payload = {
"entityId": self.acquirer_id.hyperpay_s2s_entity_id,
"amount": '%.2f' % self.amount,