<?xml version="1.0"?>
<t t-name="payment.transaction_status">
        <!-- Variables description:
            - 'tx' - The transaction whose status must be displayed
        -->
        <t t-if="tx.state == 'draft'">
            <t t-set="alert_style" t-value="'info'"/>
            <t t-set="status_message">
                <p>Your payment has not been processed yet.</p>
            </t>
        </t>
        <t t-elif="tx.state == 'pending'">
            <t t-set="alert_style" t-value="'warning'"/>
            <t t-set="status_message" t-value="tx.provider_id.sudo().pending_msg"/>
        </t>
        <t t-elif="tx.state == 'authorized'">
            <t t-set="alert_style" t-value="'success'"/>
            <t t-set="status_message" t-value="tx.provider_id.sudo().auth_msg"/>
        </t>
        <t t-elif="tx.state == 'done'">
            <t t-set="alert_style" t-value="'success'"/>
            <t t-set="status_message" t-value="tx.provider_id.sudo().done_msg"/>
        </t>
        <t t-elif="tx.state == 'cancel'">
            <t t-set="alert_style" t-value="'danger'"/>
            <t t-set="status_message" t-value="tx.provider_id.sudo().cancel_msg"/>
        </t>
        <t t-elif="tx.state == 'error'">
            <t t-set="alert_style" t-value="'danger'"/>
            <t t-set="status_message">
                <p>An error occurred during the processing of your payment.</p>
            </t>
        </t>

        <t t-if="is_html_empty(status_message)" t-set="status_message" t-value="''"/>

        <div t-if="status_message or tx.state_message" id="o_payment_status_alert" t-attf-class="alert alert-{{alert_style}} alert-dismissible">
            <button class="btn-close" data-bs-dismiss="alert" title="Dismiss"/>
            <t t-if="status_message" t-out="status_message"/>
            <t t-if="tx.state_message" t-out="tx.state_message"/>
        </div>
    </t>

