The groovy validation script

This is how the groovy script actually looks like:

At the beginning of the script a ClientValidationException is instantiated. In the middle part, the different validations are called. At the end, the ClientValidationException is checked to see if it contains any errors (size > 0). If so, the exception is thrown, the payment will not be persisted and the user will get the different validation errors in a message box on screen. If not, the context (the payment) will be returned and persisted.

Currently two validations are available in the product.