Subversion Repositories SmartDukaan

Rev

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

Rev 16553 Rev 16556
Line 1388... Line 1388...
1388
    except:
1388
    except:
1389
        return {'url':"","message":"Substring not found"}
1389
        return {'url':"","message":"Substring not found"}
1390
    redirect_url = d_app_offer.link[0:index]+"."+embedd+d_app_offer.link[index:]
1390
    redirect_url = d_app_offer.link[0:index]+"."+embedd+d_app_offer.link[index:]
1391
    get_mongo_connection().AppOrder.AppTransaction.update({'_id':ObjectId(embedd)},{"$set":{'redirect_url':redirect_url}})
1391
    get_mongo_connection().AppOrder.AppTransaction.update({'_id':ObjectId(embedd)},{"$set":{'redirect_url':redirect_url}})
1392
    return {'url':redirect_url,"message":"Success"}
1392
    return {'url':redirect_url,"message":"Success"}
-
 
1393
 
-
 
1394
def addPayout(payout, transaction_id):
-
 
1395
    try:
-
 
1396
        transaction = list(get_mongo_connection().AppOrder.AppTransaction.find({'_id':ObjectId(transaction_id)}))
-
 
1397
        if len(transaction) > 0:
-
 
1398
            if (transaction[0])['payout_status'] ==1:
-
 
1399
                get_mongo_connection().AppOrder.AppTransaction.update({'_id':ObjectId(transaction_id)},{"$set":{'payout_amount':float(payout), 'payout_description': CB_APPROVED,'payout_status':2}})
-
 
1400
                return {'status':'ok','message':'Payout updated'}
-
 
1401
            elif (transaction[0])['payout_status'] ==2:
-
 
1402
                return {'status':'ok','message':'Payout already processed'}
-
 
1403
            else:
-
 
1404
                return {'status':'fail','message':'Something is wrong'}
-
 
1405
        else:
-
 
1406
            return {'status':'fail','message':'transaction_id not found'}
-
 
1407
    except:
-
 
1408
        return {'status':'fail','message':'transaction_id not found'}
-
 
1409
        
1393
    
1410
    
1394
    
1411
    
1395
    
1412
    
1396
def main():
1413
def main():
1397
    generateRedirectUrl(101,1)
1414
    #generateRedirectUrl(101,1
-
 
1415
    print addPayout("10", "55db82c0bcabd7fc59e0a71")
1398
    
1416
    
1399
    
1417
    
1400
    
1418
    
1401
if __name__=='__main__':
1419
if __name__=='__main__':
1402
    main()
1420
    main()