Skip to content

Commit e13b30e

Browse files
committed
fix: stripe payments not being recorded
1 parent e496885 commit e13b30e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,18 @@ app.use(express.json())
6666

6767
server.applyMiddleware({ app, cors: false })
6868

69-
app.get("/secret", async (req, res) => {
69+
app.post("/secret", async (req, res) => {
7070
const intent = await stripe.paymentIntents.create({
7171
amount: 500,
7272
currency: "usd",
7373
metadata: { integration_check: "accept_a_payment" },
7474
})
7575

76+
await prisma.updateLetter({
77+
where: { id: req.body.letterId },
78+
data: { payment: { create: { stripeId: intent.client_secret } } },
79+
})
80+
7681
res.json({ client_secret: intent.client_secret })
7782
})
7883

0 commit comments

Comments
 (0)