X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=fs_selfservice%2FFS-SelfService%2FSelfService%2FXMLRPC.pm;h=14f8a0c44fc53b8870942733bddc4cf1ce20ada5;hb=e513d7cb331d7c7d99d1ea7b5f0a5f8e08e0d725;hp=71d489bdeeb8b1f4304c033e87ff3cc2d805fc2f;hpb=8a84bdd24ab863b34a62bef0dfb6c925322fefcf;p=freeside.git diff --git a/fs_selfservice/FS-SelfService/SelfService/XMLRPC.pm b/fs_selfservice/FS-SelfService/SelfService/XMLRPC.pm index 71d489bde..14f8a0c44 100644 --- a/fs_selfservice/FS-SelfService/SelfService/XMLRPC.pm +++ b/fs_selfservice/FS-SelfService/SelfService/XMLRPC.pm @@ -10,14 +10,15 @@ FS::SelfService::XMLRPC - Freeside XMLRPC accessible self-service API Use this API to implement your own client "self-service" module vi XMLRPC. -Each routine described in L is available vi XMLRPC. All -values are passed to the selfservice-server in a struct of strings. The -return values are in a struct as strings, arrays, or structs as appropriate -for the values described in L. +Each routine described in L is available vi XMLRPC as the +method FS.SelfService.XMLRPC.B. All values are passed to the +selfservice-server in a struct of strings. The return values are in a +struct as strings, arrays, or structs as appropriate for the values +described in L. =head1 BUGS --head1 SEE ALSO +=head1 SEE ALSO L, L,L @@ -25,19 +26,55 @@ L, L,L 'base64', + 'title_left_image' => 'base64', + 'title_right_image' => 'base64', + 'menu_top_image' => 'base64', + 'menu_body_image' => 'base64', + 'menu_bottom_image' => 'base64', +); +our %typefix = ( + 'invoice_pdf' => { 'invoice_pdf' => 'base64', }, + 'legacy_invoice_pdf' => { 'invoice_pdf' => 'base64', }, + 'skin_info' => \%typefix_skin_info, + 'login_info' => \%typefix_skin_info, + 'invoice_logo' => { 'logo' => 'base64', }, + 'login_banner_image' => { 'image' => 'base64', }, +); + sub AUTOLOAD { my $call = $AUTOLOAD; $call =~ s/^FS::SelfService::XMLRPC:://; + if (exists($FS::SelfService::autoload{$call})) { + shift; #discard package name; + $call = "FS::SelfService::$call"; + no strict 'refs'; - &{$call}(@_); + + my $return = &{$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"; }