use strict;
use vars qw($DEBUG $AUTOLOAD);
+use XMLRPC::Lite; # for XMLRPC::Data
use FS::ClientAPI;
$DEBUG = 0;
$FS::ClientAPI::DEBUG = $DEBUG;
+#false laziness w/FS::SelfService/XMLRPC.pm, same problem as below but worse
+our %typefix = (
+ 'invoice_pdf' => { 'invoice_pdf' => 'base64', },
+ 'legacy_invoice_pdf' => { 'invoice_pdf' => 'base64', },
+ 'skin_info' => { 'logo' => 'base64',
+ 'title_left_image' => 'base64',
+ 'title_right_image' => 'base64',
+ 'menu_top_image' => 'base64',
+ 'menu_body_image' => 'base64',
+ 'menu_bottom_image' => 'base64',
+ },
+ 'invoice_logo' => { 'logo' => 'base64', },
+);
+
sub AUTOLOAD {
my $call = $AUTOLOAD;
$call =~ s/^FS::(SelfService::|ClientAPI_)XMLRPC:://;
my $autoload = &ss2clientapi;
if (exists($autoload->{$call})) {
+
shift; #discard package name;
+
#$call = "FS::SelfService::$call";
#no strict 'refs';
#&{$call}(@_);
#FS::ClientAPI->dispatch($autoload->{$call}, @_);
- FS::ClientAPI->dispatch($autoload->{$call}, { @_ } );
+
+ my $return = FS::ClientAPI->dispatch($autoload->{$call}, { @_ } );
+
+ if ( exists($typefix{$call}) ) {
+ my $typefix = $typefix{$call};
+ foreach my $field ( grep exists($return->{$_}), keys %$typefix ) {
+ my $type = $typefix->{$field};
+ $return->{$field} = XMLRPC::Data->value($return->{$field})
+ ->type($type);
+ }
+ }
+
+ $return;
+
}else{
die "No such procedure: $call";
}
'edit_info' => 'MyAccount/edit_info', #add to ss cgi!
'invoice' => 'MyAccount/invoice',
'invoice_pdf' => 'MyAccount/invoice_pdf',
+ 'legacy_invoice' => 'MyAccount/legacy_invoice',
+ 'legacy_invoice_pdf' => 'MyAccount/legacy_invoice_pdf',
'invoice_logo' => 'MyAccount/invoice_logo',
'list_invoices' => 'MyAccount/list_invoices', #?
'cancel' => 'MyAccount/cancel', #add to ss cgi!
'list_pkgs' => 'MyAccount/list_pkgs', #add to ss (added?)
'list_svcs' => 'MyAccount/list_svcs', #add to ss (added?)
'list_svc_usage' => 'MyAccount/list_svc_usage',
+ 'svc_status_html' => 'MyAccount/svc_status_html',
+ 'svc_status_hash' => 'MyAccount/svc_status_hash',
+ 'set_svc_status_hash' => 'MyAccount/set_svc_status_hash',
+ 'acct_forward_info' => 'MyAccount/acct_forward_info',
+ 'process_acct_forward' => 'MyAccount/process_acct_forward',
'list_dsl_devices' => 'MyAccount/list_dsl_devices',
'add_dsl_device' => 'MyAccount/add_dsl_device',
'delete_dsl_device' => 'MyAccount/delete_dsl_device',
'unprovision_svc' => 'MyAccount/unprovision_svc',
'myaccount_passwd' => 'MyAccount/myaccount_passwd',
'reset_passwd' => 'MyAccount/reset_passwd',
+ 'check_reset_passwd' => 'MyAccount/check_reset_passwd',
+ 'process_reset_passwd' => 'MyAccount/process_reset_passwd',
'create_ticket' => 'MyAccount/create_ticket',
'get_ticket' => 'MyAccount/get_ticket',
'adjust_ticket_priority' => 'MyAccount/adjust_ticket_priority',