diff options
author | jeff <jeff> | 2007-06-15 00:58:18 +0000 |
---|---|---|
committer | jeff <jeff> | 2007-06-15 00:58:18 +0000 |
commit | 73cce7005218a6bf230b2f592c880b48d85b3196 (patch) | |
tree | 05a617c3e52c653bafa5afe930caa60dc0b02d4a | |
parent | ded6788163610ba6a33e19896f1468c20850823a (diff) |
store exp in cust_pay and pass to B:OP during refunds with paynum (#1662)
-rw-r--r-- | FS/FS/Schema.pm | 1 | ||||
-rw-r--r-- | FS/FS/cust_main.pm | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 463f63774..b0677be68 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -526,6 +526,7 @@ sub tables_hashref { # 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, '', '', ], diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index b219c6ce8..c798c4f26 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -2566,10 +2566,11 @@ sub realtime_bop { $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+$/; @@ -2753,6 +2754,7 @@ sub realtime_bop { 'payby' => $method2payby{$method}, 'payinfo' => $payinfo, 'paybatch' => $paybatch, + 'paydate' => $paydate, } ); my $error = $cust_pay->insert($options{'manual'} ? ( 'manual' => 1 ) : () ); if ( $error ) { @@ -3105,8 +3107,8 @@ sub realtime_refund_bop { 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+$/; |