#include "respgetmfpayinfo.h" #include #include #include RespGetMfPayInfo::RespGetMfPayInfo(QString json) { this->json = json; QScriptEngine engine; QScriptValue sv = engine.evaluate("value = " + this->json); QScriptValueIterator it(sv); if(json.isEmpty()) { rtnCode = RTNCODE_NETWORK_NOTAVAILABLE; rtnMemo = RTNMEMO_NETWORK_NOTAVAILABLE; } else if(json=="ABORT") { rtnCode = RTNCODE_NETWORK_ABORT; rtnMemo = RTNMEMO_NETWORK_ABORT; } else { rtnCode = RTNCODE_INVALID_FORMAT; rtnMemo = RTNMEMO_INVALID_FORMAT; while (it.hasNext()) { it.next(); if(it.name()=="rtnCode") { this->rtnCode = it.value().toInt32(); } else if(it.name()=="rtnMemo") { this->rtnMemo = it.value().toString(); } else if(it.name()=="rsCount") { this->rsCount = it.value().toInt32(); } else { QScriptValue sv1 = it.value(); map.insert("serialnum",sv1.property("serialnum").toString()); map.insert("payid",sv1.property("payid").toString()); map.insert("usercode",sv1.property("usercode").toString()); map.insert("paymoney",sv1.property("paymoney").toString()); map.insert("starttime",sv1.property("starttime").toString()); map.insert("endtime",sv1.property("endtime").toString()); map.insert("paytime",sv1.property("paytime").toString()); map.insert("payfunc",sv1.property("payfunc").toString()); map.insert("memo",sv1.property("memo").toString()); } } } } int RespGetMfPayInfo::getRtnCode() { return this->rtnCode; } QString RespGetMfPayInfo::getRtnMemo() { return this->rtnMemo; } int RespGetMfPayInfo::getRsCount() { return this->rsCount; } QMultiMap RespGetMfPayInfo::getRs() { return this->map; }