ePages 6.15.1 - DE_EPAGES/Address/API/Address.pm

Package DE_EPAGES::Address::API::Address

This module includes a function to update VATID

@EXPORT_OK
CheckZipcode
IsValidBankName

Functions

CheckZipcode
IsValidBankName

CheckZipcode

Returns true if zipcode is valid for the country and the country is one of the know countries incuded in $DE_EPAGES::Address::API::Constants::REGULAREXPRESSIONS_FOR_ZIPCODE. Returns true if $ZipCode or $CountryID is undefined or an empty string. Returns true if $CountryID is not included in $DE_EPAGES::Address::API::Constants::REGULAREXPRESSIONS_FOR_ZIPCODE.

Syntax
$check = CheckZipcode( $Zipcode, $CountryID );
Input
$Zipcode (string)
zipcode
$CountryID (int)
country id
Return
$check (boolean)
valid

IsValidBankName

Determines if the bank name is valid. A bank name is valid if its encrypted hash is not greater than 255 characters. In order to avoid unnecessary encryptions, the bank name is first checked for non-ascii characters or having a length greater than 64 characters --- which is the maximum length defined for a bank name (cf. EPG-23503). Empty bank names are considered valid.

Syntax
my $IsValid = IsValidBankName( $BankName );
Example
if ( !IsValidBankName( $FormValues->{'BankName'} ) ) {
    $Servlet->form->addFormError({
        Reason => 'BankNameTooLong',
        Form   => 'SavePaymentDirectDebit',
        Name   => 'BankName',
    });
    $Servlet->form->executeFormError;
}
Input
$BankName (string)
a bank name
Return
$IsValidBankName (boolean)
true if the bank name is valid