add -t flag to bulk void for payment type, RT#73413
[freeside.git] / bin / xmlrpc-customer_login_pay
1 #!/usr/bin/perl
2
3 use strict;
4 use Frontier::Client;
5 use Data::Dumper;
6
7 my( $username, $password ) = ( @ARGV );
8
9 my $uri = new URI 'http://localhost:8080/';
10
11 my $server = new Frontier::Client ( 'url' => $uri );
12
13 my $result = $server->call('FS.ClientAPI_XMLRPC.login',
14
15         'email'    => 'joe@test.com',
16         'password' => 'testpass',
17 );
18
19 die $result->{'error'} if $result->{'error'};
20
21 my $session_id = $result->{'session_id'};
22 warn "$session_id";
23
24 my $process_payment = $server->call('FS.ClientAPI_XMLRPC.process_payment',
25
26         # Required fields
27         'session_id'  => $session_id,
28         'amount'      => '1.00',
29         'payname'     => 'Joe Tester',
30         'payinfo'     => '4111111111111111',
31         'month'       => '1', # CC Expiration month
32         'year'        => '2019', # CC Expiration year
33
34         #Optional fields (Only needed which these are not set on the customers account or when new information needs to be saved)
35         'save'        => 1, # Save this information to the customers account
36         'auto'        => 1, # Set this customers account to "automatic" payment type
37         'address1'    => '1234 Testerville Rd',
38         'address2'    => '',
39         'city'        => 'Testerville',
40         'state'       => 'MD',
41         'zip'         => '12345',
42         'country'     => 'US',
43         
44
45
46 );      
47
48 die $process_payment->{'error'} if $process_payment->{'error'};
49
50 1;