Files
Odoo-Modules/fusion_clover/views/payment_clover_templates.xml
gsinghpal a2fe1fcbcc changes
2026-04-29 03:35:33 -04:00

130 lines
6.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Inline payment form template for Clover.
The card data fields are RENDERED BY CLOVER in iframes mounted
into the empty <div id="clover-card-*"> containers below. Card
data NEVER touches Odoo - the Clover iframe SDK posts directly
to Clover's tokenization endpoint and returns a clv_xxx token
which is what we then send to the backend. This is the only
way to keep Westin / NEXA out of PCI SAQ-D scope. -->
<template id="inline_form">
<t t-set="inline_form_values"
t-value="provider_sudo._clover_get_inline_form_values(
amount,
currency,
partner_id,
mode == 'validation',
payment_method_sudo=pm_sudo,
)"
/>
<div name="o_clover_payment_container"
class="o_clover_payment_form"
t-att-data-clover-inline-form-values="inline_form_values">
<!-- Terminal toggle (back-office staff or in-person checkout) -->
<div class="mb-3 form-check"
name="o_clover_terminal_toggle_wrapper"
style="display:none;">
<input type="checkbox" class="form-check-input"
id="clover_use_terminal" name="use_terminal"/>
<label class="form-check-label" for="clover_use_terminal">
<i class="fa fa-credit-card-alt me-1"/>
Pay on Clover Terminal
</label>
</div>
<div class="mb-3" id="clover_terminal_select_wrapper" style="display:none;">
<label class="form-label" for="clover_terminal_select">Select Terminal</label>
<select class="form-select" id="clover_terminal_select" name="terminal_id">
<option value="">Loading terminals...</option>
</select>
</div>
<!-- Clover.js iframe mount points (card data lives inside these
iframes, never in our DOM). -->
<div class="o_clover_iframe_form" name="o_clover_iframe_form">
<div class="mb-3">
<label class="form-label" for="clover-card-number">Card Number</label>
<div id="clover-card-number" class="form-control"
style="height:42px; padding:0;"/>
<div class="invalid-feedback d-block"
id="clover-card-number-errors" role="alert"/>
</div>
<div class="row mb-3">
<div class="col-6">
<label class="form-label" for="clover-card-date">Expiry (MM/YY)</label>
<div id="clover-card-date" class="form-control"
style="height:42px; padding:0;"/>
<div class="invalid-feedback d-block"
id="clover-card-date-errors" role="alert"/>
</div>
<div class="col-6">
<label class="form-label" for="clover-card-cvv">CVV</label>
<div id="clover-card-cvv" class="form-control"
style="height:42px; padding:0;"/>
<div class="invalid-feedback d-block"
id="clover-card-cvv-errors" role="alert"/>
</div>
</div>
<div class="mb-3">
<label class="form-label" for="clover-card-postal-code">Postal Code</label>
<div id="clover-card-postal-code" class="form-control"
style="height:42px; padding:0;"/>
<div class="invalid-feedback d-block"
id="clover-card-postal-code-errors" role="alert"/>
</div>
<div class="alert alert-warning d-none"
id="clover-sdk-error" role="alert">
<i class="fa fa-exclamation-triangle me-1"/>
<span id="clover-sdk-error-message">
Could not load the Clover payment form.
</span>
</div>
</div>
<!-- Card type selector (only visible if surcharge is on AND the
iframe SDK couldn't auto-detect the brand from the typed
card number, e.g. for "Other"). -->
<div class="mb-3 o_clover_card_type_section" style="display:none;">
<label class="form-label">Card Type</label>
<div class="d-flex gap-2 flex-wrap">
<div class="form-check">
<input type="radio" class="form-check-input" name="clover_card_type"
id="clover_ct_visa" value="visa"/>
<label class="form-check-label" for="clover_ct_visa">Visa</label>
</div>
<div class="form-check">
<input type="radio" class="form-check-input" name="clover_card_type"
id="clover_ct_mc" value="mastercard"/>
<label class="form-check-label" for="clover_ct_mc">Mastercard</label>
</div>
<div class="form-check">
<input type="radio" class="form-check-input" name="clover_card_type"
id="clover_ct_amex" value="amex"/>
<label class="form-check-label" for="clover_ct_amex">Amex</label>
</div>
<div class="form-check">
<input type="radio" class="form-check-input" name="clover_card_type"
id="clover_ct_other" value="other" checked="checked"/>
<label class="form-check-label" for="clover_ct_other">Other</label>
</div>
</div>
</div>
<div class="mb-3 o_clover_surcharge_notice" style="display:none;">
<div class="alert alert-info py-2 mb-0">
<small>
<i class="fa fa-info-circle me-1"/>
<span>A credit card processing fee of </span>
<strong id="clover_surcharge_rate">0.00</strong>
<span>% (<strong id="clover_surcharge_amount">$0.00</strong>) will be added to your total.</span>
</small>
</div>
</div>
</div>
</template>
</odoo>