Skip to content

Commit 102b4a7

Browse files
committed
fix: 🐛 fix response route pending. change '/sucess' by 'sucess'
1 parent aa0e407 commit 102b4a7

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/app/api/mercado-pago/pending/route.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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));

src/app/api/mercado-pago/webhook/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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 },

0 commit comments

Comments
 (0)