Skip to content

Commit 0399f24

Browse files
committed
fixup!
1 parent 873e092 commit 0399f24

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

lnpos/100_config.ino

+7-2
Original file line numberDiff line numberDiff line change
@@ -160,18 +160,23 @@ void readFiles()
160160
if (lnurlATM != "null" || lnurlATM != "")
161161
{
162162
baseURLATM = getValue(lnurlATM, ',', 0);
163+
// remove /api/v1.... and add /atm?lightning=
164+
int apiPos = baseURLATM.indexOf("api");
165+
baseUrlAtmPage = baseURLATM.substring(0, apiPos);
166+
baseUrlAtmPage += "atm?lightning=";
163167
secretATM = getValue(lnurlATM, ',', 1);
164168
currencyATM = getValue(lnurlATM, ',', 2);
165169
Serial.println("");
166-
Serial.println("lnurlATM: " + baseURLATM);
170+
Serial.println("baseURLATM: " + baseURLATM);
171+
Serial.println("baseUrlAtmPage: " + baseUrlAtmPage);
167172
if (secretATM != "")
168173
{
169174
menuItemCheck[3] = 1;
170175
}
171176
}
172177
else
173178
{
174-
Serial.println("lnurlATM not set");
179+
Serial.println("baseURLATM not set");
175180
}
176181

177182
//////////MasterKey/////////

lnpos/lnpos.ino

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ bool format = false;
3434

3535
bool hardcoded = false; /// Set to true to hardcode
3636

37-
String lnurlPoS = "https://legend.lnbits.com/lnurldevice/api/v1/lnurl/WTmei,BzzoY5wbgpym3eMdb9ueXr,USD";
38-
String lnurlATM = "https://legend.lnbits.com/lnurldevice/api/v1/lnurl/W5xu4,XGg4BJ3xCh36JdMKm2kgDw,USD";
37+
String lnurlPoS = "https://legend.lnbits.com/lnpos/api/v1/lnurl/WTmei,BzzoY5wbgpym3eMdb9ueXr,USD";
38+
String lnurlATM = "https://legend.lnbits.com/fossa/api/v1/lnurl/atm/W5xu4,XGg4BJ3xCh36JdMKm2kgDw,USD";
3939
String masterKey = "xpub6CJFgwcim8tPBJo2A6dS13kZxqbgtWKD3LKj1tyurWADbXbPyWo11exyotTSUY3cvhQy5Mfj8FSURgpXhc4L2UvQyaTMC36S49JnNJMmcWU";
4040
String lnbitsServer = "https://legend.lnbits.com";
4141
String invoice = "37d45d3e1f0d4572a905bad544588d7d";
@@ -63,6 +63,7 @@ String baseURLPoS;
6363
String secretPoS;
6464
String currencyPoS;
6565
String baseURLATM;
66+
String baseUrlAtmPage;
6667
String secretATM;
6768
String currencyATM;
6869
String dataIn = "0";
@@ -80,7 +81,7 @@ const char currencyItems[3][5] = {"sat", "USD", "EUR"};
8081
char decimalplacesOutput[20];
8182
int menuItemCheck[5] = {0, 0, 0, 0, 1};
8283
int menuItemNo = 0;
83-
String randomPin;
84+
int randomPin;
8485
int calNum = 1;
8586
int sumFlag = 0;
8687
int converted = 0;
@@ -1607,15 +1608,14 @@ bool makeLNURL()
16071608
iv[i] = random(0, 255);
16081609
iv_init[i] = iv[i];
16091610
}
1611+
randomPin = String(random(1000, 9999));
16101612

16111613
if (selection == "Offline PoS")
16121614
{
1613-
randomPin = String(random(1000, 9999));
16141615
preparedURL = baseURLPoS;
16151616
}
16161617
else // ATM
16171618
{
1618-
randomPin = String("FFFF");
16191619
preparedURL = baseURLATM;
16201620
}
16211621
preparedURL += "?p=";
@@ -1655,7 +1655,7 @@ bool makeLNURL()
16551655
char *charLnurl = (char *)calloc(strlen(url) * 2, sizeof(byte));
16561656
bech32_encode(charLnurl, "lnurl", data, len);
16571657
to_upper(charLnurl);
1658-
qrData = charLnurl;
1658+
qrData = baseUrlAtmPage + charLnurl;
16591659
Serial.println(qrData);
16601660

16611661
return true;

0 commit comments

Comments
 (0)