Files
odoo_source/addons/payment_authorize/views/payment_views.xml
T
Horacio Tellez c1aa010af7 [IMP] payment: filter out acquirers based on the amount
This commit adds the possibility to define a maximum payment amount that
a given acquirer can process. If the payment amount exceeds the value,
the acquirer is filtered out of the available acquirers listed on the
payment forms.

While we're at it, the field `country_ids` is renamed to
`available_country_ids` to better depict that it is not a property of
the acquirer, but a configuration option. It will also be coherent with
the field `available_currency_ids` that is expected to be added soon.

Task - 2162165

closes odoo/odoo#82411

Related: odoo/enterprise#24412
Related: odoo/upgrade#3703
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-26 13:24:57 +02:00

56 lines
3.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="payment_acquirer_form" model="ir.ui.view">
<field name="name">Authorize.Net Acquirer Form</field>
<field name="model">payment.acquirer</field>
<field name="inherit_id" ref="payment.payment_acquirer_form"/>
<field name="arch" type="xml">
<xpath expr='//group[@name="acquirer"]' position='inside'>
<group attrs="{'invisible': [('provider', '!=', 'authorize')]}">
<field name="authorize_login" attrs="{'required':[('provider', '=', 'authorize'), ('state', '!=', 'disabled')]}"/>
<field name="authorize_transaction_key" password="True" attrs="{'required':[ ('provider', '=', 'authorize'), ('state', '!=', 'disabled')]}"/>
<field name="authorize_signature_key" password="True" attrs="{'required':[ ('provider', '=', 'authorize'), ('state', '!=', 'disabled')]}"/>
<label for="authorize_client_key"/>
<div>
<field name="authorize_client_key"/>
<button class="oe_link" icon="fa-refresh" type="object"
name="action_update_merchant_details"
string="Generate Client Key"/>
</div>
<a colspan="2" href="https://www.odoo.com/documentation/master/applications/general/payment_acquirers/authorize.html" target="_blank">
How to get paid with Authorize.Net
</a>
</group>
</xpath>
<field name="display_as" position="before">
<field name="authorize_payment_method_type"
attrs="{'invisible': [('provider', '!=', 'authorize')], 'required':[('provider', '=', 'authorize'), ('state', '!=', 'disabled')]}"/>
</field>
<xpath expr="//field[@name='available_country_ids']" position="after">
<label for="authorize_currency_id" string="Currency" attrs="{'invisible': [('provider', '!=', 'authorize')]}"/>
<div attrs="{'invisible': [('provider', '!=', 'authorize')]}">
<field name="authorize_currency_id"/>
<button class="oe_link" icon="fa-refresh" type="object"
name="action_update_merchant_details"
string="Set Account Currency"/>
</div>
</xpath>
</field>
</record>
<record id="payment_token_form" model="ir.ui.view">
<field name='name'>Authorize.Net Token Form</field>
<field name='model'>payment.token</field>
<field name="inherit_id" ref="payment.payment_token_form"/>
<field name="arch" type="xml">
<xpath expr='//field[@name="acquirer_ref"]' position='after'>
<field name="provider" invisible="1"/>
<field name="authorize_profile" attrs="{'invisible':[('provider', '!=', 'authorize')]}"/>
<field name="authorize_payment_method_type" attrs="{'invisible': [('provider', '!=', 'authorize')]}"/>
</xpath>
</field>
</record>
</odoo>