summaryrefslogtreecommitdiff
path: root/addons/payment/views/payment_acquirer_onboarding_templates.xml
blob: b94d2031a4677295fe6fd4f6da3762d9cbb8f22b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <!-- onboarding step -->
    <template id="onboarding_payment_acquirer_step">
        <t t-call="base.onboarding_step">
            <t t-set="title">Payment Method</t>
            <t t-set="description">Choose your default customer payment method.</t>
            <t t-set="btn_text">Set payments</t>
            <t t-set="done_text">Payment method set!</t>
            <t t-set="method" t-value="'action_open_payment_onboarding_payment_acquirer'" />
            <t t-set="model" t-value="'res.company'" />
            <t t-set="state" t-value="state.get('payment_acquirer_onboarding_state')" />
        </t>
    </template>
    <!--PAYMENT ACQUIRER-->
    <record model="ir.ui.view" id="payment_acquirer_onboarding_wizard_form">
        <field name="name">payment.acquirer.onboarding.wizard.form</field>
        <field name="model">payment.acquirer.onboarding.wizard</field>
        <field name="arch" type="xml">
            <form string="Choose a payment method" class="o_onboarding_payment_acquirer_wizard">
                <div class="container">
                    <div class="row align-items-start">
                        <div class="col col-4" name="left-column">
                            <group>
                                <field name="payment_method" widget="radio" nolabel="1"/>
                            </group>
                        </div>
                        <div class="col" name="right-column">
                            <div attrs="{'invisible': [('payment_method', '!=', 'paypal')]}">
                                <group>
                                    <field name="paypal_user_type" widget="radio" nolabel="1"/>
                                    <field name="paypal_email_account" attrs="{'required': [('payment_method', '=', 'paypal')]}" string="Email"/>
                                    <field name="paypal_seller_account" attrs="{'invisible': [('paypal_user_type', '=', 'new_user')], 'required': [('paypal_user_type', '!=', 'new_user'), ('payment_method', '=', 'paypal')]}" />
                                    <field name="paypal_pdt_token" password="True" attrs="{'invisible': [('paypal_user_type', '=', 'new_user')], 'required': [('paypal_user_type', '!=', 'new_user'), ('payment_method', '=', 'paypal')]}" />
                                </group>
                                <p attrs="{'invisible': [('paypal_user_type', '!=', 'new_user')]}">
                                    <span>Start selling directly without an account; an email will be sent by Paypal to create your new account and collect your payments.</span>
                                </p>
                                <p attrs="{'invisible': [('paypal_user_type', '=', 'new_user')]}">
                                    <a href="https://www.odoo.com/documentation/14.0/applications/general/payment_acquirers/paypal.html" target="_blank">
                                        <span class="fa fa-arrow-right"> How to configure your PayPal account</span>
                                    </a>
                                </p>
                            </div>
                            <div attrs="{'invisible': [('payment_method', '!=', 'stripe')]}">
                                <group>
                                    <field name="stripe_secret_key" password="True"
                                       attrs="{'required': [('payment_method', '=', 'stripe')]}" />
                                    <field name="stripe_publishable_key" password="True"
                                       attrs="{'required': [('payment_method', '=', 'stripe')]}" />
                                </group>
                                <p>
                                    <a href="https://dashboard.stripe.com/account/apikeys" target="_blank">
                                        <span class="fa fa-arrow-right"> Get my Stripe keys</span>
                                    </a>
                                </p>
                            </div>

                            <div attrs="{'invisible': [('payment_method', '!=', 'other')]}">
                                <button type="object" name="action_onboarding_other_payment_acquirer">
                                    Check here
                                </button>
                                to choose another payment method.
                            </div>
                            <div attrs="{'invisible': [('payment_method', '!=', 'manual')]}">
                                <group>
                                    <field name="manual_name" attrs="{'required': [('payment_method', '=', 'manual')]}"/>
                                    <field name="journal_name" attrs="{'required': [('payment_method', '=', 'manual')]}"/>
                                    <field name="acc_number" attrs="{'required': [('payment_method', '=', 'manual')]}"/>
                                    <field name="manual_post_msg" attrs="{'required': [('payment_method', '=', 'manual')]}"/>
                                </group>
                            </div>
                        </div>
                    </div>
                </div>
                <footer>
                    <button name="add_payment_methods" string="Apply" class="oe_highlight"
                            type="object" />
                    <button special="cancel" string="Cancel" />
                </footer>
            </form>
        </field>
    </record>
    <record id="action_open_payment_onboarding_payment_acquirer_wizard" model="ir.actions.act_window">
        <field name="name">Choose a payment method</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">payment.acquirer.onboarding.wizard</field>
        <field name="view_mode">form</field>
        <field name="view_id" ref="payment.payment_acquirer_onboarding_wizard_form" />
        <field name="target">new</field>
    </record>
</odoo>