Add 2€ price level
This commit is contained in:
parent
4c928fcd5b
commit
0b1e6f069c
|
@ -36,6 +36,8 @@ Reader* scannedCardReader;
|
|||
String scannedCardId = "";
|
||||
String lastStatusText = "";
|
||||
|
||||
int transactionAmount = 150;
|
||||
String transactionAmountDecimal = "1.50";
|
||||
|
||||
volatile bool interruptFired = false;
|
||||
unsigned long timer = 0;
|
||||
|
@ -94,6 +96,16 @@ void IRAM_ATTR BalanceInterruptHandler() {
|
|||
else if (state == STATE_BALANCE_CARDSCAN) {
|
||||
PN532Reader::toggleMode = true;
|
||||
}
|
||||
else if (state == STATE_TRANSACT_CARDSCAN) {
|
||||
if (transactionAmount == 150) {
|
||||
transactionAmount = 200;
|
||||
transactionAmountDecimal = "2.00";
|
||||
}
|
||||
else {
|
||||
transactionAmount = 150;
|
||||
transactionAmountDecimal = "1.50";
|
||||
}
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
|
@ -223,9 +235,9 @@ void loop() {
|
|||
}
|
||||
if (!cooldownCheck(scanTimeout)) {
|
||||
if (PN532Reader::mode == PN532_MIFARE_ISO14443A)
|
||||
oled.updateOLED(state, String("1.50€"), String(cooldownSecondsRemaining(scanTimeout, timer)));
|
||||
oled.updateOLED(state, transactionAmountDecimal + String("€"), String(cooldownSecondsRemaining(scanTimeout, timer)));
|
||||
else
|
||||
oled.updateOLED(state, String("¥150"), String(cooldownSecondsRemaining(scanTimeout, timer)));
|
||||
oled.updateOLED(state, String("¥") + transactionAmount, String(cooldownSecondsRemaining(scanTimeout, timer)));
|
||||
}
|
||||
break;
|
||||
case STATE_TRANSACT_VERIFY:
|
||||
|
@ -239,7 +251,7 @@ void loop() {
|
|||
tone(PIN_BUZZER, NOTE_NONE, 150);
|
||||
}
|
||||
|
||||
lastStatusText = cardTransaction(wifi, http, apiUrl, scannedCardId, "-150");
|
||||
lastStatusText = cardTransaction(wifi, http, apiUrl, scannedCardId, String("-") + transactionAmount);
|
||||
if (lastStatusText.startsWith("S:")) {
|
||||
tone(PIN_BUZZER, NOTE_C7, 650);
|
||||
state = STATE_RESULT_SUCCESS;
|
||||
|
|
|
@ -103,6 +103,7 @@
|
|||
<div class="d-none d-md-flex btn-group btn-group-lg" role="group">
|
||||
<!-- Make sure these buttons match the small/mobile layout ones below -->
|
||||
<button type="submit" class="btn px-3 btn-danger" name="amount" value="-150">-1.50€</button>
|
||||
<button type="submit" class="btn px-3 btn-danger" name="amount" value="-200">-2€</button>
|
||||
<button type="submit" class="btn px-3 btn-success" name="amount" value="500">+5€</button>
|
||||
<button type="submit" class="btn px-3 btn-success" name="amount" value="1000">+10€</button>
|
||||
<a class="btn px-2 btn-primary" href="/EditUser/@user.Id">Edit</a>
|
||||
|
@ -117,6 +118,7 @@
|
|||
<div class="d-grid gap-1">
|
||||
<!-- Make sure these buttons match the big layout ones above-->
|
||||
<button type="submit" class="btn btn-lg btn-danger" name="amount" value="-150">-1.50€</button>
|
||||
<button type="submit" class="btn btn-lg btn-danger" name="amount" value="-200">-2€</button>
|
||||
<button type="submit" class="btn btn-lg btn-success" name="amount" value="500">+5€</button>
|
||||
<button type="submit" class="btn btn-lg btn-success" name="amount" value="1000">+10€</button>
|
||||
<a class="btn btn-lg btn-primary" href="/EditUser/@user.Id">Edit</a>
|
||||
|
|
Loading…
Reference in a new issue