def pay_order_query(self, out_trade_no):
        """
        查询订单状态
        一般用于无法确定 订单状态时候补偿

        :param out_trade_no: 本地订单号
        :return: 订单信息dict
        """

        package = {
            'partner': self.pay_partner_id,
            'out_trade_no': out_trade_no,
        }

        _package = package.items()
        _package.sort()

        s = '&'.join(
            [
                "%s=%s" % (p[0], str(p[1]))
                for p in (_package + [('key', self.pay_partner_key)])
            ]
        )
        package['sign'] = md5(s).hexdigest().upper()

        package = '&'.join(["%s=%s" % (p[0], p[1]) for p in package.items()])

        params, sign, _ = self._pay_sign_dict(
            add_noncestr=False, package=package
        )

        params['app_signature'] = sign
        params['sign_method'] = 'sha1'

        return self.post(
            url="https://api.weixin.qq.com/pay/orderquery", data=params
        )
def pay_order_query ( self , out_trade_no ) : package = { 'partner' : self . pay_partner_id , 'out_trade_no' : out_trade_no , } _package = package . items ( ) _package . sort ( ) s = '&' . join ( [ "%s=%s" % ( p [ 0 ] , str ( p [ 1 ] ) ) for p in ( _package + [ ( 'key' , self . pay_partner_key ) ] ) ] ) package [ 'sign' ] = md5 ( s ) . hexdigest ( ) . upper ( ) package = '&' . join ( [ "%s=%s" % ( p [ 0 ] , p [ 1 ] ) for p in package . items ( ) ] ) params , sign , _ = self . _pay_sign_dict ( add_noncestr = False , package = package ) params [ 'app_signature' ] = sign params [ 'sign_method' ] = 'sha1' return self . post ( url = "https://api.weixin.qq.com/pay/orderquery" , data = params )
查询订单状态
        一般用于无法确定 订单状态时候补偿

        :param out_trade_no: 本地订单号
        :return: 订单信息dict