- $self->required_fields(qw/
- host port configfile keyfile amount cardNumber cardExpMonth cardExpYear
- /);
+ my @required_fields = qw(host port configfile keyfile amount);
+ if ($self->transaction_type() =~ /^(cc|visa|mastercard|american express|discover)$/i) {
+ push @required_fields, qw(cardnumber cardexpmonth cardexpyear);
+ }elsif ($self->transaction_type() =~ /^check$/i) {
+ push @required_fields, qw(
+ dl dlstate routing account accounttype bankname bankstate name
+ );
+ }
+ $self->required_fields(@required_fields);