CreditCardForm
DomainFull credit card entry form with live card visual preview. Auto-detects brand, formats number, flips card on CVV focus, validates expiry.
Add Payment Card
<%- include('modules/domain/common/payment/CreditCardForm', {
action: '/payment/cards',
method: 'post'
}) %>
Card declined. Please try a different card.
<%- include('modules/domain/common/payment/CreditCardForm', {
action: '/payment/cards',
error: 'Card declined. Please try a different card.'
}) %>
<%
var _action = locals.action || '#';
var _method = locals.method || 'post';
var _cancelHref = locals.cancelHref || null;
var _error = locals.error || '';
var _errors = locals.errors || {};
var _initial = locals.initial || {};
var _formId = locals.formId || ('credit-card-form-' + Math.random().toString(36).substr(2, 9));
var _brand = (_initial.brand || 'UNKNOWN').toUpperCase();
var _isAmex = _brand === 'AMEX';
var _maxCvv = _isAmex ? 4 : 3;
%>