summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorjeff <jeff>2007-06-15 00:58:41 +0000
committerjeff <jeff>2007-06-15 00:58:41 +0000
commit8607eda7be33ce9032dfa4ddf159a171ddfbf90a (patch)
treeef67308f0c9a5d3222e1ba12237a75ec64aefd7a /FS
parente1b8bdcf9d64e66b875b34bf576fab3afff71336 (diff)
store exp in cust_pay and pass to B:OP during refunds with paynum (#1662)
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Schema.pm1
-rw-r--r--FS/FS/cust_main.pm8
2 files changed, 6 insertions, 3 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 9f244740d..7f5149bd4 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -527,6 +527,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 3dbd9c4d5..1dc167a26 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -2567,10 +2567,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+$/;
@@ -2754,6 +2755,7 @@ sub realtime_bop {
'payby' => $method2payby{$method},
'payinfo' => $payinfo,
'paybatch' => $paybatch,
+ 'paydate' => $paydate,
} );
my $error = $cust_pay->insert($options{'manual'} ? ( 'manual' => 1 ) : () );
if ( $error ) {
@@ -3098,8 +3100,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+$/;