[IMP] payment_hyperpay, payment_hyperpay_tokenization: add payment icon in tokens
This commit is contained in:
parent
f82a0f5fea
commit
57d306ecf7
|
|
@ -6,6 +6,7 @@
|
|||
#################################################################################
|
||||
import re
|
||||
import logging
|
||||
import pprint
|
||||
|
||||
import dateutil.parser
|
||||
import pytz
|
||||
|
|
@ -74,6 +75,15 @@ class HyperPayPaymentTransaction(models.Model):
|
|||
'^(000\.200)',
|
||||
'^(800\.400\.5|100\.400\.500)'
|
||||
]
|
||||
if self.hyperpay_response_payload:
|
||||
res.update({
|
||||
'hyperpay_response_payload': f"{self.hyperpay_response_payload} \n===============\n {pprint.pformat(data)}"
|
||||
})
|
||||
else:
|
||||
res.update({
|
||||
'hyperpay_response_payload': pprint.pformat(data)
|
||||
})
|
||||
|
||||
if re.match(success_pattern[0], result_code) or re.match(success_pattern[1], result_code):
|
||||
date_validate = dateutil.parser.parse(data.get('timestamp')).astimezone(pytz.utc).replace(tzinfo=None)
|
||||
res.update(acquirer_reference=data.get('id'), date=date_validate)
|
||||
|
|
|
|||
|
|
@ -15,5 +15,18 @@
|
|||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="payment_transaction_form_hyperpay" model="ir.ui.view">
|
||||
<field name="name">payment.transaction.form.hyperpay_response_payload</field>
|
||||
<field name="model">payment.transaction</field>
|
||||
<field name="inherit_id" ref="payment.transaction_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr='//sheet' position='inside'>
|
||||
<group string="Hyperpay Response Payload">
|
||||
<field name="hyperpay_response_payload" readonly="1" widget="ace" nolabel="1"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
|
|||
Loading…
Reference in New Issue