diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/payment_authorize/views | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/payment_authorize/views')
| -rw-r--r-- | addons/payment_authorize/views/payment_authorize_templates.xml | 71 | ||||
| -rw-r--r-- | addons/payment_authorize/views/payment_views.xml | 36 |
2 files changed, 107 insertions, 0 deletions
diff --git a/addons/payment_authorize/views/payment_authorize_templates.xml b/addons/payment_authorize/views/payment_authorize_templates.xml new file mode 100644 index 00000000..e1bad342 --- /dev/null +++ b/addons/payment_authorize/views/payment_authorize_templates.xml @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <data noupdate="1"> + <template id="authorize_form"> + <div> + <input type="hidden" name="data_set" t-att-data-action-url="tx_url" data-remove-me=""/> + <input type="hidden" name='x_login' t-att-value='x_login'/> + <input type="hidden" name='x_fp_hash' t-att-value='x_fp_hash'/> + <input type="hidden" name='x_amount' t-att-value='x_amount'/> + <input type="hidden" name='x_show_form' t-att-value="x_show_form"/> + <input type="hidden" name='x_type' t-att-value="x_type"/> + <input type="hidden" name='x_method' t-att-value="x_method"/> + <input type="hidden" name='x_fp_sequence' t-att-value='x_fp_sequence'/> + <input type="hidden" name='x_version' t-att-value="x_version"/> + <input type="hidden" name="x_relay_response" t-att-value="x_relay_response"/> + <input type="hidden" name="x_relay_url" t-att-value="x_relay_url"/> + <input type="hidden" name="x_fp_timestamp" t-att-value="x_fp_timestamp"/> + <input type="hidden" name='return_url' t-att-value="returndata"/> + <input type="hidden" name='x_cancel_url' t-att-value="x_cancel_url"/> + <!--Order Information --> + <input type="hidden" name='x_invoice_num' t-att-value='reference'/> + <input type="hidden" name='x_description' t-att-value='reference'/> + <input type="hidden" name='x_currency_code' t-att-value='x_currency_code'/> + <!-- Billing Information--> + <input type="hidden" name='x_first_name' t-att-value="billing_first_name"/> + <input type="hidden" name='x_last_name' t-att-value="billing_last_name"/> + <input type="hidden" name="x_company" t-att-value="billing_partner_commercial_company_name"/> + <input type="hidden" name='x_address' t-att-value="billing_address"/> + <input type="hidden" name='x_city' t-att-value="billing_city"/> + <input type="hidden" name='x_zip' t-att-value="billing_zip_code"/> + <input type="hidden" name='x_country' t-att-value="billing_country"/> + <input type="hidden" name='x_phone' t-att-value='billing_phone'/> + <input type="hidden" name='x_email' t-att-value="billing_email"/> + <input type="hidden" name='x_state' t-att-value="billing_state"/> + <!-- Shipping Information--> + <input type="hidden" name='x_ship_to_first_name' t-att-value="first_name"/> + <input type="hidden" name='x_ship_to_last_name' t-att-value="last_name"/> + <input type="hidden" name='x_ship_to_address' t-att-value="address"/> + <input type="hidden" name='x_ship_to_city' t-att-value="city"/> + <input type="hidden" name='x_ship_to_zip' t-att-value="zip_code"/> + <input type="hidden" name='x_ship_to_country' t-att-value="country"/> + <input type="hidden" name='x_ship_to_phone' t-att-value='phone'/> + <input type="hidden" name='x_ship_to_email' t-att-value="email"/> + <input type="hidden" name='x_ship_to_state' t-att-value="state"/> + </div> + </template> + + <template id="payment_authorize_redirect" name="Payment Authorize"> + <script type="text/javascript"> + window.location.href = '<t t-esc="return_url"/>'; + </script> + </template> + + <template id="authorize_s2s_form"> + <input type="hidden" name="data_set" value="/payment/authorize/s2s/create_json_3ds"/> + <input type="hidden" name="acquirer_id" t-att-value="id"/> + <input type="hidden" name="acquirer_state" t-att-value="acq.state"/> + <input type="hidden" name="login_id" t-att-value="acq.sudo().authorize_login"/> + <input type="hidden" name="client_key" t-att-value="acq.sudo().authorize_client_key"/> + <input class="d-none" name="csrf_token" t-att-value="request.csrf_token()"/> + <input t-if="return_url" type="hidden" name="return_url" t-att-value="return_url"/> + <input t-if="partner_id" type="hidden" name="partner_id" t-att-value="partner_id"/> + </template> + + <template id="assets_frontend" inherit_id="web.assets_frontend"> + <xpath expr="script[last()]" position="after"> + <script type="text/javascript" src="/payment_authorize/static/src/js/payment_form.js"></script> + </xpath> + </template> + </data> +</odoo> diff --git a/addons/payment_authorize/views/payment_views.xml b/addons/payment_authorize/views/payment_views.xml new file mode 100644 index 00000000..310d4fbe --- /dev/null +++ b/addons/payment_authorize/views/payment_views.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="acquirer_form_authorize" model="ir.ui.view"> + <field name="name">acquirer.form.authorize</field> + <field name="model">payment.acquirer</field> + <field name="inherit_id" ref="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" password="True"/> + <button class="oe_link" icon="fa-refresh" type="object" name="action_client_secret" string="Generate Client Key" /> + </div> + <a colspan="2" href="https://www.odoo.com/documentation/14.0/applications/general/payment_acquirers/authorize.html" target="_blank">How to get paid with Authorize.Net</a> + </group> + </xpath> + </field> + </record> + + <record id="token_form_authorize_net" model="ir.ui.view"> + <field name='name'>payment.token.form</field> + <field name='model'>payment.token</field> + <field name="inherit_id" ref="payment.payment_token_form_view"/> + <field name="arch" type="xml"> + <xpath expr='//field[@name="acquirer_ref"]' position='after'> + <field name="authorize_profile" attrs="{'invisible':['|', ('provider', '!=', 'authorize'), ('save_token', '=', 'none')]}"/> + <field name="provider" invisible='1'/> + <field name="save_token" invisible='1'/> + </xpath> + </field> + </record> +</odoo> |
