Payment gateaway

# fix
- Alur setelah pembayaran
### Issue:
- Payment notif akan di perbaharui
This commit is contained in:
2023-12-14 10:19:40 +08:00
parent 693bb65710
commit 8ee62b875d
15 changed files with 549 additions and 367 deletions

View File

@@ -2,7 +2,7 @@
import prisma from "@/app/lib/prisma";
export default async function funTotalInvestorByIdInvestasi(id: string) {
export default async function funTotalInvestorByIdInvestasi(id: any) {
// console.log(id)
const data = await prisma.transaksiInvestasi.count({
where: {

View File

@@ -5,7 +5,7 @@ import prisma from "@/app/lib/prisma";
export async function getListAllPublish() {
const data = await prisma.investasi.findMany({
orderBy: {
updatedAt: "desc",
countDown: "asc",
},
where: {
MasterStatusInvestasi: {

View File

@@ -7,7 +7,7 @@ export default async function getListTransaksiBerhasilInvestasi(
) {
const data = await prisma.transaksiInvestasi.findMany({
orderBy: {
createdAt: "desc"
createdAt: "desc",
},
where: {
authorId: idAuthor,
@@ -15,7 +15,16 @@ export default async function getListTransaksiBerhasilInvestasi(
},
select: {
id: true,
Investasi: true,
Investasi: {
select: {
author: true,
imagesId: true,
title: true,
totalLembar: true,
sisaLembar: true,
},
},
Author: true,
gross_amount: true,
quantity: true,

View File

@@ -3,14 +3,6 @@
import prisma from "@/app/lib/prisma";
import MidTrans from "midtrans-client";
// const midtransClient = require("midtrans-client");
// const snap = new midtransClient.Snap({
// isProduction: false,
// serverKey: process.env.Server_KEY,
// clientKey: process.env.Client_KEY,
// });
const snap = new MidTrans.Snap({
isProduction: false,
serverKey: process.env.Server_KEY,
@@ -58,14 +50,14 @@ export default async function getTokenTransaksi(data) {
free_text: {
inquiry: [
{
en: "text in English",
id: "text in Bahasa Indonesia",
en: "Pay according to the invoice",
id: "Bayar sesuai faktur",
},
],
payment: [
{
en: "text in English",
id: "text in Bahasa Indonesia",
en: "Pay according to the invoice",
id: "Bayar sesuai faktur",
},
],
},