summaryrefslogtreecommitdiff
path: root/bin/xmlrpc-list_payby
blob: 60ac67e48d8f1e00dbbe2c079e1f8a2b3077f399 (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
#!/usr/bin/perl

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

my( $email, $password ) = @ARGV;
die "Usage: xmlrpc-list_payby email password\n"
  unless $email && length($password);

my $uri = new URI 'http://localhost:8080/';

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

my $login_result = $server->call(
  'FS.ClientAPI_XMLRPC.login',
    'email'    => $email,
    'password' => $password,
);
die $login_result->{'error'}."\n" if $login_result->{'error'};

my $list_result = $server->call(
  'FS.ClientAPI_XMLRPC.list_payby',
    'session_id'   => $login_result->{'session_id'},
);
die $list_result->{'error'}."\n" if $list_result->{'error'};

print Dumper($list_result);

1;