|
|
|
@ -101,11 +101,9 @@ function verifyCode(code) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function displayAccountInfo() {
|
|
|
|
|
$("#loyaltyBalanceBox").addClass("display-none");
|
|
|
|
|
$("#loyaltyErrorMessage").html("");
|
|
|
|
|
if (inStorage("accountkey") && inStorage("accountnumber")) {
|
|
|
|
|
} else {
|
|
|
|
|
$("#loyaltyErrorMessage").text("Error: No account connected.");
|
|
|
|
|
$("#accountErrorMessage").text("Error: No account connected.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
apirequest(SETTINGS.apis.getaccountinfo, {
|
|
|
|
@ -115,8 +113,6 @@ function displayAccountInfo() {
|
|
|
|
|
$("#hasaccountbox").css("display", "");
|
|
|
|
|
$("#loadingaccountbox").css("display", "none");
|
|
|
|
|
if (success.status == "OK") {
|
|
|
|
|
$("#loyaltyCreditBalanceHeading").text(success.credits + " points");
|
|
|
|
|
$("#loyaltyBalanceBox").removeClass("display-none")
|
|
|
|
|
$("#accountnumberspan").text(success.accountnumber);
|
|
|
|
|
|
|
|
|
|
if (success.payments_setup === false) {
|
|
|
|
@ -131,11 +127,10 @@ function displayAccountInfo() {
|
|
|
|
|
$("#accountupdateform input#streetaddress").val(success.streetaddress);
|
|
|
|
|
$("#accountupdateform input#zipcode").val(success.zipcode);
|
|
|
|
|
} else {
|
|
|
|
|
$("#loyaltyBalanceBox").addClass("display-none");
|
|
|
|
|
$("#loyaltyErrorMessage").text("Error: " + success.msg);
|
|
|
|
|
$("#accountErrorMessage").text("Error: " + success.msg);
|
|
|
|
|
}
|
|
|
|
|
}, function (xhr, status, error) {
|
|
|
|
|
$("#loyaltyErrorMessage").text("Error: Couldn't get your account info. Try again later.");
|
|
|
|
|
$("#accountErrorMessage").text("Error: Couldn't get your account info. Try again later.");
|
|
|
|
|
sendErrorReport("Account", "Couldn't display account info", "Server/network problem: " + xhr.status + ": " + xhr.statusText);
|
|
|
|
|
}, "GET");
|
|
|
|
|
}
|
|
|
|
|