Subversion Repositories SmartDukaan

Rev

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

Rev 12995 Rev 13002
Line 4682... Line 4682...
4682
                    promotionServiceClient.get_client().trackCouponUsage(couponCode, recharge_order.id, recharge_order.userId)
4682
                    promotionServiceClient.get_client().trackCouponUsage(couponCode, recharge_order.id, recharge_order.userId)
4683
                except Exception as e:
4683
                except Exception as e:
4684
                    print 'Unable to track the usage of coupon - ' + recharge_order.couponCode + ' and spiceTID - ' + str(spiceTID)
4684
                    print 'Unable to track the usage of coupon - ' + recharge_order.couponCode + ' and spiceTID - ' + str(spiceTID)
4685
                    print e
4685
                    print e
4686
        return True
4686
        return True
4687
    elif retCode in ('STO', 'US', 'UP','STP') and retStatus == 'S':
4687
    elif retCode in ('STO', 'US', 'UP', 'STP') and retStatus == 'S':
4688
        if recharge_order.couponAmount > 0 :
4688
        if recharge_order.couponAmount > 0 :
4689
            couponCode = recharge_order.couponCode
4689
            couponCode = recharge_order.couponCode
4690
            if couponCode :
4690
            if couponCode :
4691
                try:
4691
                try:
4692
                    promotionServiceClient = PromotionClient()
4692
                    promotionServiceClient = PromotionClient()
Line 5093... Line 5093...
5093
            smsText = "Dear Customer, Your Payment was successful but due to some internal error with the operator's system we are not sure if the recharge was successful. In case your recharge is not processed, we will credit amount to your recharge wallet."
5093
            smsText = "Dear Customer, Your Payment was successful but due to some internal error with the operator's system we are not sure if the recharge was successful. In case your recharge is not processed, we will credit amount to your recharge wallet."
5094
            #Dear Customer, Your Payment was successful but due to some internal error with the operator's system we are not sure if the recharge was successful. In case your recharge is not processed, we will credit amount to your recharge wallet.
5094
            #Dear Customer, Your Payment was successful but due to some internal error with the operator's system we are not sure if the recharge was successful. In case your recharge is not processed, we will credit amount to your recharge wallet.
5095
        elif status == "Recharge Failed, Amount Refunded" :
5095
        elif status == "Recharge Failed, Amount Refunded" :
5096
            smsText = "Dear Customer, It seems operator could not process your recharge request. We are crediting the refund amount to your recharge wallet. You can use wallet amount to recharge again."
5096
            smsText = "Dear Customer, It seems operator could not process your recharge request. We are crediting the refund amount to your recharge wallet. You can use wallet amount to recharge again."
5097
        
5097
        
5098
        if smsText is not None and len(smsText)>0:
5098
        if smsText is not None and len(smsText)>0 and recharge_order.status!=RechargeOrderStatus.RECHARGE_UNKNOWN:
5099
            try:
5099
            try:
5100
                send_transaction_sms(recharge_order.userId, deviceNumber, smsText, SmsType.TRANSACTIONAL)
5100
                send_transaction_sms(recharge_order.userId, deviceNumber, smsText, SmsType.TRANSACTIONAL)
5101
            except Exception as e:
5101
            except Exception as e:
5102
                print e
5102
                print e
5103
                pass
5103
                pass
5104
        
5104
        
-
 
5105
    if recharge_order.status == RechargeOrderStatus.RECHARGE_UNKNOWN:
5105
    
5106
        return True
5106
    try:
5107
    try:
5107
        helper_client = HelperClient().get_client()
5108
        helper_client = HelperClient().get_client()
5108
        helper_client.saveUserEmailForSending([email], "", source_name + " - Recharge Order Details", email_header + email_footer, str(recharge_order.id), "RechargeInfo", [], [], 1)
5109
        helper_client.saveUserEmailForSending([email], "", source_name + " - Recharge Order Details", email_header + email_footer, str(recharge_order.id), "RechargeInfo", [], [], 1)
5109
        return True
5110
        return True
5110
    except Exception as e:
5111
    except Exception as e:
Line 5716... Line 5717...
5716
    if rechargeMode == RechargeMode._NAMES_TO_VALUES.get('SYNC'):
5717
    if rechargeMode == RechargeMode._NAMES_TO_VALUES.get('SYNC'):
5717
        if retCode == '00' and retStatus == 'S':
5718
        if retCode == '00' and retStatus == 'S':
5718
            rechargeTransaction.status = RechargeOrderStatus.RECHARGE_SUCCESSFUL
5719
            rechargeTransaction.status = RechargeOrderStatus.RECHARGE_SUCCESSFUL
5719
            rechargeTransaction.invoiceNumber = get_next_invoice_number(OrderType.RCH4HOTSPOT)
5720
            rechargeTransaction.invoiceNumber = get_next_invoice_number(OrderType.RCH4HOTSPOT)
5720
    
5721
    
5721
        elif retCode in ('STO', 'US', 'UP','STP') and retStatus == 'S':
5722
        elif retCode in ('STO', 'US', 'UP', 'STP') and retStatus == 'S':
5722
            rechargeTransaction.status = RechargeOrderStatus.RECHARGE_UNKNOWN
5723
            rechargeTransaction.status = RechargeOrderStatus.RECHARGE_UNKNOWN
5723
        else:
5724
        else:
5724
            rechargeTransaction.status = RechargeOrderStatus.RECHARGE_FAILED
5725
            rechargeTransaction.status = RechargeOrderStatus.RECHARGE_FAILED
5725
            if retCode in ('SVAI', 'SVIA', 'AI', 'IA', 'EAI', 'SVEAI'):
5726
            if retCode in ('SVAI', 'SVIA', 'AI', 'IA', 'EAI', 'SVEAI'):
5726
                rechargeTransaction.description = "Invalid Amount"
5727
                rechargeTransaction.description = "Invalid Amount"