LP#1772680: Changed the code to accommodate new Registration Response Structure
authorJaswinder Singh <jaswinder.singh0011@gmail.com>
Mon, 17 Sep 2018 17:26:52 +0000 (13:26 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 4 Jun 2019 21:33:16 +0000 (17:33 -0400)
Signed-off-by: Jaswinder Singh <jaswinder.singh0011@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/EbookAPI/RBDigital.pm

index ac96002..e56a673 100644 (file)
@@ -420,12 +420,12 @@ sub register_patron {
 
     $logger->info("EbookAPI: Calling an API to registering Patron: $username");
     my $res = $self->request($req, $session_id);
-    if (defined ($res)) {
-        if ($res->{content}->{patronId}) {
+    if (defined($res)) {
+        if ($res->{content}->{patron}->{patronId}) {
             $logger->info("EbookAPI: User $username successfully registered with RBDigital portal.");
-            return $res->{content}->{patronId};
+            return $res->{content}->{patron}->{patronId};
         } else {
-            $logger->error("EbookAPI: Registration for $username to RBDigital failed: ".$res->{content}->{message});
+            $logger->error("EbookAPI: Registration for $username to RBDigital failed: " . Dumper($res));
         }
     }