Commit 5d2afec4 by gujin.wang

在进行会员支付时,若还不是会员,则弹出认证窗口,进行会员认证

parent 776f1057
......@@ -17,6 +17,28 @@ TaskPay::TaskPay(QJsonObject &jsonObj, Session *session, QObject *parent)
QByteArray TaskPay::doTask()
{
FMP_DEBUG() << __FUNCTION__;
//判断是否真的是会员,如果不是,则先认证
if(!posReqJsonObj.contains("fm_open_id") || posReqJsonObj["fm_open_id"].toString().isEmpty())
{
QJsonObject reqObj;
reqObj["pos_ver"] = getPosJsonValue("pos_ver");
reqObj["operator_id"] = getPosJsonValue("operator_id");
reqObj["fm_cmd"] = FM_Login;
reqObj["pos_id"] = getPosJsonValue("pos_id");
reqObj["store_id"] = getPosJsonValue("store_id");
reqObj["business_date"] = getPosJsonValue("business_date");
TaskLogin taskLogin(reqObj, session());
QByteArray ret = taskLogin.doTask();
if(taskLogin.error() != FM_API_SUCCESS)
{
return ret;
}
//认证成功,使用返回的fm_open_id进行会员支付
posReqJsonObj["fm_open_id"] = QJsonDocument::fromJson(ret).object()["fm_open_id"];
}
//获取可用的代金券
TaskCoupon taskCoupon(posReqJsonObj, _session);
QByteArray ret = taskCoupon.doTask();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment