Fix looking in wrong place for OU for setting lookup call
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 19 Sep 2013 20:05:18 +0000 (16:05 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 19 Sep 2013 20:05:18 +0000 (16:05 -0400)
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm

index 32e4417..321e190 100644 (file)
@@ -75,7 +75,10 @@ sub process_stripe_or_bop_payment {
     if (!$cc_args->{processor}) {
         if (!($cc_args->{processor} =
                 $U->ou_ancestor_setting_value(
-                    $cc_args->{ou}, 'credit.processor.default'))) {
+                    $this_ou, 'credit.processor.default'
+                )
+            )
+        ) {
             return OpenILS::Event->new('CREDIT_PROCESSOR_NOT_SPECIFIED');
         }
     }
@@ -388,9 +391,11 @@ sub make_payments {
             if ($U->event_code($response)) { # non-success (success is 0)
                 $logger->info(
                     "Credit card payment for user $user_id failed: " .
-                    $response->{"textcode"} . " " .
-                    $response->{"payload"}->{"error_message"}
+                    $response->{textcode} . " " .
+                    ($response->{payload}->{error_message} ||
+                        $response->{payload}{message})
                 );
+                return $response;
             } else {
                 # We need to save this for later in case there's a failure on
                 # the EG side to store the processor's result.