Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sweepstake
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Arjun Jhukal
sweepstake
Commits
174a1547
Commit
174a1547
authored
Oct 30, 2025
by
Arjun Jhukal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated the new payment method and also added new success page
parent
b26180d0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
20 deletions
+94
-20
page.tsx
...d)/(user)/(outsideAuth)/buy-coins/[slug]/success/page.tsx
+39
-0
index.tsx
...erDashboard/buyCoins/buyCoinSinlgeGame/checkout/index.tsx
+53
-20
transaction.ts
src/types/transaction.ts
+2
-0
No files found.
src/app/(dashboard)/(user)/(outsideAuth)/buy-coins/[slug]/success/page.tsx
0 → 100644
View file @
174a1547
import
GlassWrapper
from
'@/components/molecules/GlassWrapper'
import
Image
from
'next/image'
import
Link
from
'next/link'
import
React
from
'react'
interface
PaymentSuccessProps
{
params
:
{
slug
:
string
}
}
export
default
function
PaymentSuccess
({
params
}:
PaymentSuccessProps
)
{
const
{
slug
}
=
params
return
(
<
GlassWrapper
className=
"max-w-[520px] mx-auto flex flex-col gap-3 items-center text-center p-6"
>
<
Image
src=
"/assets/images/verify-email.png"
alt=
"Payment Success"
width=
{
180
}
height=
{
140
}
/>
<
h1
className=
"text-[24px] lg:text-[32px] leading-[120%] font-bold mb-4 text-green-500"
>
Payment Successful 🎉
</
h1
>
<
p
className=
"text-[14px] leading-[150%] font-normal lg:text-[16px] mb-4"
>
Your payment was processed successfully. You’ll be redirected to the game
page shortly.
</
p
>
<
Link
href=
{
`${process.env.NEXT_PUBLIC_BASE_URL}/exclusive-games/${slug}`
}
className=
"ss-btn bg-primary-grad"
>
View Game Detail
</
Link
>
</
GlassWrapper
>
)
}
src/components/pages/dashboard/userDashboard/buyCoins/buyCoinSinlgeGame/checkout/index.tsx
View file @
174a1547
...
@@ -9,7 +9,7 @@ import { showToast, ToastVariant } from '@/slice/toastSlice';
...
@@ -9,7 +9,7 @@ import { showToast, ToastVariant } from '@/slice/toastSlice';
import
{
Box
,
Button
}
from
'@mui/material'
;
import
{
Box
,
Button
}
from
'@mui/material'
;
import
{
BitcoinRefresh
,
Check
,
TickCircle
}
from
'@wandersonalwes/iconsax-react'
;
import
{
BitcoinRefresh
,
Check
,
TickCircle
}
from
'@wandersonalwes/iconsax-react'
;
import
Image
from
'next/image'
;
import
Image
from
'next/image'
;
import
{
useRouter
}
from
'next/navigation'
;
import
{
use
Pathname
,
use
Router
}
from
'next/navigation'
;
import
React
from
'react'
import
React
from
'react'
type
PaymentModeProps
=
"crypto"
|
"idem"
type
PaymentModeProps
=
"crypto"
|
"idem"
...
@@ -18,11 +18,13 @@ export default function CheckoutPage({ amount, slug, bonus }: {
...
@@ -18,11 +18,13 @@ export default function CheckoutPage({ amount, slug, bonus }: {
slug
:
string
;
slug
:
string
;
bonus
:
number
bonus
:
number
})
{
})
{
const
pathname
=
usePathname
();
const
dispatch
=
useAppDispatch
();
const
dispatch
=
useAppDispatch
();
const
router
=
useRouter
();
const
router
=
useRouter
();
const
[
getPaymentLink
,
{
isLoading
:
gettingLink
}]
=
useDepositMutation
();
const
[
getPaymentLink
,
{
isLoading
:
gettingLink
}]
=
useDepositMutation
();
const
[
currentPaymentMode
,
setCurrentPaymentMode
]
=
React
.
useState
(
"crypto"
);
const
[
currentPaymentMode
,
setCurrentPaymentMode
]
=
React
.
useState
(
"crypto"
);
console
.
log
(
pathname
)
return
(
return
(
<
section
className=
"checkout__root"
>
<
section
className=
"checkout__root"
>
<
div
className=
"grid grid-cols-12 gap-4 lg:gap-10 xl:gap-12"
>
<
div
className=
"grid grid-cols-12 gap-4 lg:gap-10 xl:gap-12"
>
...
@@ -100,25 +102,56 @@ export default function CheckoutPage({ amount, slug, bonus }: {
...
@@ -100,25 +102,56 @@ export default function CheckoutPage({ amount, slug, bonus }: {
<
Button
type=
'submit'
variant=
'contained'
color=
'primary'
className=
'!mt-3'
onClick=
{
async
()
=>
{
<
Button
type=
'submit'
variant=
'contained'
color=
'primary'
className=
'!mt-3'
onClick=
{
async
()
=>
{
try
{
try
{
const
response
=
await
getPaymentLink
({
if
(
currentPaymentMode
===
"crypto"
)
{
id
:
slug
,
const
response
=
await
getPaymentLink
({
amount
,
id
:
slug
,
type
:
currentPaymentMode
as
PaymentModeProps
amount
,
}).
unwrap
();
type
:
currentPaymentMode
as
PaymentModeProps
router
.
replace
(
response
?.
data
?.
payment_url
)
}).
unwrap
();
// if (currentPaymentMode === "crypto")
{
router
.
replace
(
response
?.
data
?.
payment_url
)
//
}
}
// else if (currentPaymentMode === "idem")
{
else
if
(
currentPaymentMode
===
"idem"
)
{
// console.log("payment mode is idem");
const
response
=
await
getPaymentLink
({
//
}
id
:
slug
,
// else
{
amount
,
// dispatch(
type
:
currentPaymentMode
as
PaymentModeProps
// showToast(
{
}).
unwrap
();
// message: "Please select prefered mode of payment.",
// variant: ToastVariant.INFO
const
merchant_id
=
response
?.
data
?.
merchant_id
;
//
})
const
currency
=
response
?.
data
?.
currency
;
// )
const
order_ref
=
response
?.
data
?.
payment_id
;
//
}
const
form
=
document
.
createElement
(
"form"
);
form
.
method
=
"POST"
;
form
.
action
=
response
?.
data
?.
payment_url
;
const
fields
=
{
merchant_id
,
amount
,
currency
,
order_ref
,
completed_url
:
`${process.env.NEXT_PUBLIC_FRONTEND_URL}/buy-coins/${slug}/success`
};
Object
.
entries
(
fields
).
forEach
(([
key
,
value
])
=>
{
const
input
=
document
.
createElement
(
"input"
);
input
.
type
=
"hidden"
;
input
.
name
=
key
;
input
.
value
=
value
as
string
;
form
.
appendChild
(
input
);
});
document
.
body
.
appendChild
(
form
);
form
.
submit
();
}
else
{
dispatch
(
showToast
({
message
:
"Please select prefered mode of payment."
,
variant
:
ToastVariant
.
INFO
})
)
}
}
}
catch
(
e
:
any
)
{
catch
(
e
:
any
)
{
...
...
src/types/transaction.ts
View file @
174a1547
...
@@ -14,6 +14,8 @@ export interface DepositUrlProps {
...
@@ -14,6 +14,8 @@ export interface DepositUrlProps {
amount
:
number
;
amount
:
number
;
currency
:
string
;
currency
:
string
;
payment_url
:
string
;
payment_url
:
string
;
merchant_id
:
string
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment