* Fields that are to be shown on the payment form.
*/
protected static function addCommonFields(&$form, $paymentFields) {
- $requiredPaymentFields = array();
+ $requiredPaymentFields = $paymentFieldsMetadata = [];
foreach ($paymentFields as $name => $field) {
if ($field['htmlType'] == 'chainSelect') {
$form->addChainSelect($field['name'], array('required' => FALSE));
// This will cause the fields to be marked as required - but it is up to the payment processor to
// validate it.
$requiredPaymentFields[$field['name']] = $field['is_required'];
+ $paymentFieldsMetadata[$field['name']] = $field;
}
+ $form->assign('paymentFieldsMetadata', $paymentFieldsMetadata);
$form->assign('requiredPaymentFields', $requiredPaymentFields);
}
</div>
<div class="content">
{$form.$paymentField.html}
- {if $paymentField == 'cvv2'}{* @todo move to form assignment*}
+ {if $paymentFieldsMetadata.$name.description}
+ <div class="description">{$paymentFieldsMetadata.$name.description}</div>
+ {elseif $paymentField == 'cvv2'}{* @todo move to form assignment*}
<span class="cvv2-icon" title="{ts}Usually the last 3-4 digits in the signature area on the back of the card.{/ts}"> </span>
{/if}
{if $paymentField == 'credit_card_type'}