Subversion Repositories SmartDukaan

Rev

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

Rev 8064 Rev 8076
Line 4236... Line 4236...
4236
    recharge_order.description = description
4236
    recharge_order.description = description
4237
    session.commit()
4237
    session.commit()
4238
    if retCode == '00' and retStatus == 'S':
4238
    if retCode == '00' and retStatus == 'S':
4239
        recharge_order.status = RechargeOrderStatus.RECHARGE_SUCCESSFUL
4239
        recharge_order.status = RechargeOrderStatus.RECHARGE_SUCCESSFUL
4240
        session.commit()
4240
        session.commit()
-
 
4241
        if recharge_order.couponAmount > 0 :
-
 
4242
            couponCode = recharge_order.couponCode
-
 
4243
            if couponCode :
-
 
4244
                try:
-
 
4245
                    promotionServiceClient = PromotionClient()
-
 
4246
                    promotionServiceClient.get_client().trackCouponUsage(couponCode, recharge_order.id, recharge_order.userId)
-
 
4247
                except Exception as e:
-
 
4248
                    print 'Unable to track the usage of coupon - ' + recharge_order.couponCode + ' and spiceTID - ' + str(spiceTID)
-
 
4249
                    print e
4241
        return True
4250
        return True
4242
    elif retCode in ('STO', 'US', 'UP') and retStatus == 'S':
4251
    elif retCode in ('STO', 'US', 'UP') and retStatus == 'S':
4243
        raise TransactionServiceException(111, "No response from operator within specified time")
4252
        raise TransactionServiceException(111, "No response from operator within specified time")
4244
    else:
4253
    else:
4245
        recharge_order.status = RechargeOrderStatus.RECHARGE_FAILED
4254
        recharge_order.status = RechargeOrderStatus.RECHARGE_FAILED