summaryrefslogtreecommitdiff
path: root/etc/example-direct-cardin
blob: 1a40972218ef2e5c1d9f8cfb2cc2967ccc19112d (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/local/bin/perl

###
# THIS IS FROM CYBERCASH (is there a newer version?)
###

$paymentserverhost = 'localhost';
$paymentserverport = 8000;
$paymentserversecret = 'two-turntables';
use CCLib qw(sendmserver);

# first lets fake up some data 
# use time of day and pid to give me my pretend
# order number
# you obviously need to get real data from somewhere...

$oid = "test$$"; #fake order number.
$amount = 'usd 42.42';
$ramount = 'usd 24.24';
$pan = '4111111111111111';
$name = 'John Q. Doe';
$addr = '17 Richard Rd.';
$city = 'Ivyland';
$state = 'PA';
$zip = '18974';
$country = 'USA';
$exp = '7/97';


%result = &sendmserver('mauthcapture', 
                       'Order-ID', $oid,
		       'Amount', $amount,
		       'Card-Number', $pan,
		       'Card-Name', $name,
		       'Card-Address', $addr,
		       'Card-City', $city,
		       'Card-State', $state,
		       'Card-Zip', $zip,
		       'Card-Country', $country,
		       'Card-Exp', $exp);

#
# just dump results to stdout.
# you should process them...
# to allow results to affect operation of your fulfillment...
#
foreach (keys(%result)) {
   print " $_ ==> $result{$_}\n";
}

print "\n";

exit;

$trans=$result{'MTransactionNumber'};
$code=$result{'MRetrievalCode'};

%result = &sendmserver('return',
                        'Order-ID', $oid,
			'Return-Amount',$ramount,
			'Amount',$amount,
			);

foreach (keys(%result)) {
   print " $_ ==> $result{$_}\n";
}