summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-12-04 21:35:52 -0800
committerJonathan Prykop <jonathan@freeside.biz>2016-12-05 09:05:10 -0600
commit998d7aa2fd1394d70a4043fac9eac8fbec8cc41d (patch)
treea224e705c7b1fbabffe1eb209957e6659d2349c8
parent32d2dd6ca5cbf5fd557583502211cbc4c036e22e (diff)
minor fix for custnum-less cust_pay_pending, #71513
-rw-r--r--FS/FS/cust_main/Billing_Realtime.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm
index 0ea94c8..0ef423b 100644
--- a/FS/FS/cust_main/Billing_Realtime.pm
+++ b/FS/FS/cust_main/Billing_Realtime.pm
@@ -2552,7 +2552,11 @@ CUSTLOOP:
# might happen for cust_pay_pending from failed verify records,
# in which case we attempt tokenization without cust_main
# everything else should absolutely have a cust_main
- unless ($table eq 'cust_pay_pending' && $record->{'custnum_pending'}) {
+ if ($table eq 'cust_pay_pending' and !$record->custnum ) {
+ # override the usual safety check and allow the record to be
+ # updated even without a custnum.
+ $record->set('custnum_pending', 1);
+ } else {
my $error = "Could not load cust_main for $table ".$record->get($record->primary_key);
if ($opt{'queue'}) {
$log->critical($error);
@@ -2634,7 +2638,7 @@ CUSTLOOP:
warn "ATTEMPTING GATEWAY-ONLY TOKENIZE" if $debug && !$cust_main;
# if we got this far, time to mutex
- $record = $record->select_for_update;
+ $record->select_for_update;
# no clear record of name/address/etc used for transaction,
# but will load name/phone/id from customer if run as an object method,