use base qw( FS::payinfo_Mixin FS::cust_main_Mixin FS::Record );
use strict;
+use Scalar::Util qw( blessed );
use Digest::SHA qw( sha512_base64 );
use Business::CreditCard qw( validate cardtype );
use FS::UID qw( dbh );
)
)
{
-warn $self->payinfo;
-warn $old->payinfo;
+
$self->payinfo($old->payinfo);
} elsif ( $self->payby =~ /^(CHEK|DCHK)$/ && $self->payinfo =~ /xx/ ) {
payinfo1 payinfo2 payinfo3 paytype paystate payname_CHEK )];
}
-=item cgi_hash_callback HASHREF
+=item cgi_hash_callback HASHREF OLD
Subroutine (not a class or object method). Processes a hash reference
of web interface contet (transfers the data from pseudo-fields to real fields).
+If OLD object is passed, also preserves locationnum, paystart_month, paystart_year,
+payissue and payip. If the new field is blank but the old is not, the old field
+will be preserved.
+
=cut
sub cgi_hash_callback {
my $hashref = shift;
+ my $old = shift;
my %noauto = (
'CARD' => 'DCRD',
$hashref->{paydate}= $hashref->{paydate_month}. '-'. $hashref->{paydate_year};
+ if ($old) {
+ foreach my $field ( qw(locationnum paystart_month paystart_year payissue payip) ) {
+ next if $hashref->{$field};
+ next unless $old->get($field);
+ $hashref->{$field} = $old->get($field);
+ }
+ }
+
}
=item search_sql