JBAS-1503 PP fetch in-db user for last_xact_id
authorBill Erickson <berickxx@gmail.com>
Tue, 16 Aug 2016 14:58:27 +0000 (10:58 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
During Silent POST handling, fetch the user from the db to pick up the
most recent last_xact_id value for fines payment.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm

index 2ac8f23..52f5097 100644 (file)
@@ -1897,9 +1897,14 @@ sub create_tmp_auth {
 
     $e->authtoken($authtoken);
     if ($e->checkauth) { # test token and set $e->requestor
+
         $logger->info(
             "PayflowHosted existing authtoken still valid for $user_id"); 
-        return undef;
+
+        # Need to fetch the in-database user in addition to the cached
+        # auth session to pick up the current user->last_xact_id
+        $self->ctx->{user} = $e->requestor;
+        return $self->prepare_extended_user_info;
     }
 
     $logger->info("PayflowHosted generating temp auth token for $user_id");
@@ -1916,7 +1921,11 @@ sub create_tmp_auth {
             ($authtoken = $evt->{payload}->{authtoken})) {
         $e->authtoken($authtoken);
         $e->checkauth; # sets $e->requestor
-        return undef;
+
+        # Need to fetch the in-database user in addition to the cached
+        # auth session to pick up the current user->last_xact_id
+        $self->ctx->{user} = $e->requestor;
+        return $self->prepare_extended_user_info;
     }
 
     $logger->error("PayflowHosted unable to generate temp auth ".
@@ -2024,7 +2033,7 @@ sub payflow_create_payment {
         "open-ils.circ", 
         "open-ils.circ.money.payment",
         $self->editor->authtoken, $args, 
-        $self->editor->requestor->last_xact_id
+        $self->ctx->{user}->last_xact_id
     );
 
     if ($resp->{textcode}) {