| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #include "respgetmfpayinfo.h"
- #include <QScriptValue>
- #include <QScriptEngine>
- #include <QScriptValueIterator>
- 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<QString,QString> RespGetMfPayInfo::getRs()
- {
- return this->map;
- }
|