aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-09-09 09:06:53 -0700
committerAdam Soltys <[email protected]>2025-09-09 09:06:53 -0700
commit2162b9ad218ef6473860dc89f24088addba209ea (patch)
tree66a6d680dd9d1f7f3162900bc2f36a0d69a4cda0
parentb266a4f161b8b2dfe3005cbd5c0bc68a31adabc3 (diff)
downloadcoinos-server-2162b9ad218ef6473860dc89f24088addba209ea.tar.gz
coinos-server-2162b9ad218ef6473860dc89f24088addba209ea.zip
remove test route
-rw-r--r--index.ts1
-rw-r--r--routes/square.ts56
2 files changed, 0 insertions, 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;