+ if ( $self->payby eq 'CHEK' ) {
+ # because '' is on the list of paytypes:
+ my $paytype = $self->paytype or return "Bank account type required";
+ if (grep { $_ eq $paytype} FS::cust_payby->paytypes) {
+ #ok
+ } else {
+ return "Bank account type '$paytype' is not allowed"
+ }
+ } else {
+ $self->set('paytype', '');
+ }
+