3 #----------------------------------------------------------------
5 #----------------------------------------------------------------
7 require '../oils_header.pl';
8 use strict; use warnings;
13 return <<END_OF_USAGE;
14 $0 [-h] --login=UserName --password==MyPass [OPTIONS] [Transaction data]
17 -l --login Assigned by your processor API (specified in -t)
18 -p --password Assigned by your processor API (specified in -t)
21 -t --target Payment processor (default PayPal)
22 -s --signature A "long password" required by PayPal in leiu of certificates
23 -r --server Use a specific server with a processor (AuthorizeNet)
24 -c --config_file opensrf_core.xml file (default /openils/conf/opensrf_core.xml)
27 -a --amount Monetary value, no dollar sign, default a random value under 25.00
28 -i --id Patron ID#, default 5 (for no reason)
29 -n --number Credit card number to be charged
30 -x --expires Date (MM-YYYY) of card expiration, default 12-2014
34 $0 --login=seller_1254418209_biz_api1.esilibrary.com \\
35 --password=1254618222 \\
36 --signature=AiPC9xjkCyDFQXbSkoZcgqH3hpacAVPVw5GcZgNKVA9SGKcbrqLuhLks \\
44 my $config = '/openils/conf/opensrf_core.xml';
45 my $processor = 'PayPal';
46 my $number = '4123000011112228';
47 my $expires = '12-2014';
51 my ($login, $password, $signature, $help, $amount, $server);
54 'config_file=s' => \$config,
55 'target=s' => \$processor,
57 'password=s' => \$password,
58 's|signature=s' => \$signature,
59 'amount=f' => \$amount,
61 'number=s' => \$number,
62 'x|expires=s' => \$expires,
63 'r|server=s' => \$server,
67 $help and print usage and exit;
69 unless ($login and $processor and $password) {
73 osrf_connect($config);
75 $amount or $amount = int(rand(25)) . '.' . sprintf("%02d", int(rand(99)));
78 Attempting transaction:
80 processor => $processor,
82 password => $password,
83 signature => $signature,
86 expiration => $expires,
91 description => test transaction processid $$
96 my( $user, $evt ) = simplereq('open-ils.credit', 'open-ils.credit.process',
98 processor => $processor,
100 password => $password,
101 signature => $signature,
104 expiration => $expires,
109 description => "test transaction processid $$"
112 oils_event_die($evt); # this user was not found / not all methods return events..