|
|
|
@ -26,7 +26,7 @@ function checkAndSave(username, password) {
|
|
|
|
|
localStorage.setItem("accttype", "giver");
|
|
|
|
|
} else if (profile.profile.type == 2) {
|
|
|
|
|
localStorage.setItem("accttype", "receiver");
|
|
|
|
|
} else if (profile.profile.type == 3){
|
|
|
|
|
} else if (profile.profile.type == 3) {
|
|
|
|
|
app.preloader.hide();
|
|
|
|
|
app.dialog.alert("You need to download the merchant app instead. Visit ntsm.co/contact if you need help.", "Error");
|
|
|
|
|
return;
|
|
|
|
@ -61,17 +61,47 @@ function createAccount() {
|
|
|
|
|
var username = $("#username").val();
|
|
|
|
|
var password = $("#password").val();
|
|
|
|
|
|
|
|
|
|
app.preloader.show();
|
|
|
|
|
if (username.length < 1) {
|
|
|
|
|
app.dialog.alert("Enter a username.", "Error");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (password.length < SETTINGS["min_password_length"]) {
|
|
|
|
|
app.dialog.alert("Password must be at least " + SETTINGS["min_password_length"] + " characters long.", "Error");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
callAPI("signup", {
|
|
|
|
|
username: username,
|
|
|
|
|
password: password,
|
|
|
|
|
accttype: type
|
|
|
|
|
}, function (data) {
|
|
|
|
|
app.preloader.hide();
|
|
|
|
|
checkAndSave(username, password, type);
|
|
|
|
|
}, function (msg) {
|
|
|
|
|
app.preloader.hide();
|
|
|
|
|
app.dialog.alert(msg, "Error");
|
|
|
|
|
});
|
|
|
|
|
app.dialog.create({
|
|
|
|
|
text: "I agree to the terms of service and privacy policy.",
|
|
|
|
|
buttons: [
|
|
|
|
|
{
|
|
|
|
|
text: "No",
|
|
|
|
|
onClick: function () {
|
|
|
|
|
restartApplication();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: "Yes",
|
|
|
|
|
onClick: function () {
|
|
|
|
|
app.preloader.show();
|
|
|
|
|
callAPI("signup", {
|
|
|
|
|
username: username,
|
|
|
|
|
password: password,
|
|
|
|
|
accttype: type
|
|
|
|
|
}, function (data) {
|
|
|
|
|
app.preloader.hide();
|
|
|
|
|
checkAndSave(username, password, type);
|
|
|
|
|
}, function (msg) {
|
|
|
|
|
app.preloader.hide();
|
|
|
|
|
app.dialog.alert(msg, "Error");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: "Show",
|
|
|
|
|
onClick: function () {
|
|
|
|
|
openBrowser(SETTINGS["terms_of_service_url"]);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
}).open();
|
|
|
|
|
}
|