File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,10 @@ export async function GET(req: NextRequest) {
1313 }
1414
1515 const payment = new Payment ( mpClient ) ;
16-
1716 const paymentData = await payment . get ( { id : paymentId } ) ;
1817
19- if ( paymentData . date_approved !== null || paymentData . status === 'approved' ) {
20- return NextResponse . redirect ( new URL ( '/ success' , req . url ) ) ;
18+ if ( paymentData . status === 'approved' || paymentData . date_approved !== null ) {
19+ return NextResponse . redirect ( new URL ( 'success' , req . url ) ) ;
2120 }
2221
2322 return NextResponse . json ( new URL ( '/' , req . url ) ) ;
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export async function POST(req: NextRequest) {
3535
3636 return NextResponse . json ( { received : true } , { status : 200 } ) ;
3737 } catch ( error ) {
38- console . log ( ' Error handling webhook: ' , error ) ;
38+ console . log ( 'Error handling webhook: ' , error ) ;
3939 return NextResponse . json (
4040 { error : 'Error processing payment' } ,
4141 { status : 500 } ,
You can’t perform that action at this time.
0 commit comments