| Line 22... |
Line 22... |
| 22 |
print ''
|
22 |
print ''
|
| 23 |
print 'Functions:'
|
23 |
print 'Functions:'
|
| 24 |
print ' void createPromotion(string name, string ruleExecutionSrc, i64 startOn, i64 endOn)'
|
24 |
print ' void createPromotion(string name, string ruleExecutionSrc, i64 startOn, i64 endOn)'
|
| 25 |
print ' Coupon getCoupon(string couponCode)'
|
25 |
print ' Coupon getCoupon(string couponCode)'
|
| 26 |
print ' bool isGiftVoucher(string couponCode)'
|
26 |
print ' bool isGiftVoucher(string couponCode)'
|
| - |
|
27 |
print ' bool isCodApplicable(string couponCode)'
|
| 27 |
print ' getAllPromotions()'
|
28 |
print ' getAllPromotions()'
|
| 28 |
print ' Promotion getPromotionById(i64 promotionId)'
|
29 |
print ' Promotion getPromotionById(i64 promotionId)'
|
| 29 |
print ' void generateCouponsForPromotion(i64 promotionId, string couponCode)'
|
30 |
print ' void generateCouponsForPromotion(i64 promotionId, string couponCode)'
|
| 30 |
print ' Cart applyCoupon(string couponCode, i64 cartId)'
|
31 |
print ' Cart applyCoupon(string couponCode, i64 cartId)'
|
| 31 |
print ' void trackCouponUsage(string couponCode, i64 transactionId, i64 userId)'
|
32 |
print ' void trackCouponUsage(string couponCode, i64 transactionId, i64 userId)'
|
| 32 |
print ' i64 getCouponUsageCountByUser(string couponCode, i64 userId)'
|
33 |
print ' i64 getCouponUsageCountByUser(string couponCode, i64 userId)'
|
| 33 |
print ' getActiveCoupons()'
|
34 |
print ' getActiveCoupons()'
|
| 34 |
print ' string createCoupon(i64 promotionId, i64 endOn, string email, i64 amount, i64 usage)'
|
35 |
print ' string createCoupon(i64 promotionId, i64 endOn, string email, i64 amount, bool isCod, i64 usage)'
|
| 35 |
print ' i64 getSuccessfulPaymentCountForCoupon(string couponCode)'
|
36 |
print ' i64 getSuccessfulPaymentCountForCoupon(string couponCode)'
|
| 36 |
print ' string getRuleDocString(string ruleName)'
|
37 |
print ' string getRuleDocString(string ruleName)'
|
| 37 |
print ' getItemDiscountMap( itemIds)'
|
38 |
print ' getItemDiscountMap( itemIds)'
|
| 38 |
print ' getDiscountsForEntity(i64 entityId)'
|
39 |
print ' getDiscountsForEntity(i64 entityId)'
|
| 39 |
print ' void addVoucher(Voucher voucher)'
|
40 |
print ' void addVoucher(Voucher voucher)'
|
| Line 105... |
Line 106... |
| 105 |
if len(args) != 1:
|
106 |
if len(args) != 1:
|
| 106 |
print 'isGiftVoucher requires 1 args'
|
107 |
print 'isGiftVoucher requires 1 args'
|
| 107 |
sys.exit(1)
|
108 |
sys.exit(1)
|
| 108 |
pp.pprint(client.isGiftVoucher(args[0],))
|
109 |
pp.pprint(client.isGiftVoucher(args[0],))
|
| 109 |
|
110 |
|
| - |
|
111 |
elif cmd == 'isCodApplicable':
|
| - |
|
112 |
if len(args) != 1:
|
| - |
|
113 |
print 'isCodApplicable requires 1 args'
|
| - |
|
114 |
sys.exit(1)
|
| - |
|
115 |
pp.pprint(client.isCodApplicable(args[0],))
|
| - |
|
116 |
|
| 110 |
elif cmd == 'getAllPromotions':
|
117 |
elif cmd == 'getAllPromotions':
|
| 111 |
if len(args) != 0:
|
118 |
if len(args) != 0:
|
| 112 |
print 'getAllPromotions requires 0 args'
|
119 |
print 'getAllPromotions requires 0 args'
|
| 113 |
sys.exit(1)
|
120 |
sys.exit(1)
|
| 114 |
pp.pprint(client.getAllPromotions())
|
121 |
pp.pprint(client.getAllPromotions())
|
| Line 148... |
Line 155... |
| 148 |
print 'getActiveCoupons requires 0 args'
|
155 |
print 'getActiveCoupons requires 0 args'
|
| 149 |
sys.exit(1)
|
156 |
sys.exit(1)
|
| 150 |
pp.pprint(client.getActiveCoupons())
|
157 |
pp.pprint(client.getActiveCoupons())
|
| 151 |
|
158 |
|
| 152 |
elif cmd == 'createCoupon':
|
159 |
elif cmd == 'createCoupon':
|
| 153 |
if len(args) != 5:
|
160 |
if len(args) != 6:
|
| 154 |
print 'createCoupon requires 5 args'
|
161 |
print 'createCoupon requires 6 args'
|
| 155 |
sys.exit(1)
|
162 |
sys.exit(1)
|
| 156 |
pp.pprint(client.createCoupon(eval(args[0]),eval(args[1]),args[2],eval(args[3]),eval(args[4]),))
|
163 |
pp.pprint(client.createCoupon(eval(args[0]),eval(args[1]),args[2],eval(args[3]),eval(args[4]),eval(args[5]),))
|
| 157 |
|
164 |
|
| 158 |
elif cmd == 'getSuccessfulPaymentCountForCoupon':
|
165 |
elif cmd == 'getSuccessfulPaymentCountForCoupon':
|
| 159 |
if len(args) != 1:
|
166 |
if len(args) != 1:
|
| 160 |
print 'getSuccessfulPaymentCountForCoupon requires 1 args'
|
167 |
print 'getSuccessfulPaymentCountForCoupon requires 1 args'
|
| 161 |
sys.exit(1)
|
168 |
sys.exit(1)
|