only append street2 to CC payment address if no address is provided by the caller
[evergreen-equinox.git] / Open-ILS / src / perlmods / lib / OpenILS / Application / Circ / CreditCard.pm
index 5704684..6ac63a7 100644 (file)
@@ -204,9 +204,11 @@ sub prepare_bop_content {
     # Especially for the following fields, do we need to support different
     # mapping of fields for different payment processors, particularly ones
     # in other countries?
-    $content{address}    ||= $patron->mailing_address->street1;
-    $content{address} .= ", " . $patron->mailing_address->street2
-        if $patron->mailing_address->street2;
+    if(!$content{address}) {
+        $content{address}  = $patron->mailing_address->street1;
+        $content{address} .= ", " . $patron->mailing_address->street2
+            if $patron->mailing_address->street2;
+    }
 
     $content{city}       ||= $patron->mailing_address->city;
     $content{state}      ||= $patron->mailing_address->state;