Toss payments 개발자 커뮤니티Tp개커Toss payments 개발자 커뮤니티
Powered by
김태현김
Toss payments 개발자 커뮤니티•11mo ago•
6 replies
김태현

PC환경에서 Promise 방식을 지원하지 않습니다. successUrl, failUrl을 사용해주세요. 에러 질문

안녕하세요 이번에 결제 위젯을 통한 페이팔을 구현중인데요
아래와 같이 코드를 작성하고 PC 환경에서 함수를 실행했을 때 Promise 방식을 지원하지 않습니다. successUrl, failUrl 라는 에러가 발생하는데 어떻게 해결할 수 있을까요?

  async function requestPaypal() {
    const tossPayments = await loadTossPayments(
        '',
    );

    const widgets = tossPayments.widgets({ customerKey: hotelBookingId });

    widgets.setAmount({
      currency: 'USD',
      value: tossAmount.value,
    });

    await Promise.all([
      // ------  결제 UI 렌더링 ------
      widgets.renderPaymentMethods({
        selector: "#payment-method",
        variantKey: "PAYPAL",
      }),

    ]);

    try {
      await widgets.requestPayment({
        orderId: hotelBookingId,
        orderName: "토스 티셔츠 외 2건",
        customerEmail: "customer123@gmail.com",
        customerName: "김토스",
      });
    } catch (error) {
      console.error("결제 요청 중 오류 발생:", error);
    }
  }
  async function requestPaypal() {
    const tossPayments = await loadTossPayments(
        '',
    );

    const widgets = tossPayments.widgets({ customerKey: hotelBookingId });

    widgets.setAmount({
      currency: 'USD',
      value: tossAmount.value,
    });

    await Promise.all([
      // ------  결제 UI 렌더링 ------
      widgets.renderPaymentMethods({
        selector: "#payment-method",
        variantKey: "PAYPAL",
      }),

    ]);

    try {
      await widgets.requestPayment({
        orderId: hotelBookingId,
        orderName: "토스 티셔츠 외 2건",
        customerEmail: "customer123@gmail.com",
        customerName: "김토스",
      });
    } catch (error) {
      console.error("결제 요청 중 오류 발생:", error);
    }
  }
Toss payments 개발자 커뮤니티 banner
Toss payments 개발자 커뮤니티Join
Toss payments 개발자 커뮤니티입니다. 결제 연동하며 겪는 기술 문의부터, 결제 시장에 대한 다양한 정보까지 얻어가세요~
15,588Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

"successUrl" 또는 "failUrl"을 넘긴 경우 Promise 방식을 지원하지 않습니다.
YesAladinYYesAladin / ❓┃연동개발-문의
3y ago
인스타그램 인앱 브라우저에서 페이팔 결제 시 '모바일 화면에서는 Promise 방식을 지원하지 않습니다.' 오류 발생 문의
huzzHhuzz / ❓┃연동개발-문의
2y ago
''은 지원하지 않습니다
stagioneSstagione / ❓┃연동개발-문의
8mo ago
SuccessUrl 관련 질문
조이조조이 / ❓┃연동개발-문의
3y ago