diff --git a/package.json b/package.json index 59175c9..c84e63f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "Parchment", + "name": "Forum", "version": "1.0.0", "type": "module", "scripts": { diff --git a/server/index.js b/server/index.js index ad126e7..09e0567 100644 --- a/server/index.js +++ b/server/index.js @@ -39,10 +39,32 @@ class Server { router.get('/db/images/*', this.getUserImage) router.get('/api/orgdata/*', this.getOrgData) router.get('/api/mydata/*', this.getPersonalData) + router.get('/api/stripe/onboarded', this.stripeOnboarded) router.get('/*', this.get) return router } + async stripeOnboarded() { + const { code } = req.body; + + const response = await stripe.oauth.token({ + grant_type: "authorization_code", + code, + }); + + const { stripe_user_id, access_token } = response; + + await db.users.update({ + where: { id: req.user.id }, + data: { + stripeAccountId: stripe_user_id, + stripeAccessToken: access_token, + } + }); + + res.json({ success: true }); + } + getPersonalData = async (req, res, next) => { try { const memberId = req.params[0] @@ -226,8 +248,8 @@ class Server { const app = express(); app.post("/webhook", express.raw({ type: "application/json" }), PaymentsHandler.webhook) const allowedOrigins = new Set([ - "https://www.parchment.page", - "https://parchment.page", + "https://www.frm.so", + "https://frm.so", "http://localhost:5174", "http://sam.local:5174", "http://localhost:5173", @@ -266,7 +288,7 @@ class Server { const PORT = 10002; server.listen(PORT, () => { console.log("\n") - console.log(chalk.yellow("*************** parchment.page ********")) + console.log(chalk.yellow("*************** frm.so ********")) console.log(chalk.yellowBright(`Server is running on port ${PORT}: http://localhost`)); console.log(chalk.yellow("***************************************")) console.log("\n") diff --git a/ui/desktop/apps/Forum/Forum.js b/ui/desktop/apps/Forum/Forum.js index 1e61268..a2087ed 100644 --- a/ui/desktop/apps/Forum/Forum.js +++ b/ui/desktop/apps/Forum/Forum.js @@ -69,7 +69,7 @@ class Forum extends Shadow { ForumPanel() - input("Message Parchment", "98%") + input("Message Forum", "98%") .paddingVertical(1, em) .paddingLeft(2, pct) .color("var(--accent)") diff --git a/ui/desktop/apps/Jobs/Jobs.js b/ui/desktop/apps/Jobs/Jobs.js index 25c6911..5fee1b6 100644 --- a/ui/desktop/apps/Jobs/Jobs.js +++ b/ui/desktop/apps/Jobs/Jobs.js @@ -30,7 +30,7 @@ class Jobs extends Shadow { { title: "Austin Chapter Lead", salary: "1% of Local Revenue", - company: "Parchment", + company: "Forum", city: "Austin", state: "TX" } diff --git a/ui/desktop/apps/Market/Market.js b/ui/desktop/apps/Market/Market.js index 1da5332..9a1785b 100644 --- a/ui/desktop/apps/Market/Market.js +++ b/ui/desktop/apps/Market/Market.js @@ -33,7 +33,7 @@ class Market extends Shadow { stars: "5", reviews: 1, price: "$12", - company: "Parchment", + company: "Forum", type: "new", image: "/db/images/1", madeIn: "America" diff --git a/ui/desktop/index.js b/ui/desktop/index.js index 1fdafb2..bfd74ac 100644 --- a/ui/desktop/index.js +++ b/ui/desktop/index.js @@ -34,8 +34,13 @@ let Global = class { const code = params.get("code"); if (code) { - // send this code to your backend console.log("success!: ", code) + await fetch("/api/stripe/connect", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ code }) + }); + } else { throw new Error("Stripe code is not present!") } diff --git a/ui/mobile/index.html b/ui/mobile/index.html index 7d7cc78..b775c70 100644 --- a/ui/mobile/index.html +++ b/ui/mobile/index.html @@ -1,9 +1,9 @@
-