X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=ac1fba5baec228e00d51ba4893780250b76437af;hb=eb9f717502fa1259c30c91cbfedba36f0cc47380;hp=1dc167a26ade151c3f646e75c92c96a721caa135;hpb=8607eda7be33ce9032dfa4ddf159a171ddfbf90a;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 1dc167a26..ac1fba5ba 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -2891,7 +2891,7 @@ L for supported gateways. Available methods are: I, I and I -Available options are: I, I, I +Available options are: I, I, I, I Most gateways require a reference to an original payment transaction to refund, so you probably need to specify a I. @@ -2900,6 +2900,9 @@ I defaults to the original amount of the payment if not specified. I specifies a reason for the refund. +I specifies the expiration date for a credit card overriding the +value from the customer record or the payment record. Specified as yyyy-mm-dd + Implementation note: If I is unspecified or equal to the amount of the orignal payment, first an attempt is made to "void" the transaction via the gateway (to cancel a not-yet settled transaction) and then if that fails, @@ -3100,11 +3103,13 @@ sub realtime_refund_bop { if ( $cust_pay ) { $content{card_number} = $payinfo = $cust_pay->payinfo; - $cust_pay->paydate =~ /^\d{2}(\d{2})[\/\-](\d+)[\/\-]\d+$/ && - ($content{expiration} = "$2/$1"); # where available + (exists($options{'paydate'}) ? $options{'paydate'} : $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+$/; + (exists($options{'paydate'}) ? $options{'paydate'} : $self->paydate) + =~ /^\d{2}(\d{2})[\/\-](\d+)[\/\-]\d+$/; $content{expiration} = "$2/$1"; }