From f15a7f8a4387d215abd1051ee520adca8944fa05 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 28 Mar 2023 16:32:45 +0700 Subject: checkout, quotation --- src/pages/api/shop/midtrans-payment.js | 20 ++++++++++----- src/pages/shop/quotation/finish.jsx | 47 +++++++++++++++++----------------- 2 files changed, 37 insertions(+), 30 deletions(-) (limited to 'src/pages') diff --git a/src/pages/api/shop/midtrans-payment.js b/src/pages/api/shop/midtrans-payment.js index be676d38..1772e9e0 100644 --- a/src/pages/api/shop/midtrans-payment.js +++ b/src/pages/api/shop/midtrans-payment.js @@ -31,6 +31,20 @@ export default async function handler(req, res) { serverKey: process.env.MIDTRANS_SERVER_KEY }) + let itemDetails = transaction.products.map((product) => ({ + id: product.code, + price: Math.round(product.price.priceDiscount), + quantity: product.quantity, + name: product.name?.substring(0, 50) + })) + + itemDetails.push({ + id: 'TAX', + price: transaction.amountTax, + quantity: 1, + name: 'PPN 11%' + }) + const parameter = { transaction_details: { order_id: transaction.name?.replaceAll('/', '-'), @@ -39,12 +53,6 @@ export default async function handler(req, res) { credit_card: { secure: true }, - item_details: transaction.products.map((product) => ({ - id: product.code, - price: Math.round(product.price.priceDiscount), - quantity: product.quantity, - name: product.name?.substring(0, 50) - })), customer_details: { first_name: transaction.address.customer.name, email: transaction.address.customer.email || '', diff --git a/src/pages/shop/quotation/finish.jsx b/src/pages/shop/quotation/finish.jsx index 15881ea0..32638b62 100644 --- a/src/pages/shop/quotation/finish.jsx +++ b/src/pages/shop/quotation/finish.jsx @@ -12,31 +12,30 @@ export default function FinishQuotation() { return ( -
-
- - - -
-

Terima Kasih {auth?.name}

-

- Penawaran harga kamu di Indoteknik.com berhasil dikirimkan, tim kami akan segera - menghubungi anda. -

- {id && ( - - Lihat Penawaran +
+
+
+ + + +
+

Terima Kasih {auth?.name}

+

+ Penawaran harga kamu di Indoteknik.com berhasil dikirimkan, tim kami akan segera + menghubungi anda. +

+ {id && ( + + Lihat Penawaran + + )} + + Ke Halaman Utama - )} - - Ke Halaman Utama - +
-- cgit v1.2.3