summaryrefslogtreecommitdiff
path: root/FS/FS/API.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-03-05 18:44:27 -0800
committerIvan Kohler <ivan@freeside.biz>2014-03-05 18:44:27 -0800
commit13a36699427495735d945f93c4832feab44ae02f (patch)
tree353799e6e59d5116b584410c9ca23844b2365537 /FS/FS/API.pm
parent5858921f5ec8555fcaacf379f35899cc2d2dd0f3 (diff)
backoffice API: add status to customer info, add location_info, RT#22830
Diffstat (limited to 'FS/FS/API.pm')
-rw-r--r--FS/FS/API.pm45
1 files changed, 24 insertions, 21 deletions
diff --git a/FS/FS/API.pm b/FS/FS/API.pm
index beadbb8..19a9463 100644
--- a/FS/FS/API.pm
+++ b/FS/FS/API.pm
@@ -212,28 +212,8 @@ sub insert_refund_phonenum {
#---
-#Customer data
-# pull customer info
-# The fields needed are:
-#
-# cust_main.custnum
-# cust_main.first
-# cust_main.last
-# cust_main.company
-# cust_main.address1
-# cust_main.address2
-# cust_main.city
-# cust_main.state
-# cust_main.zip
-# cust_main.daytime
-# cust_main.night
-# cust_main_invoice.dest
-#
-# at minimum
-
-#Customer balances
+#generally, the more useful data from the cust_main record the better.
-#Advertising sources?
# "2 way syncing" ? start with non-sync pulling info here, then if necessary
# figure out how to trigger something when those things change
@@ -271,6 +251,8 @@ sub customer_info {
'display_custnum' => $cust_main->display_custnum,
'name' => $cust_main->first. ' '. $cust_main->get('last'),
'balance' => $cust_main->balance,
+ 'status' => $cust_main->status,
+ 'statuscolor' => $cust_main->statuscolor,
);
$return{$_} = $cust_main->get($_)
@@ -293,6 +275,27 @@ sub customer_info {
}
+#I also monitor for changes to the additional locations that are applied to
+# packages, and would like for those to be exportable as well. basically the
+# location data passed with the custnum.
+sub location_info {
+ my( $class, %opt ) = @_;
+ my $conf = new FS::Conf;
+ return { 'error' => 'Incorrect shared secret' }
+ unless $opt{secret} eq $conf->config('api_shared_secret');
+
+ my @cust_location = qsearch('cust_location', { 'custnum' => $opt{custnum} });
+
+ my %return = (
+ 'error' => '',
+ 'locations' => [ @cust_location ],
+ );
+
+ return \%return;
+}
+
+#Advertising sources?
+
=back
1;