summaryrefslogtreecommitdiff
path: root/bin/xmlrpc-order_pkg.pl
blob: 90d1ff3be56f7348bd5f964f6ee1b8ff00887d38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl
#
# xmlrpc-order_pkg.pl username password

use strict;
use Frontier::Client;
use Data::Dumper;

my( $u, $p, $custnum ) = ( @ARGV );
my $userinfo = $u.':'.$p;

my $uri = new URI 'http://localhost/freeside/misc/xmlrpc.cgi';
$uri->userinfo( $userinfo );

my $server = new Frontier::Client ( 'url' => $uri );

my $result = $server->call('Maestro.order_pkg',
  {
    'custnum' => 8,
    'pkgpart' => 3,
    'id'      => $$, #unique
    'title'   => 'John Q. Public', #'name' also works
                                   #(turn off global_unique-pbx_title)
  },
);

#die $result->{'error'} if $result->{'error'};

print Dumper($result);

1;