summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorjeff <jeff>2007-06-15 18:44:00 +0000
committerjeff <jeff>2007-06-15 18:44:00 +0000
commit7080754e250cb1b2e93e08fbf3272ae5b14b470d (patch)
tree19f1903c259223803a3cbee66a398bbde125b35f /FS
parent73cce7005218a6bf230b2f592c880b48d85b3196 (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 c798c4f26..e221c4228 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -2898,7 +2898,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>.
@@ -2907,6 +2907,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,
@@ -3107,11 +3110,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";
}