tosspayments/payment-sdk 라이브러리 질문 드립니다 ㅜㅜ

...
if (paymentMethod === '토스페이') {
        const ck = process.env.NEXT_PUBLIC_TOSS_CLIENT_KEY;
        const sk = process.env.NEXT_PUBLIC_TOSS_SECRET_KEY;

        if (!ck) throw Error('Invalid Client Key');
        if (!sk) throw Error('Invalid Secret Key');

        const tossPayments = await loadTossPayments(ck);
        tossPayments.requestPayment('토스페이', {
          amount: price,
          orderId: Buffer.from(token + popupId + date + ':').toString('base64'),
          orderName: 'POPPY 테스트',
          customerName: userInfoData[0].userNickname,
          successUrl: `http://localhost:3000/detail/${popupId}/book/completed`,
          failUrl: `http://localhost:3000/detail/${popupId}`,
        });
      }
...

'API '.env.local .
데 API 시 401(Unathorized)"Uncaught (in promise) p: 릿 ."
시 API ?
Was this page helpful?