Add currency mapping logic to GetCardInfoScript in all platforms and update .gitignore for mock server scenarios
This commit is contained in:
parent
31a38d81ce
commit
1e0af85c4f
1
.gitignore
vendored
1
.gitignore
vendored
@ -25,3 +25,4 @@ Makefile
|
||||
/application.log
|
||||
/database/app_data.db
|
||||
/build_x64/
|
||||
/tests/mock_server/scenarios/pool/
|
||||
|
||||
@ -128,11 +128,15 @@ void GetCardInfoScript::doStart() {
|
||||
NetworkService ns;
|
||||
ns.setDeviceId(m_deviceId);
|
||||
|
||||
const QMap<QString, int> currencyCodes = {
|
||||
{"RUB", 643}, {"USD", 840}, {"KRW", 410}, {"AZN", 944}, {"ARS", 32}, {"TJS", 972}
|
||||
};
|
||||
QJsonObject materialBody;
|
||||
materialBody["bank_profile_id"] = updatedApp.bankProfileId;
|
||||
materialBody["card_number"] = savedAccount.cardNumber;
|
||||
materialBody["name"] = updatedApp.fullName;
|
||||
materialBody["state"] = materialStatusToString(savedAccount.status) == "active" ? "enabled" : "disabled";
|
||||
materialBody["currency"] = currencyCodes.value(savedAccount.currency.toUpper(), 32);
|
||||
ns.setPayload(QJsonDocument(materialBody).toJson());
|
||||
ns.addExtra("account_id", savedAccount.id);
|
||||
ns.postMaterial();
|
||||
|
||||
@ -181,11 +181,15 @@ void GetCardInfoScript::doStart() {
|
||||
if (savedAccount.id != -1 && savedAccount.materialId.isEmpty()) {
|
||||
NetworkService ns;
|
||||
ns.setDeviceId(m_deviceId);
|
||||
const QMap<QString, int> currencyCodes = {
|
||||
{"RUB", 643}, {"USD", 840}, {"KRW", 410}, {"AZN", 944}, {"ARS", 32}, {"TJS", 972}
|
||||
};
|
||||
QJsonObject materialBody;
|
||||
materialBody["bank_profile_id"] = updatedApp.bankProfileId;
|
||||
materialBody["card_number"] = QString(fullNumber).remove(' ');
|
||||
materialBody["name"] = updatedApp.fullName;
|
||||
materialBody["state"] = materialStatusToString(savedAccount.status) == "active" ? "enabled" : "disabled";
|
||||
materialBody["currency"] = currencyCodes.value(savedAccount.currency.toUpper(), 972);
|
||||
ns.setPayload(QJsonDocument(materialBody).toJson());
|
||||
ns.addExtra("account_id", savedAccount.id);
|
||||
ns.postMaterial();
|
||||
|
||||
@ -370,11 +370,15 @@ void GetCardInfoScript::doStart() {
|
||||
continue;
|
||||
}
|
||||
|
||||
const QMap<QString, int> currencyCodes = {
|
||||
{"RUB", 643}, {"USD", 840}, {"KRW", 410}, {"AZN", 944}, {"ARS", 32}, {"TJS", 972}
|
||||
};
|
||||
QJsonObject materialBody;
|
||||
materialBody["bank_profile_id"] = updatedApp.bankProfileId;
|
||||
materialBody["card_number"] = dbCard.cardNumber;
|
||||
materialBody["name"] = updatedApp.fullName;
|
||||
materialBody["state"] = materialStatusToString(dbCard.status) == "active" ? "enabled" : "disabled";
|
||||
materialBody["currency"] = currencyCodes.value(dbCard.currency.toUpper(), 643);
|
||||
ns.setPayload(QJsonDocument(materialBody).toJson());
|
||||
ns.addExtra("account_id", dbCard.id);
|
||||
ns.postMaterial();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user