Merge branch 'calc-discount-rounding' of https://github.com/rvandam/Freeside
[freeside.git] / FS / FS / API.pm
index 994f8ba..cc5f609 100644 (file)
@@ -593,6 +593,8 @@ sub update_customer {
  my( $class, %opt ) = @_;
 
   my $conf = new FS::Conf;
+  return { 'error' => 'Incorrect shared secret' }
+    unless $opt{secret} eq $conf->config('api_shared_secret');
 
 
   my $custnum = $opt{'custnum'}
@@ -749,8 +751,21 @@ sub location_info {
 Bills a single customer now, in the same fashion as the "Bill now" link in the
 UI.
 
-Returns a hash reference with a single key, 'error'.  If there is an error,
-the value contains the error, otherwise it is empty.
+Returns a hash reference with a single key, 'error'.  If there is an error,   
+the value contains the error, otherwise it is empty. Takes a list of keys and
+values as parameters with the following keys:
+
+=over 4
+
+=item secret
+
+API Secret (required)
+
+=item custnum
+
+Customer number (required)
+
+=back
 
 =cut