예제 #1
0
def query_order(orderno):
    '''
    @summary: query status of order
    @param orderno: order no 
    '''
    orderItemObj = OrderItem.objects.get(orderno=orderno)
    if orderItemObj.paied:
        return PayResult(orderItemObj.orderno)
    elif orderItemObj.lapsed:
        return PayResult(orderItemObj.orderno, succ=False, lapsed=True)
    else:
        payResult = _PAY_GATEWAY[orderItemObj.payway].query_order(orderItemObj.orderno)
        _update_order_pay_result(payResult)
        return payResult
예제 #2
0
def _compose_pay_result(orderNo, tradestate):
    result = PayResult(orderNo)
    result.succ = tradestate in TRADE_STATE_SUCC
    result.lapsed = tradestate in TRADE_STATE_LAPSED
    return result
예제 #3
0
def _compose_pay_result(orderNo, trade_status):
    result = PayResult(orderNo)
    result.succ = trade_status in TRADE_STATUS_SUCC
    result.lapsed = trade_status in TRADE_STATUS_LAPSED
    return result      
예제 #4
0
def _compose_pay_result(orderNo, trade_status):
    result = PayResult(orderNo)
    result.succ = trade_status in TRADE_STATUS_SUCC
    result.lapsed = trade_status in TRADE_STATUS_LAPSED
    return result