summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorjeff <jeff>2007-06-15 18:44:17 +0000
committerjeff <jeff>2007-06-15 18:44:17 +0000
commiteb9f717502fa1259c30c91cbfedba36f0cc47380 (patch)
treea4fb3184cac68882fd4830a614963b53f4744c0b /FS
parent8607eda7be33ce9032dfa4ddf159a171ddfbf90a (diff)
paydate option for realtime_refund_bop and UI entry for cust_pay records without it (#1662 UI)
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_main.pm13
1 files changed, 9 insertions, 4 deletions
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<http://420.am/business-onlinepayment> for supported gateways.
Available methods are: I<CC>, I<ECHECK> and I<LEC>
-Available options are: I<amount>, I<reason>, I<paynum>
+Available options are: I<amount>, I<reason>, I<paynum>, I<paydate>
Most gateways require a reference to an original payment transaction to refund,
so you probably need to specify a I<paynum>.
@@ -2900,6 +2900,9 @@ I<amount> defaults to the original amount of the payment if not specified.
I<reason> specifies a reason for the refund.
+I<paydate> 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<amount> 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";
}