1 package FS::ClientAPI_XMLRPC;
5 FS::ClientAPI_XMLRPC - Freeside XMLRPC accessible self-service API, on the backend
9 This module implements the self-service API offered by xmlrpc.cgi and friends,
10 but on a backend machine.
14 Use this API to implement your own client "self-service" module vi XMLRPC.
16 Each routine described in L<FS::SelfService> is available vi XMLRPC as the
17 method FS.SelfService.XMLRPC.B<method>. All values are passed to the
18 selfservice-server in a struct of strings. The return values are in a
19 struct as strings, arrays, or structs as appropriate for the values
20 described in L<FS::SelfService>.
26 L<FS::SelfService::XMLRPC>, L<FS::SelfService>
32 use vars qw($DEBUG $AUTOLOAD);
36 $FS::ClientAPI::DEBUG = $DEBUG;
40 $call =~ s/^FS::(SelfService::|ClientAPI_)XMLRPC:://;
42 warn "FS::ClientAPI_XMLRPC::AUTOLOAD $call\n" if $DEBUG;
44 my $autoload = &ss2clientapi;
46 if (exists($autoload->{$call})) {
47 shift; #discard package name;
48 #$call = "FS::SelfService::$call";
51 #FS::ClientAPI->dispatch($autoload->{$call}, @_);
52 FS::ClientAPI->dispatch($autoload->{$call}, { @_ } );
54 die "No such procedure: $call";
58 #terrible false laziness w/SelfService.pm
59 # - fix at build time, by including some file in both selfserv and backend libs?
60 # - or fix at runtime, by having selfservice client ask server for the list?
63 'passwd' => 'passwd/passwd',
64 'chfn' => 'passwd/passwd',
65 'chsh' => 'passwd/passwd',
66 'login_info' => 'MyAccount/login_info',
67 'login' => 'MyAccount/login',
68 'logout' => 'MyAccount/logout',
69 'switch_acct' => 'MyAccount/switch_acct',
70 'customer_info' => 'MyAccount/customer_info',
71 'customer_info_short' => 'MyAccount/customer_info_short',
72 'edit_info' => 'MyAccount/edit_info', #add to ss cgi!
73 'invoice' => 'MyAccount/invoice',
74 'invoice_pdf' => 'MyAccount/invoice_pdf',
75 'legacy_invoice' => 'MyAccount/legacy_invoice',
76 'legacy_invoice_pdf' => 'MyAccount/legacy_invoice_pdf',
77 'invoice_logo' => 'MyAccount/invoice_logo',
78 'list_invoices' => 'MyAccount/list_invoices', #?
79 'cancel' => 'MyAccount/cancel', #add to ss cgi!
80 'payment_info' => 'MyAccount/payment_info',
81 'payment_info_renew_info' => 'MyAccount/payment_info_renew_info',
82 'process_payment' => 'MyAccount/process_payment',
83 'store_payment' => 'MyAccount/store_payment',
84 'process_stored_payment' => 'MyAccount/process_stored_payment',
85 'process_payment_order_pkg' => 'MyAccount/process_payment_order_pkg',
86 'process_payment_change_pkg' => 'MyAccount/process_payment_change_pkg',
87 'process_payment_order_renew' => 'MyAccount/process_payment_order_renew',
88 'process_prepay' => 'MyAccount/process_prepay',
89 'realtime_collect' => 'MyAccount/realtime_collect',
90 'list_pkgs' => 'MyAccount/list_pkgs', #add to ss (added?)
91 'list_svcs' => 'MyAccount/list_svcs', #add to ss (added?)
92 'list_svc_usage' => 'MyAccount/list_svc_usage',
93 'list_dsl_devices' => 'MyAccount/list_dsl_devices',
94 'add_dsl_device' => 'MyAccount/add_dsl_device',
95 'delete_dsl_device' => 'MyAccount/delete_dsl_device',
96 'port_graph' => 'MyAccount/port_graph',
97 'list_cdr_usage' => 'MyAccount/list_cdr_usage',
98 'list_support_usage' => 'MyAccount/list_support_usage',
99 'order_pkg' => 'MyAccount/order_pkg', #add to ss cgi!
100 'change_pkg' => 'MyAccount/change_pkg',
101 'order_recharge' => 'MyAccount/order_recharge',
102 'renew_info' => 'MyAccount/renew_info',
103 'order_renew' => 'MyAccount/order_renew',
104 'cancel_pkg' => 'MyAccount/cancel_pkg', #add to ss cgi!
105 'suspend_pkg' => 'MyAccount/suspend_pkg', #add to ss cgi!
106 'charge' => 'MyAccount/charge', #?
107 'part_svc_info' => 'MyAccount/part_svc_info',
108 'provision_acct' => 'MyAccount/provision_acct',
109 'provision_phone' => 'MyAccount/provision_phone',
110 'provision_external' => 'MyAccount/provision_external',
111 'unprovision_svc' => 'MyAccount/unprovision_svc',
112 'myaccount_passwd' => 'MyAccount/myaccount_passwd',
113 'reset_passwd' => 'MyAccount/reset_passwd',
114 'create_ticket' => 'MyAccount/create_ticket',
115 'get_ticket' => 'MyAccount/get_ticket',
116 'adjust_ticket_priority' => 'MyAccount/adjust_ticket_priority',
117 'did_report' => 'MyAccount/did_report',
118 'signup_info' => 'Signup/signup_info',
119 'skin_info' => 'MyAccount/skin_info',
120 'access_info' => 'MyAccount/access_info',
121 'domain_select_hash' => 'Signup/domain_select_hash', # expose?
122 'new_customer' => 'Signup/new_customer',
123 'capture_payment' => 'Signup/capture_payment',
124 'clear_signup_cache' => 'Signup/clear_cache',
125 'new_agent' => 'Agent/new_agent',
126 'agent_login' => 'Agent/agent_login',
127 'agent_logout' => 'Agent/agent_logout',
128 'agent_info' => 'Agent/agent_info',
129 'agent_list_customers' => 'Agent/agent_list_customers',
130 'check_username' => 'Agent/check_username',
131 'suspend_username' => 'Agent/suspend_username',
132 'unsuspend_username' => 'Agent/unsuspend_username',
133 'mason_comp' => 'MasonComponent/mason_comp',
134 'call_time' => 'PrepaidPhone/call_time',
135 'call_time_nanpa' => 'PrepaidPhone/call_time_nanpa',
136 'phonenum_balance' => 'PrepaidPhone/phonenum_balance',
138 #'bulk_processrow' => 'Bulk/processrow',
139 #conflicts w/Agentone# 'check_username' => 'Bulk/check_username',
141 'ping' => 'SGNG/ping',
142 'decompify_pkgs' => 'SGNG/decompify_pkgs',
143 'previous_payment_info' => 'SGNG/previous_payment_info',
144 'previous_payment_info_renew_info'
145 => 'SGNG/previous_payment_info_renew_info',
146 'previous_process_payment' => 'SGNG/previous_process_payment',
147 'previous_process_payment_order_pkg'
148 => 'SGNG/previous_process_payment_order_pkg',
149 'previous_process_payment_change_pkg'
150 => 'SGNG/previous_process_payment_change_pkg',
151 'previous_process_payment_order_renew'
152 => 'SGNG/previous_process_payment_order_renew',
157 #XXX submit patch to SOAP::Lite
159 use XMLRPC::Transport::HTTP;
161 package XMLRPC::Transport::HTTP::Server;
163 @XMLRPC::Transport::HTTP::Server::ISA = qw(SOAP::Transport::HTTP::Server);
165 sub initialize; *initialize = \&XMLRPC::Server::initialize;
166 sub make_fault; *make_fault = \&XMLRPC::Transport::HTTP::CGI::make_fault;
167 sub make_response; *make_response = \&XMLRPC::Transport::HTTP::CGI::make_response;