Create the template of the settings control
In the template for the settings control you define the UI, that will allow the user to set the values of the payment settings object of the payment method. Because the settings are serialized and only used in your custom logic in the payment provider class, you can create any input fields you need.
To create the template of the settings field, you must perform the following:
- Create a new .ascx file.
In the folder of your custom payment processor, add a new code file. Change its extension to .ascx.
- Mark the file as an embedded resource.
Right-click on the file and select Properties. Set the Build Action property to Embedded Resource.
- Define the default labels for the Title, Description and Example properties of the control.
Add Label controls for each of these properties and set their IDs to the respective values you have used in the class file.
- Create the input fields.
This example uses input fields for the following settings:
- Create a hidden field for the ID of the payment method.
This hidden field is needed in order to store and access the ID of the payment method that is being managed.
NOTE: To create validation for the fields use the ValidationDefinition object.
NOTE: You can order and style the fields in your template as you need. The suggested structure serves as an example and as a guideline on how to group your fields. The most important thing is to pay attention to the types of the fields and the controls used for them, and to the IDs of the respective controls.
Use the following code for the whole template: