From 2162b9ad218ef6473860dc89f24088addba209ea Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 9 Sep 2025 09:06:53 -0700 Subject: remove test route --- index.ts | 1 - routes/square.ts | 56 -------------------------------------------------------- 2 files changed, 57 deletions(-) diff --git a/index.ts b/index.ts index d4748059..02a6e0b5 100644 --- a/index.ts +++ b/index.ts @@ -86,7 +86,6 @@ app.post("/replace", auth, payments.replace); app.get("/decode/:bolt11", payments.decode); app.post("/fetchinvoice", payments.fetchinvoice); -app.get("/square/sync", auth, square.sync); app.get("/square/connect", auth, square.connect); app.get("/square/auth", auth, square.auth); app.post("/square/payment", square.payment); diff --git a/routes/square.ts b/routes/square.ts index eaffff1e..0359c82f 100644 --- a/routes/square.ts +++ b/routes/square.ts @@ -32,62 +32,6 @@ export default { ); }, - async sync(req, res) { - try { - const { user } = req; - let square = await g(`${user.id}:square`); - - let client = new SquareClient({ - environment, - }); - - const { refreshToken } = square; - - square = await client.oAuth.obtainToken({ - clientId: appId, - grantType: "refresh_token", - refreshToken, - }); - - await s(`${user.id}:square`, square); - - const { accessToken } = square; - - client = new SquareClient({ - token: accessToken, - environment, - }); - - // const payments = await authedClient.payments.list({}); - // console.log(payments); - const locs = await client.locations.list({}); - - const pay = await client.payments.create({ - sourceId: "EXTERNAL", - idempotencyKey: v4(), - amountMoney: { - amount: BigInt(1000), - currency: "CAD", - }, - // appFeeMoney: { - // amount: BigInt(10), - // currency: "CAD", - // }, - autocomplete: true, - externalDetails: { type: "OTHER", source: `Coinos ${v4()}` }, - locationId: locs.locations[0].id, - referenceId: v4(), - note: `Brief description ${v4()}`, - }); - - console.log(pay); - - res.send({}); - } catch (e) { - console.log(e); - } - }, - async auth(req, res) { const { user } = req; -- cgit v1.2.3