# eventually
'payinfo', 'varchar', 'NULL', 512, '', '', #see cust_main above
'paymask', 'varchar', 'NULL', $char_d, '', '',
+ 'paydate', 'varchar', 'NULL', 10, '', '',
'paybatch', 'varchar', 'NULL', $char_d, '', '', #for auditing purposes.
'closed', 'char', 'NULL', 1, '', '',
],
$content{invoice_number} = $options{'invnum'}
if exists($options{'invnum'}) && length($options{'invnum'});
+ my $paydate = '';
if ( $method eq 'CC' ) {
$content{card_number} = $payinfo;
- my $paydate = exists($options{'paydate'})
+ $paydate = exists($options{'paydate'})
? $options{'paydate'}
: $self->paydate;
$paydate =~ /^\d{2}(\d{2})[\/\-](\d+)[\/\-]\d+$/;
'payby' => $method2payby{$method},
'payinfo' => $payinfo,
'paybatch' => $paybatch,
+ 'paydate' => $paydate,
} );
my $error = $cust_pay->insert($options{'manual'} ? ( 'manual' => 1 ) : () );
if ( $error ) {
if ( $cust_pay ) {
$content{card_number} = $payinfo = $cust_pay->payinfo;
- #$self->paydate =~ /^\d{2}(\d{2})[\/\-](\d+)[\/\-]\d+$/;
- #$content{expiration} = "$2/$1";
+ $cust_pay->paydate =~ /^\d{2}(\d{2})[\/\-](\d+)[\/\-]\d+$/ &&
+ ($content{expiration} = "$2/$1"); # where available
} else {
$content{card_number} = $payinfo = $self->payinfo;
$self->paydate =~ /^\d{2}(\d{2})[\/\-](\d+)[\/\-]\d+$/;