Three types of additional fields
They come in three forms, which differ in who sets them up and what they depend on.
All three are placed within the payment method loop and visually belong below the name of the payment method. Whether any of them applies to a payment method at all is answered in one go by
PAY-Data_html_container_remarks.
Free input fields
Up to three free input fields can be set up for each payment method. Each has the same set of four tags, distinguished by the number.
For the second and third field, the tags are named
PAY-Data_InputSuffix2… and PAY-Data_InputSuffix3… accordingly.
Wrap the block with
PAY-Data_InputSuffix1_input, not with PAY-Data_InputSuffix1. The field name is only available if the field is set up for this payment method at all. The value, on the other hand, is empty on the first call even if the field exists, and the block would then be missing.The asterisk after the label comes from
PAY-Data_InputSuffix1_required. This lets you decide yourself how to mark mandatory fields. Regardless of this, the shop system checks the requirement when the form is submitted.Country-specific additional information
Some payment methods need information that only applies in certain countries. It is set up in the shop configurationshop.config in the <+CountryRule> section of the respective payment method. The shop system displays it as soon as the payment method and delivery country match.
Reference: Section +CountryRule
The loop
PAY-Data_CountryRule iterates over the additional information that currently applies to this payment method. As a single tag, it outputs their number.
PAY-Data_html_class_countryrule_global takes paymentcountryrule as its only argument. It returns the class that the block output also sets at this point, thereby supplementing the four general class tags.Which type of field
Each piece of additional information is one of four things. Four range tags and a code tell you which one.PAY-Data_CountryRule_Type_code outputs the same code as a number.
You do not need the code for the template. The four range tags are more readable and keep the template understandable even if a fifth type is added later. The code is intended for cases where you want to pass the type on to JavaScript.
The common information
These tags apply regardless of the type of field.PAY-Data_CountryRule_maxlength only applies if a maximum length is set up for the field at all. Therefore, set the attribute wrapped in a range tag, otherwise there will be an empty maxlength in the markup.PAY-Data_CountryRule_errormessage only applies if there is an input error and an error message is stored for this additional information. For the case without a stored text, you should provide a general note via PAY-Data_CountryRule_error.Text input field and checkbox
PAY-Data_CountryRule_value behaves differently depending on the type. For the text input field, it is the buyer’s input; for the checkbox, it outputs checked; and for a selection list, it outputs the technical value of the selected entry. This one tag therefore covers all cases; you just place it at the appropriate point in the markup.Selection list
Retrieve the entries of the list with a second loop.PAY-Data_CountryRule_value returns the technical value of the selection, PAY-Data_CountryRule_value_txt the corresponding display text. For a country list, this would be DEU and Deutschland. For displaying the choice made elsewhere on the page, value_txt is the right tag; for hidden fields and JavaScript, use value.PAY-Data_CountryRule_value_txt is only filled for selection lists. For the other three types, it remains empty, and the range tag does not apply.The three
listbox_ tags work exclusively within {@PAY-Data_CountryRule_listbox}. Outside of it, they are treated as an invalid tag.Date of birth
For the date of birth type, the shop system creates the three selection lists for day, month, and year itself.The lists are prefilled with the date of birth from the billing address, if one is stored there. The buyer then does not have to enter it again.
Special fields of individual payment methods
Three payment methods bring their own fields that only appear with them.Cost center
With the cost center payment method, the buyer specifies a cost center number and the email address of the approver. Both fields have the same set of four tags.The two fields can be set up individually. Therefore, wrap each one separately with its
_input tag instead of wrapping both together. Otherwise, the configured field disappears as soon as the other one is missing.The maximum length of both fields is 64 characters. Set
maxlength yourself; there is no tag for it.Bank selection with PayEx
PAY-Data_Special_payexbankselection creates the ready-made selection of the bank. It only appears for the direct debit via PayEx payment method.
Container for the PayPal payment methods
PAY-Data_Special_PayPalMethodsDivContainerID returns the ID of the container into which PayPal loads its own payment method selection.
The container remains empty until the PayPal script fills it. Therefore, create it without any content of its own and without a fixed height, and always take the ID from the tag.
The tags at a glance
All tags apply on the payment and shipping method page
ws_pay_deliv.htm within the @PAY-Data loop. The listbox_ tags additionally apply only within {@PAY-Data_CountryRule_listbox}.
Related topics
- Reference: PAY- (Displaying and selecting payment methods)
- Reference: Section +CountryRule
- Guide: Selecting the payment method
- Guide: Creating payment methods
