$subsection_data) {
$is_active = ($subsection_key === $active_email_subsection) ? '' : 'hidden';
?>
$field_config) {
$current_value = $settings[$option_key] ?? ($field_config['default'] ?? '');
$field_id = esc_attr($option_key);
$field_type = $field_config['type'] ?? 'text';
$field_label = esc_html($field_config['label'] ?? '');
$field_placeholder = isset($field_config['placeholder']) ? esc_attr($field_config['placeholder']) : '';
$field_description = $field_config['description'] ?? '';
$field_name = 'settings[' . esc_attr($option_key) . ']';
$input_class = 'mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm';
$select_class = 'mt-1 block w-full pl-3 pr-10 py-2 text-base border border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md';
$col_span_class = esc_attr($field_config['col_span'] ?? 'sm:col-span-6');
echo '
';
if ($field_type !== 'checkbox') {
echo '
' . $field_label . ' ';
}
// Define required and aria_describedby variables
$required = !empty($field_config['required']) ? 'required' : '';
$aria_describedby = !empty($field_description) ? 'aria-describedby="' . $field_id . '-description"' : '';
switch ($field_type) {
case 'text':
case 'email':
case 'url':
case 'tel':
echo '
';
break;
case 'number':
$min = isset($field_config['min']) ? ' min="' . esc_attr($field_config['min']) . '"' : '';
$max = isset($field_config['max']) ? ' max="' . esc_attr($field_config['max']) . '"' : '';
$step = isset($field_config['step']) ? ' step="' . esc_attr($field_config['step']) . '"' : '';
echo '
';
break;
case 'textarea':
echo '
';
break;
case 'select':
echo '
';
if (!empty($field_config['options']) && is_array($field_config['options'])) {
foreach ($field_config['options'] as $opt_val => $opt_label) {
echo '' . esc_html($opt_label) . ' ';
}
}
echo ' ';
break;
case 'multiselect':
echo '
';
if (!empty($field_config['options']) && is_array($field_config['options'])) {
foreach ($field_config['options'] as $opt_val => $opt_label) {
$selected = is_array($current_value) && in_array($opt_val, $current_value) ? 'selected="selected"' : '';
echo '' . esc_html($opt_label) . ' ';
}
}
echo ' ';
break;
case 'readonly':
echo '
';
echo '
';
break;
case 'checkbox':
echo '
';
echo ' ';
echo ' ' . $field_label . ' ';
echo '
';
if (!empty($field_description)) {
echo '
' . esc_html($field_description) . '
';
}
break;
case 'image':
echo '
';
echo '
';
echo ' ';
echo ' ';
echo '
';
echo esc_html__('Change', 'easy-invoice');
echo ' ';
echo '
';
echo '
';
break;
case 'wp_editor':
wp_editor( $current_value, $field_id, ['textarea_name' => $field_name, 'teeny' => true, 'media_buttons' => false, 'textarea_rows' => 7, 'editor_class' => 'mt-1'] );
// Handle description for wp_editor specifically
if (!empty($field_description)) {
echo '
' . esc_html($field_description) . '
';
}
break;
case 'test_email':
echo '
';
echo '
';
echo ' ';
echo ' ';
echo ' ';
echo ' ' . esc_html__('Send Test Email', 'easy-invoice');
echo ' ';
echo '
';
echo '
';
echo '
';
break;
case 'test_template_email':
$template_type = $field_config['template_type'] ?? '';
$is_payment_test = ($field_id === 'easy_invoice_payment_test_template');
$width_class = $is_payment_test ? 'w-[200px]' : 'w-64';
echo '
';
echo '
';
echo ' ';
echo ' ';
echo ' ';
echo ' ' . esc_html__('Test Template', 'easy-invoice');
echo ' ';
echo '
';
echo '
';
echo '
';
break;
case 'test_payment_reminder_email':
echo '
';
echo '
';
echo ' ';
echo ' ';
echo ' ';
echo ' ' . esc_html__('Test Reminder', 'easy-invoice');
echo ' ';
echo '
';
echo '
';
echo '
';
break;
default:
echo '
';
break;
}
if ($field_type !== 'checkbox' && $field_type !== 'wp_editor' && !empty($field_description)) {
echo '
' . esc_html($field_description) . '
';
}
echo '
'; // Close the field wrapper div
}
}
?>
{{invoice_number}}
{{due_date}}
{{invoice_url}}
{{payment_url}}
{{quote_number}}
{{expiry_date}}
{{quote_url}}
{{client_name}}
{{client_first_name}}
{{client_last_name}}
{{client_email}}
{{client_address}}
{{company_name}}
{{total_amount}}
{{issue_date}}
{{company_email}}
{{company_phone}}
{{payment_terms}}
1): ?>
[
'title' => __('Stripe', 'easy-invoice'),
'desc' => __('Cards, Apple Pay, Google Pay, Link. SCA / 3-D Secure built in.', 'easy-invoice'),
],
'square' => [
'title' => __('Square', 'easy-invoice'),
'desc' => __('US / CA / UK / AU / JP card processing with webhook reconciliation.', 'easy-invoice'),
],
'authorizenet' => [
'title' => __('Authorize.Net', 'easy-invoice'),
'desc' => __('Long-standing US gateway — credit cards + eChecks via AIM.', 'easy-invoice'),
],
'mollie' => [
'title' => __('Mollie', 'easy-invoice'),
'desc' => __('Europe-friendly: SEPA, iDEAL, Bancontact, Sofort, Klarna, card.', 'easy-invoice'),
],
'paystack' => [
'title' => __('Paystack', 'easy-invoice'),
'desc' => __('Africa-first (NGN / GHS / ZAR / KES / USD): card, bank, USSD, mobile money, QR.', 'easy-invoice'),
],
'moneris' => [
'title' => __('Moneris', 'easy-invoice'),
'desc' => __('Canada\'s largest card processor — Visa, Mastercard, AMEX, Interac.', 'easy-invoice'),
],
'bank_transfer'=> [
'title' => __('Bank Transfer', 'easy-invoice'),
'desc' => __('Show your IBAN / SWIFT on invoices; mark paid on wire arrival.', 'easy-invoice'),
],
'cheque' => [
'title' => __('Cheque', 'easy-invoice'),
'desc' => __('Display your mailing address; mark paid when the cheque clears.', 'easy-invoice'),
],
'cash' => [
'title' => __('Cash', 'easy-invoice'),
'desc' => __('In-person cash with custom collection instructions.', 'easy-invoice'),
],
];
// Hide the ones we already register in Free / are already shown above.
$already_registered = array_keys($all_gateways_sorted);
foreach ($already_registered as $id) {
unset($pro_gateway_teasers[$id]);
}
?>
$teaser):
$teaser_idx++;
// Mark items that start a new row so the row-divider rules look correct on every grid breakpoint.
$row_break_sm = ($teaser_idx > 2); // 2 cols
$row_break_lg = ($teaser_idx > 3); // 3 cols
$initial = strtoupper(mb_substr($teaser['title'], 0, 1));
?>
$gateway) : ?>
>
getTitle() : $gateway_id); ?>
getDescription()): ?>
getDescription()); ?>
getSettingsConfig() : [];
if (!empty($gateway_config['fields'])): ?>
$field_config): ?>
$subsection_data) {
$subsection_title = $subsection_data['title'] ?? '';
$subsection_description = $subsection_data['description'] ?? '';
?>
$field_config) {
$current_value = $settings[$option_key] ?? ($field_config['default'] ?? '');
easy_invoice_render_field($option_key, $field_config, $current_value);
}
}
?>
';
echo '
';
if (!empty($enable_tax_field['description'])) {
echo '
' . esc_html($enable_tax_field['description']) . '
';
}
echo '