summaryrefslogtreecommitdiff
path: root/bin/xmlrpc-order_pkg.pl
diff options
context:
space:
mode:
authorivan <ivan>2010-09-20 21:13:16 +0000
committerivan <ivan>2010-09-20 21:13:16 +0000
commit645f747ad9e9277e6095a5f1d62bf864df56c90f (patch)
treeb11357b2969ae4878f6b69d0983bfb7f1a29fb68 /bin/xmlrpc-order_pkg.pl
parentda122d33411802d26d34033a1ca68cae29125259 (diff)
Maestro.order_pkg API
Diffstat (limited to 'bin/xmlrpc-order_pkg.pl')
-rwxr-xr-xbin/xmlrpc-order_pkg.pl31
1 files changed, 31 insertions, 0 deletions
diff --git a/bin/xmlrpc-order_pkg.pl b/bin/xmlrpc-order_pkg.pl
new file mode 100755
index 0000000..90d1ff3
--- /dev/null
+++ b/bin/xmlrpc-order_pkg.pl
@@ -0,0 +1,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;