Esempio n. 1
0
def test_receiptrotationSuccess():
    # 单笔代扣轮训成功接口
    mysql_util.clear("settle_receipt_bill", "settle_receipt_bill_biz")
    result = http_util.post(
        "/route/receipt/single",
        body=req_model.addreceiptstate("s0012017111422263410"))
    assert_util.verify(result,
                       state="0",
                       resultCode="2001",
                       resultMsg=u'等待收款',
                       receiveTime=req_model.current_time,
                       bizId="s0012017111422263410",
                       systemSourceId="s001",
                       chnId="ch001")
    sql = mysql_util.update("settle_receipt_bill_biz",
                            "account_no=6214830101923232",
                            biz_id="s0012017111422263412")
    sql = mysql_util.update("settle_receipt_bill",
                            "account_no=6214830101923232",
                            biz_id="s0012017111422263412")
    time.sleep(6)
    sql = mysql_util.query(table="settle_receipt_bill_biz",
                           state=1,
                           ret_code=0000,
                           biz_id="s0012017111422263412",
                           ret_info=u"处理成功")
    print json.dumps(sql, indent=4, sort_keys=True)
    assert_util.verify(sql[0],
                       state="1",
                       ret_code="0000",
                       ret_info=u'处理成功',
                       receive_time=req_model.current_time,
                       biz_id="s0012017111422263412")
Esempio n. 2
0
def test_payment_transamountupperlimit():
    # 单笔代付交易金额上限不能超过20元
    mysql_util.clear("settle_payment_bill","settle_payment_bill_biz")
    sql = mysql_util.update("settle_channel_route", "id=79", trans_amount_upper_limit=9)
    result = http_util.post("/route/payment/single", body=req_model.addpaymentparame("s0012017111422263320"))
    assert_util.verify(result,state="-2",resultCode="1000",resultMsg=u'订单接收失败:订单[s0012017111422263320]-单笔交易额受限',receiveTime=req_model.current_time,bizId="s0012017111422263320",systemSourceId="s001",chnId="ch001")
    sql= mysql_util.update("settle_channel_route", "id=79", trans_amount_upper_limit=0)
Esempio n. 3
0
def test_payment_isable_time():
    # 系统不可用时间范围
    mysql_util.clear("settle_payment_bill","settle_payment_bill_biz")
    sql = mysql_util.update("settle_channel_route", "id=79", disable_time_interval_start=req_model.start_date,disable_time_interval_end=req_model.end_date)
    result = http_util.post("/route/payment/single",body=req_model.addpaymentparame("s0012017111422263320"))
    assert_util.verify(result,state="-2",resultCode="1000",resultMsg=u'订单接收失败:订单[s0012017111422263320]-渠道在不可用时间范围内',receiveTime=req_model.current_time,bizId="s0012017111422263320",systemSourceId="s001",chnId="ch001")
    sql= mysql_util.update("settle_channel_route", "id=79", disable_time_interval_start="" ,disable_time_interval_end ="")
Esempio n. 4
0
def test_payment_daytimeslimit():
    # 单笔代付单日交易额受限
    mysql_util.clear("settle_payment_bill","settle_payment_bill_biz")
    sql = mysql_util.update("settle_channel_route", "id=79", day_times_limit=1)
    test_paymentsuccess()
    result = http_util.post("/route/payment/single", body=req_model.addpaymentparame("s0012017111422263320"))
    assert_util.verify(result,state="-2",resultCode="1000",resultMsg=u'订单接收失败:订单[s0012017111422263320]-单日交易次数受限',receiveTime=req_model.current_time,bizId="s0012017111422263320",systemSourceId="s001",chnId="ch001")
    sql= mysql_util.update("settle_channel_route", "id=79", day_times_limit=0)
Esempio n. 5
0
def test_payment_chnstate():
    # 渠道不可用的
    mysql_util.clear("settle_payment_bill","settle_payment_bill_biz")
    sql = mysql_util.update("settle_channel_route", "id=79", chn_status=0)
    result = http_util.post("/route/payment/single", body=req_model.addpaymentparame("s0012017111422263320"))
    assert_util.verify(result, state="-2", resultCode="1000", resultMsg=u'订单接收失败:订单[s0012017111422263320]-渠道未配置或不可用',
                       receiveTime=req_model.current_time, bizId="s0012017111422263320", systemSourceId="s001",
                       chnId="ch001")
    sql = mysql_util.update("settle_channel_route", "id=79", chn_status=1)
Esempio n. 6
0
def test_receipt_transamountlowerlimit():
    # 单笔代收交易金额下限不能低于15元
    mysql_util.clear("settle_receipt_bill", "settle_receipt_bill_biz")
    sql = mysql_util.update("settle_channel_route",
                            "id=19",
                            trans_amount_lower_limit=15)
    result = http_util.post(
        "/route/receipt/single",
        body=req_model.addreceiptstate("s0012017111422263410"))
    assert_util.verify(result,
                       state="-2",
                       resultCode="1000",
                       resultMsg=u'订单接收失败:订单[s0012017111422263410]-单笔交易额受限',
                       receiveTime=req_model.current_time,
                       bizId="s0012017111422263410",
                       systemSourceId="s001",
                       chnId="ch001")
    sql = mysql_util.update("settle_channel_route",
                            "id=19",
                            trans_amount_lower_limit=0)