File: tctest.py

package info (click to toggle)
python-tclink 3.4.0-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 276 kB
  • ctags: 105
  • sloc: ansic: 716; makefile: 59; python: 45
file content (31 lines) | stat: -rwxr-xr-x 583 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/python
#
# Test script for TCLink Python client.
#

import tclink

print 'Using TCLink version', tclink.getVersion()

params = {
	'custid':    'TestMerchant',
	'password':  'password',
	'action':    'preauth',
	'cc':        '4111111111111111',
	'exp':       '0404',
	'amount':    '100',
	'avs':       'n'
}

result = tclink.send(params)

if result['status'] == 'approved':
	print 'The transaction was approved!'
elif result['status'] == 'decline':
	print 'The transaction was declined.'
else:
	print 'There was an error.'

print 'Here are the full details:'
print result