diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-06-13 15:18:37 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-06-13 15:18:37 -0700 |
commit | 7beec7068e00be5ae1b2599fdf2b494bc19e31d0 (patch) | |
tree | 055e1d25694ccfdac3a2d5aca79441cf7a3d89b5 /bin | |
parent | 9e8d2a5bafb21c42f54cdd9b3703e2f88a36e0a8 (diff) | |
parent | eb6536b41456955fc425dba2e156a996e8fe2837 (diff) |
Merge branch 'FREESIDE_3_BRANCH' of git.freeside.biz:/home/git/freeside into FREESIDE_3_BRANCH
Diffstat (limited to 'bin')
-rw-r--r-- | bin/xmlrpc-customer_login_pay | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/bin/xmlrpc-customer_login_pay b/bin/xmlrpc-customer_login_pay new file mode 100644 index 000000000..a867a6965 --- /dev/null +++ b/bin/xmlrpc-customer_login_pay @@ -0,0 +1,50 @@ +#!/usr/bin/perl + +use strict; +use Frontier::Client; +use Data::Dumper; + +my( $username, $password ) = ( @ARGV ); + +my $uri = new URI 'http://localhost:8080/'; + +my $server = new Frontier::Client ( 'url' => $uri ); + +my $result = $server->call('FS.ClientAPI_XMLRPC.login', + + 'email' => 'joe@test.com', + 'password' => 'testpass', +); + +die $result->{'error'} if $result->{'error'}; + +my $session_id = $result->{'session_id'}; +warn "$session_id"; + +my $process_payment = $server->call('FS.ClientAPI_XMLRPC.process_payment', + + # Required fields + 'session_id' => $session_id, + 'amount' => '1.00', + 'payname' => 'Joe Tester', + 'payinfo' => '4111111111111111', + 'month' => '1', # CC Expiration month + 'year' => '2019', # CC Expiration year + + #Optional fields (Only needed which these are not set on the customers account or when new information needs to be saved) + 'save' => 1, # Save this information to the customers account + 'auto' => 1, # Set this customers account to "automatic" payment type + 'address1' => '1234 Testerville Rd', + 'address2' => '', + 'city' => 'Testerville', + 'state' => 'MD', + 'zip' => '12345', + 'country' => 'US', + + + +); + +die $process_payment->{'error'} if $process_payment->{'error'}; + +1; |