| Line 19... |
Line 19... |
| 19 |
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
|
19 |
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
|
| 20 |
print ''
|
20 |
print ''
|
| 21 |
print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
|
21 |
print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
|
| 22 |
print ''
|
22 |
print ''
|
| 23 |
print 'Functions:'
|
23 |
print 'Functions:'
|
| 24 |
print ' void closeSession()'
|
- |
|
| 25 |
print ' i64 createPayment(i64 userId, double amount, i64 gatewayId, i64 txnId)'
|
24 |
print ' i64 createPayment(i64 userId, double amount, i64 gatewayId, i64 txnId)'
|
| 26 |
print ' getPaymentsForUser(i64 userId, i64 fromTime, i64 toTime, PaymentStatus status, i64 gatewayId)'
|
25 |
print ' getPaymentsForUser(i64 userId, i64 fromTime, i64 toTime, PaymentStatus status, i64 gatewayId)'
|
| 27 |
print ' getPayments(i64 fromTime, i64 toTime, PaymentStatus status, i64 gatewayId)'
|
26 |
print ' getPayments(i64 fromTime, i64 toTime, PaymentStatus status, i64 gatewayId)'
|
| 28 |
print ' PaymentGateway getPaymentGateway(i64 id)'
|
27 |
print ' PaymentGateway getPaymentGateway(i64 id)'
|
| 29 |
print ' Payment getPayment(i64 id)'
|
28 |
print ' Payment getPayment(i64 id)'
|
| Line 81... |
Line 80... |
| 81 |
transport = TTransport.TBufferedTransport(socket)
|
80 |
transport = TTransport.TBufferedTransport(socket)
|
| 82 |
protocol = TBinaryProtocol.TBinaryProtocol(transport)
|
81 |
protocol = TBinaryProtocol.TBinaryProtocol(transport)
|
| 83 |
client = PaymentService.Client(protocol)
|
82 |
client = PaymentService.Client(protocol)
|
| 84 |
transport.open()
|
83 |
transport.open()
|
| 85 |
|
84 |
|
| 86 |
if cmd == 'closeSession':
|
- |
|
| 87 |
if len(args) != 0:
|
- |
|
| 88 |
print 'closeSession requires 0 args'
|
- |
|
| 89 |
sys.exit(1)
|
- |
|
| 90 |
pp.pprint(client.closeSession())
|
- |
|
| 91 |
|
- |
|
| 92 |
elif cmd == 'createPayment':
|
85 |
if cmd == 'createPayment':
|
| 93 |
if len(args) != 4:
|
86 |
if len(args) != 4:
|
| 94 |
print 'createPayment requires 4 args'
|
87 |
print 'createPayment requires 4 args'
|
| 95 |
sys.exit(1)
|
88 |
sys.exit(1)
|
| 96 |
pp.pprint(client.createPayment(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
|
89 |
pp.pprint(client.createPayment(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
|
| 97 |
|
90 |
|