Find payment details in ticket traffic from previous.

This commit is contained in:
Bradley M. Kuhn 2018-09-22 17:29:44 -07:00
parent 77f47bb9e1
commit c385cda4e4

View file

@ -258,6 +258,20 @@ while (my $file = readdir $dh) {
"ticket is in status \"$mainTicketStatus\" instead of \"needs-project-ok\"\n";
next;
}
my $ticketNum = $ticket; $ticketNum =~ s%^.*ticket/(\d+).*$%$1%;
my %paymentVals;
if ($PAYMENT_NUMBER >= 2) {
open(my $logFH, "-|", $RT_CMD, "show", $ticketNum);
while (my $line = <$logFH>) {
# Note that this will take the last one used, since rt log gives ticket traffic IN ORDER.
if ($line =~ /^\s*([^:]+)\s*:(\s*.+)$/) {
my($key, $val) = ($1, $2);
$paymentVals{$key} = $val if $key =~ /(CONTRACTED NAME|PAYMENT NAME|PAYMENT METHOD)/i;
print STDERR "\"$file\": \"$ticket\": rt show $ticketNum line match: $key $val for $line" if ($VERBOSE > 7);
}
}
close $logFH;
}
print STDERR "\"$file\": \"$ticket\": processing to payment $PAYMENT_NUMBER state... ";
my $successString = ($pass) ? "success" : "failed";
my $repositoryFile = File::Spec->catfile($PAYMENT_DIR, $mentorDate . "_" . $entity . '_' . $successString . '-report.mbox');