65 lines
3.8 KiB
XML
65 lines
3.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<record id="payment_provider_form" model="ir.ui.view">
|
|
<field name="name">Stripe Provider Form</field>
|
|
<field name="model">payment.provider</field>
|
|
<field name="inherit_id" ref="payment.payment_provider_form"/>
|
|
<field name="arch" type="xml">
|
|
<group name="provider_credentials" position="before">
|
|
<div invisible="context.get('stripe_onboarding', False)"
|
|
name="stripe_onboarding_group"
|
|
attrs="{'invisible': ['|', '|', ('code', '!=', 'stripe'), ('stripe_secret_key', '!=', False), ('stripe_publishable_key', '!=', False)]}">
|
|
<button string="Connect Stripe"
|
|
type="object"
|
|
name="action_stripe_connect_account"
|
|
class="btn-primary"
|
|
colspan="2"
|
|
attrs="{'invisible': [('state', '=', 'enabled')]}"/>
|
|
</div>
|
|
</group>
|
|
<group name="provider_credentials" position="inside">
|
|
<group attrs="{'invisible': [('code', '!=', 'stripe')]}" name="stripe_credentials">
|
|
<field name="stripe_publishable_key" attrs="{'required':[('code', '=', 'stripe'), ('state', '!=', 'disabled')]}"/>
|
|
<field name="stripe_secret_key" attrs="{'required':[('code', '=', 'stripe'), ('state', '!=', 'disabled')]}" password="True"/>
|
|
<label for="stripe_webhook_secret"/>
|
|
<div class="o_row" col="2">
|
|
<field name="stripe_webhook_secret" password="True"/>
|
|
<button string="Generate your webhook"
|
|
type="object"
|
|
name="action_stripe_create_webhook"
|
|
class="btn-primary"
|
|
attrs="{'invisible': ['|', ('stripe_webhook_secret', '!=', False), ('stripe_secret_key', '=', False)]}"/>
|
|
</div>
|
|
</group>
|
|
<div name="stripe_keys_link"
|
|
invisible="not context.get('stripe_onboarding', False)"
|
|
attrs="{'invisible': ['|', ('code', '!=', 'stripe'), '&', ('stripe_secret_key', '!=', False), ('stripe_publishable_key', '!=', False)]}">
|
|
<a class="btn btn-link" role="button" href="https://dashboard.stripe.com/account/apikeys" target="_blank">
|
|
Get your Secret and Publishable keys
|
|
</a>
|
|
</div>
|
|
</group>
|
|
<field name="allow_express_checkout" position="replace">
|
|
<label for="allow_express_checkout" attrs="{'invisible': ['|', ('support_express_checkout', '=', False), ('show_allow_express_checkout', '=', False)]}"/>
|
|
<div class="o_row" col="2" attrs="{'invisible': ['|', ('support_express_checkout', '=', False), ('show_allow_express_checkout', '=', False)]}">
|
|
<field name="allow_express_checkout"/>
|
|
<button string="Enable Apple Pay"
|
|
type="object"
|
|
name="action_stripe_verify_apple_pay_domain"
|
|
class="btn btn-primary"
|
|
attrs="{'invisible': [('allow_express_checkout', '!=', True)]}"/>
|
|
</div>
|
|
</field>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="action_payment_provider_onboarding" model="ir.actions.act_window">
|
|
<field name="name">Payment Providers</field>
|
|
<field name="res_model">payment.provider</field>
|
|
<field name="view_mode">form</field>
|
|
<field name="context">{'stripe_onboarding': True, 'form_view_initial_mode': 'edit'}</field>
|
|
</record>
|
|
|
|
</odoo>
|