Subversion Repositories SmartDukaan

Rev

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

Rev 14292 Rev 14295
Line 127... Line 127...
127
        rmap = json.loads(str(x.read()))
127
        rmap = json.loads(str(x.read()))
128
        if len(rmap)==0:
128
        if len(rmap)==0:
129
            return (0,0)
129
            return (0,0)
130
        else:
130
        else:
131
            if rmap['cash_back_description'] == 'PERCENTAGE':
131
            if rmap['cash_back_description'] == 'PERCENTAGE':
132
                return (math.floor((amount * rmap['cash_back_status'])/100), rmap['cash_back_status'])
132
                return (math.floor((amount * rmap['cash_back'])/100), rmap['cash_back'])
133
            else:
133
            else:
134
                return (rmap['cash_back_status'], 0)
134
                return (rmap['cash_back'], 0)
135
            
135
            
136
    
136
    
137
    '''
137
    '''
138
    Parses the order for specific store
138
    Parses the order for specific store
139
    
139
    
Line 237... Line 237...
237
        traceback.print_exc()
237
        traceback.print_exc()
238
        tprint("Could not batch refund")
238
        tprint("Could not batch refund")
239
        return False
239
        return False
240
    
240
    
241
def main():
241
def main():
242
    store = getStore(3)
242
    store = getStore(4)
243
    print store.getCashbackAmount('832308321', 100)
243
    print store.getCashbackAmount('1010989', 500)
244
    #data = urllib.urlencode({'orderId':6000, 'amount':200})
244
    #data = urllib.urlencode({'orderId':6000, 'amount':200})
245
    #request = urllib2.Request(WALLET_CREDIT_URL % (483649), headers=headers)
245
    #request = urllib2.Request(WALLET_CREDIT_URL % (483649), headers=headers)
246
    #response = urllib2.urlopen(request, data)
246
    #response = urllib2.urlopen(request, data)
247
    #print response.read()
247
    #print response.read()
248
    #settlePayBack()
248
    #settlePayBack()