def test001(self):
        """
        手工审核付款成功-正例-冒烟
        """
        #发送请求
        self.inputParameter['requestId'] = commonUtils.requestId()
        self.inputParameter['transferPayType'] = '0'
        self.inputParameter['signature'] = commonUtils.md5Signature(
            self.inputParameter, self.key, self.requestSignatrueRule)
        s = requests.post(url=self.actionUrl,
                          data=commonUtils.encodeDictionaryToGBK(
                              self.inputParameter),
                          verify=False)
        self.outputParameter.update(s.json())
        respsonseSignatrue = commonUtils.md5Signature(self.outputParameter,
                                                      self.key,
                                                      self.syncSignatrueRule)
        #响应签名断言
        self.assertEqual(respsonseSignatrue,
                         self.outputParameter['signature'],
                         msg='响应签名验签失败')
        #同步响应断言
        self.assertEqual('00000',
                         self.outputParameter['result'],
                         msg=self.IOParameter)
        #数据库断言
        sqlStatus = 'select status from merchant_transfer_request where request_id = \'%s\' order by id desc' % self.inputParameter.get(
            'requestId').decode()
        requestStatus = str(OracleQuery.sqlAll(sqlStatus)[0][0])
        self.assertEqual('0', requestStatus)
        self.ass

        returnTuple = login(
            const._global_configuration().optionManagerOperator)
        commonUtils.waiting(15)
        #风控通过
        transferRiskAudit(self.inputParameter.get('requestId'), returnTuple[1])
        requestStatus = str(OracleQuery.sqlAll(sqlStatus)[0][0])
        self.assertEqual('6', requestStatus)

        #财务通过
        transferConfirm(self.inputParameter.get('requestId'), returnTuple[1])
        requestStatus = str(OracleQuery.sqlAll(sqlStatus)[0][0])
        self.assertEqual('9', requestStatus)
Beispiel #2
0
def merchantFeeAuditAction_auditConfirm(merchantFeeRequestId, cookie):
    merchantFeeAuditActionList = [
        '/Admin/merchantManage/merchantFeeAuditAction_auditConfirm'
    ]
    merchantFeeAuditResponse = requests.get(
        const._global_configuration().OptionManagerHttpUrl +
        merchantFeeAuditActionList[0] + '?requestId=' + merchantFeeRequestId,
        cookies=cookie)
    responseHtmlStr = merchantFeeAuditResponse.text
    strSQL = 'select status from MERCHANT_FEE_REQUEST where id = %s order by id desc' % merchantFeeRequestId
    return OracleQuery.sqlAll(strSQL)
Beispiel #3
0
def sendMerchantSMS(usrDictionary):
    sendMerchantSMSParam = {'operatorName': usrDictionary.get('userName'),
                        'merchantNo': usrDictionary.get('merchantCode'),
                        'mobilePhoneFlag': '1'}
    responseByPostForm = requests.post(const._global_configuration().merchantHttpUrl + 'Login_sendPhoneMessage',
                                       data = sendMerchantSMSParam,
                                       verify = False)
    dict = json.loads(responseByPostForm.text)
    if dict.get('dataMap').get('result') == 0:
        randomValidateId = dict.get('dataMap').get('randomValidateId')
        sql = "select t.random_code from sms_request t where t.random_id = '%s'"%randomValidateId
        randomCode = OracleQuery.sqlOne(sql)
        return (True, randomValidateId, commonUtils.decryptDes(randomCode[0]))
    else:
        return (False, responseByPostForm.text)
Beispiel #4
0
def transferRiskAudit(merchantTransferRequestId, cookie):
    sqlId = 'select id from merchant_transfer_request where request_id = \'%s\'' %merchantTransferRequestId#.decode()
    indexId = OracleQuery.sqlOne(sqlId)[0]
    transferRiskAuditActionList = ['/Admin/withdrawManage/merchantWithdrawManageAction_query',
                          '/Admin/withdrawManage/merchantWithdrawManageAction_mgconfirm?requestId=%s&fld1=0'%(indexId)]
    getTokenParam = {'requestDateStart': '2999/03/12'}
    getTokenResponseHtmlStr = requests.post(
        const._global_configuration().OptionManagerHttpUrl + transferRiskAuditActionList[0],
        cookies=cookie, data = getTokenParam)
    selector = etree.HTML(getTokenResponseHtmlStr.text)
    try:
        strToken = (selector.xpath('//input[@name=\"token\"]/@value'))[0].strip()
    except IndexError:
        strToken = 'none'
    hideFormParam = {'struts.token.name': 'token',
                 'token': strToken}
    allFormParam = hideFormParam.copy()
    responseByPostForm = requests.post(const._global_configuration().OptionManagerHttpUrl + transferRiskAuditActionList[1],
                                       cookies=cookie,
                                       data = allFormParam)
    responseHtmlStr = responseByPostForm.text