Merge pull request #6079 from expsa/store_hyperpay_response
[IMP] payment_hyperpay, payment_hyperpay_tokenization: add payment ic…
This commit is contained in:
commit
096f6de2d9
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<xpath expr="//t[@t-foreach='pms']//label" position="after">
|
||||
<ul class="float-right list-inline payment_icon_list">
|
||||
<li t-attf-class="list-inline-item">
|
||||
<span t-field="token.payment_icon_id.image_payment_form" t-options='{"widget": "image", "alt-field": "hyperpay_payment_brand"}'/>
|
||||
<span t-field="pm.payment_icon_id.image_payment_form" t-options='{"widget": "image", "alt-field": "hyperpay_payment_brand"}'/>
|
||||
</li>
|
||||
</ul>
|
||||
</xpath>
|
||||
|
|
|
|||
Loading…
Reference in New Issue