From c675686ba6e083f500199762baca65b0932a59ec Mon Sep 17 00:00:00 2001 From: shamitbilla Date: Wed, 14 Aug 2024 16:19:24 +0530 Subject: [PATCH] Fixed : onRamptransactions issue 2 --- apps/bank-webhook/src/index.ts | 4 +- .../app/(dashboard)/transfer/page.tsx | 3 +- apps/user-app/components/AddMoneyCard.tsx | 22 ++++++--- .../components/OnRampTransactions.tsx | 2 +- .../lib/actions/createOnrampTransactions.ts | 47 +++++++++++++++++++ package-lock.json | 14 +++--- packages/db/.env.example | 2 - packages/db/prisma/src/index.ts | 1 + packages/db/tsconfig.json | 2 +- 9 files changed, 78 insertions(+), 19 deletions(-) create mode 100644 apps/user-app/lib/actions/createOnrampTransactions.ts delete mode 100644 packages/db/.env.example create mode 100644 packages/db/prisma/src/index.ts diff --git a/apps/bank-webhook/src/index.ts b/apps/bank-webhook/src/index.ts index bb92555..7728069 100644 --- a/apps/bank-webhook/src/index.ts +++ b/apps/bank-webhook/src/index.ts @@ -52,4 +52,6 @@ app.post("/hdfcWebhook", async (req, res) => { }) -app.listen(3003); \ No newline at end of file +app.listen(3003,()=>{ + console.log("Web hook listening on port 3003"); +}); \ No newline at end of file diff --git a/apps/user-app/app/(dashboard)/transfer/page.tsx b/apps/user-app/app/(dashboard)/transfer/page.tsx index 1e0b889..73ebe6f 100644 --- a/apps/user-app/app/(dashboard)/transfer/page.tsx +++ b/apps/user-app/app/(dashboard)/transfer/page.tsx @@ -36,6 +36,7 @@ async function getOnRampTransactions() { export default async function() { const balance = await getBalance(); const transactions = await getOnRampTransactions(); + const session = await getServerSession(authOptions); return
@@ -43,7 +44,7 @@ export default async function() {
- +
diff --git a/apps/user-app/components/AddMoneyCard.tsx b/apps/user-app/components/AddMoneyCard.tsx index 562f021..fb8a36c 100644 --- a/apps/user-app/components/AddMoneyCard.tsx +++ b/apps/user-app/components/AddMoneyCard.tsx @@ -1,10 +1,12 @@ "use client" import { Button } from "@repo/ui/button"; import { Card } from "@repo/ui/card"; -import { Center } from "@repo/ui/center"; import { Select } from "@repo/ui/select"; import { useState } from "react"; import { TextInput } from "@repo/ui/textinput"; +import { createOnrampTranactions } from "../lib/actions/createOnrampTransactions"; + + const SUPPORTED_BANKS = [{ name: "HDFC Bank", @@ -14,25 +16,33 @@ const SUPPORTED_BANKS = [{ redirectUrl: "https://www.axisbank.com/" }]; -export const AddMoney = () => { +interface AddMoneyProps{ + user : Number +} + +export const AddMoney = ({user} : AddMoneyProps) => { const [redirectUrl, setRedirectUrl] = useState(SUPPORTED_BANKS[0]?.redirectUrl); + const [provider, setProvider] = useState(""); + const [amount,setAmount] = useState(0); return
- { - + { + setAmount(Number(e)); }} />
Bank