Toss payments 개발자 커뮤니티Tp개커Toss payments 개발자 커뮤니티
Powered by
MrPeterssM
Toss payments 개발자 커뮤니티•2y ago•
3 replies
MrPeterss

Next.js + Springboot with Payment Widget SDK

Hi everyone.

I am having some trouble coming up with a solution for my Next.js Frontend and Springboot Backend. I want the payment to be confirmed in my springboot backend when the payment request is succeeded from toss. Previously, I was doing this with the successUrl parameter in the requestPayment method (shown below). However, I don't want to expose my endpoints so that anyone can call it. I only want toss to be able to call my endpoint. I was thinking of using an api key, but i have no clue how i might be able to do this without exposing the key to the browser in the nextwork tab when the method is called. The last thing i want to happen is people going in and confirming a bunch of orders that were not paid.

await paymentWidget?.requestPayment({
                orderId: order,
                orderName: "order for " + name,
                customerName: name,
                customerEmail: email,
                customerMobilePhone: phoneNumber,
                successUrl: `${window.location.origin}/api/orders/confirm/${order}`,
                failUrl: `${window.location.origin}/api/orders/fail/${order}`,
              });
await paymentWidget?.requestPayment({
                orderId: order,
                orderName: "order for " + name,
                customerName: name,
                customerEmail: email,
                customerMobilePhone: phoneNumber,
                successUrl: `${window.location.origin}/api/orders/confirm/${order}`,
                failUrl: `${window.location.origin}/api/orders/fail/${order}`,
              });
Toss payments 개발자 커뮤니티 banner
Toss payments 개발자 커뮤니티Join
Toss payments 개발자 커뮤니티입니다. 결제 연동하며 겪는 기술 문의부터, 결제 시장에 대한 다양한 정보까지 얻어가세요~
15,588Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Payment widget 401
OriOOri / 🌎┃global-support
15mo ago
Toss Payment widget issue
ramkumarRramkumar / 🌎┃global-support
2y ago
Recurring payment support for SDK
sojucatSsojucat / 🌎┃global-support
6mo ago
Cannot payment with virtual bank account on Flutter SDK
tutaTtuta / 🌎┃global-support
6mo ago