explicitly reformat B:OP amounts from self-service API transactions as 5.44, RT#22763
[freeside.git] / FS / FS / ClientAPI / MyAccount.pm
index be87e59..8098803 100644 (file)
@@ -704,6 +704,14 @@ sub edit_info {
   $new->set( $_ => $p->{$_} )
     foreach grep { exists $p->{$_} } @cust_main_editable_fields;
 
+  if ( $new->ship_address1 eq '' ) {
+    # then the ship address is being set to null
+    $new->set($_ => '') 
+      foreach qw(ship_longitude ship_latitude ship_coord_auto ship_mobile);
+  }
+
+
+
   my $payby = '';
   if (exists($p->{'payby'})) {
     $p->{'payby'} =~ /^([A-Z]{4})$/
@@ -991,7 +999,7 @@ sub validate_payment {
 
   { 
     'cust_main'      => $cust_main, #XXX or just custnum??
-    'amount'         => $amount,
+    'amount'         => sprintf('%.2f', $amount),
     'payby'          => $payby,
     'payinfo'        => $payinfo,
     'paymask'        => $cust_main->mask_payinfo( $payby, $payinfo ),