diff options
author | Jonathan Prykop <jonathan@freeside.biz> | 2016-08-31 21:49:04 -0500 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2016-08-31 22:27:31 -0500 |
commit | d5461ef7f534030b662ce5c6ee81eafd5f18cbec (patch) | |
tree | b88fd91b93af3d45d8cf978032a737ce1e1d652f /FS | |
parent | 259777e4667fc8a45496ba2805d1f7e01c75ac7b (diff) |
71890: SelfService API: Return monthly recurring fee
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/ClientAPI/MyAccount.pm | 23 | ||||
-rw-r--r-- | FS/FS/ClientAPI_XMLRPC.pm | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index 630346a81..23fbf6cf6 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -645,6 +645,29 @@ sub customer_info_short { }; } +sub customer_recurring { + my $p = shift; + + my($context, $session, $custnum) = _custoragent_session_custnum($p); + return { 'error' => $session } if $context eq 'error'; + + my %return; + + my $conf = new FS::Conf; + + my $search = { 'custnum' => $custnum }; + $search->{'agentnum'} = $session->{'agentnum'} if $context eq 'agent'; + my $cust_main = qsearchs('cust_main', $search ) + or return { 'error' => "customer_info_short: unknown custnum $custnum" }; + + $return{'display_recurring'} = [ $cust_main->display_recurring ]; + + return { 'error' => '', + 'custnum' => $custnum, + %return, + }; +} + sub billing_history { my $p = shift; diff --git a/FS/FS/ClientAPI_XMLRPC.pm b/FS/FS/ClientAPI_XMLRPC.pm index 97019d194..7a1fc3e0f 100644 --- a/FS/FS/ClientAPI_XMLRPC.pm +++ b/FS/FS/ClientAPI_XMLRPC.pm @@ -111,6 +111,7 @@ sub ss2clientapi { 'switch_acct' => 'MyAccount/switch_acct', 'customer_info' => 'MyAccount/customer_info', 'customer_info_short' => 'MyAccount/customer_info_short', + 'customer_recurring' => 'MyAccount/customer_recurring', 'contact_passwd' => 'MyAccount/contact/contact_passwd', 'list_contacts' => 'MyAccount/contact/list_contacts', |