Subversion Repositories SmartDukaan

Rev

Rev 696 | Rev 1120 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 696 Rev 765
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()'
24
  print '  i64 createPayment(i64 userId, double amount, i64 gatewayId, i64 txnId)'
25
  print '  i64 createPayment(i64 userId, double amount, i64 gatewayId, i64 txnId)'
25
  print '   getPaymentsForUser(i64 userId, i64 fromTime, i64 toTime, PaymentStatus status, i64 gatewayId)'
26
  print '   getPaymentsForUser(i64 userId, i64 fromTime, i64 toTime, PaymentStatus status, i64 gatewayId)'
26
  print '   getPayments(i64 fromTime, i64 toTime, PaymentStatus status, i64 gatewayId)'
27
  print '   getPayments(i64 fromTime, i64 toTime, PaymentStatus status, i64 gatewayId)'
27
  print '  PaymentGateway getPaymentGateway(i64 id)'
28
  print '  PaymentGateway getPaymentGateway(i64 id)'
28
  print '  Payment getPayment(i64 id)'
29
  print '  Payment getPayment(i64 id)'
Line 74... Line 75...
74
    transport = TTransport.TBufferedTransport(socket)
75
    transport = TTransport.TBufferedTransport(socket)
75
protocol = TBinaryProtocol.TBinaryProtocol(transport)
76
protocol = TBinaryProtocol.TBinaryProtocol(transport)
76
client = PaymentService.Client(protocol)
77
client = PaymentService.Client(protocol)
77
transport.open()
78
transport.open()
78
 
79
 
-
 
80
if cmd == 'closeSession':
-
 
81
  if len(args) != 0:
-
 
82
    print 'closeSession requires 0 args'
-
 
83
    sys.exit(1)
-
 
84
  pp.pprint(client.closeSession())
-
 
85
 
79
if cmd == 'createPayment':
86
elif cmd == 'createPayment':
80
  if len(args) != 4:
87
  if len(args) != 4:
81
    print 'createPayment requires 4 args'
88
    print 'createPayment requires 4 args'
82
    sys.exit(1)
89
    sys.exit(1)
83
  pp.pprint(client.createPayment(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
90
  pp.pprint(client.createPayment(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
84
 
91