- my $payinfo = $self->payinfo;
- my $cardtype = cardtype($payinfo);
- $self->set('cardtype', $cardtype);
+
+ if ( $self->payinfo =~ /^99\d{14}$/ && ! $self->paycardtype ) {
+ return "paycardtype required (cannot be derived from a token)";
+ } else {
+ $self->set('paycardtype', cardtype($self->payinfo));
+ }
+