summaryrefslogtreecommitdiff
path: root/src/pages
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-03-28 16:32:45 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-03-28 16:32:45 +0700
commitf15a7f8a4387d215abd1051ee520adca8944fa05 (patch)
treea51a50ba27a53ff03da38c388e36a17149ad60fa /src/pages
parent8ca9069251873e87338f1c7f581b418bebb11e9a (diff)
checkout, quotation
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/api/shop/midtrans-payment.js20
-rw-r--r--src/pages/shop/quotation/finish.jsx47
2 files changed, 37 insertions, 30 deletions
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 (
<IsAuth>
<BasicLayout>
- <div className='m-4 px-4 py-6 shadow-md border border-gray_r-3'>
- <div className='flex'>
- <span className='p-3 mx-auto bg-yellow_r-3 border border-yellow_r-6 rounded'>
- <EnvelopeIcon className='w-8 text-yellow_r-11' />
- </span>
- </div>
- <p className='h2 text-center mt-6'>Terima Kasih {auth?.name}</p>
- <p className='text-center mt-3 leading-6 text-gray_r-11'>
- Penawaran harga kamu di Indoteknik.com berhasil dikirimkan, tim kami akan segera
- menghubungi anda.
- </p>
- {id && (
- <Link
- href={`/my/transaction/${id}`}
- className='btn-yellow !text-gray_r-12 mt-6 w-full'
- >
- Lihat Penawaran
+ <div className='mx-auto container'>
+ <div className='m-4 md:m-0 md:mt-10 px-4 py-6 shadow-md border border-gray_r-3'>
+ <div className='flex'>
+ <span className='p-3 mx-auto bg-yellow_r-3 border border-yellow_r-6 rounded'>
+ <EnvelopeIcon className='w-8 text-yellow_r-11' />
+ </span>
+ </div>
+ <p className='h2 text-center mt-6'>Terima Kasih {auth?.name}</p>
+ <p className='text-center mt-3 leading-6 text-gray_r-11'>
+ Penawaran harga kamu di Indoteknik.com berhasil dikirimkan, tim kami akan segera
+ menghubungi anda.
+ </p>
+ {id && (
+ <Link
+ href={`/my/transaction/${id}`}
+ className='btn-yellow !text-gray_r-12 mt-6 w-full md:w-1/3 md:mx-auto'
+ >
+ Lihat Penawaran
+ </Link>
+ )}
+ <Link href='/' className='btn-light !text-gray_r-12 mt-2 w-full md:w-1/3 md:mx-auto'>
+ Ke Halaman Utama
</Link>
- )}
- <Link
- href='/'
- className='btn-light !text-gray_r-12 mt-2 w-full'
- >
- Ke Halaman Utama
- </Link>
+ </div>
</div>
</BasicLayout>
</IsAuth>