X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=NMI.pm;fp=NMI.pm;h=a20c9598bbb97f5f3e0ac8ca0ca0cab879460afd;hb=e74f5f0a651caeff48076605e220e3600118ae47;hp=ca4cdb6113e9024d52ba0409a58e5d50920a0d07;hpb=d1b9ecf606c0fd6a6b37a22e366c9ad8dbadc724;p=Business-OnlinePayment-NMI.git diff --git a/NMI.pm b/NMI.pm index ca4cdb6..a20c959 100644 --- a/NMI.pm +++ b/NMI.pm @@ -9,7 +9,7 @@ use URI::Escape; use vars qw($VERSION @ISA $DEBUG); @ISA = qw(Business::OnlinePayment::HTTPS); -$VERSION = '0.01'; +$VERSION = '0.02'; $DEBUG = 0; @@ -151,12 +151,13 @@ sub map_fields { $content{'payment'} = $types{lc($content{'type'})} or die "Payment method '$content{type}' not supported.\n"; $content{'action'} = $actions{lc($content{'action'})} or die "Transaction type '$content{action}' not supported.\n"; - $content{'expiration'} =~ s/\D//g; + $content{'expiration'} =~ s/\D//g if defined($content{'expiration'}); $content{'account_type'} ||= 'personal checking'; @content{'account_holder_type', 'account_type'} = map {lc} split /\s/, $content{'account_type'}; - $content{'ship_name'} = $content{'ship_first_name'}.' '.$content{'ship_last_name'}; + $content{'ship_name'} = $content{'ship_first_name'} ? + ($content{'ship_first_name'}.' '.$content{'ship_last_name'}) : ''; $self->content(%content); }