Subversion Repositories SmartDukaan

Rev

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

Rev 11890 Rev 11980
Line 391... Line 391...
391
        
391
        
392
        Parameters:
392
        Parameters:
393
         - cartId
393
         - cartId
394
        """
394
        """
395
        try:
395
        try:
396
            return validate_cart(cartId, sourceId)
396
            return validate_cart(cartId, sourceId, None)
-
 
397
        finally:
-
 
398
            self.closeSession()
-
 
399
            
-
 
400
    def validateCartWithDealerCoupon(self, cartId, sourceId, couponCode):
-
 
401
        """
-
 
402
        Validates that:
-
 
403
        1. The checkout timestamp is greater than the updatedOn timestamp.
-
 
404
        2. All of the lines in the cart are active items.
-
 
405
        3. The estimate for any of the lines in cart doesn't change.
-
 
406
        4. If a Coupon Code is attached, it gets applied and discounted price is computed
-
 
407
        If first three are true, returns empty string; else returns appropriate message.
-
 
408
        
-
 
409
        Parameters:
-
 
410
         - cartId
-
 
411
        """
-
 
412
        try:
-
 
413
            return validate_cart(cartId, sourceId, couponCode)
397
        finally:
414
        finally:
398
            self.closeSession()
415
            self.closeSession()
399
            
416
            
400
    def mergeCart(self, fromCartId, toCartId):
417
    def mergeCart(self, fromCartId, toCartId):
401
        """
418
        """
Line 838... Line 855...
838
        try:
855
        try:
839
            return is_insurance_detail_present(addressId)
856
            return is_insurance_detail_present(addressId)
840
        finally:
857
        finally:
841
            self.closeSession()
858
            self.closeSession()
842
            
859
            
843
    def validateCartPlus(self, cartId, sourceId):
860
    def validateCartPlus(self, cartId, sourceId, couponCode):
844
        return validate_cart_plus(cartId, sourceId)
861
        return validate_cart_plus(cartId, sourceId, couponCode)
845
    
862
    
846
    def closeSession(self, ):
863
    def closeSession(self, ):
847
        CartDataAccessors.close_session()
864
        CartDataAccessors.close_session()
848
        UserDataAccessors.close_session()
865
        UserDataAccessors.close_session()
849
    
866