단건 결제(일회성) 승인(confirm) 요청 시 “빌링키 거래 유효하지 않음” 발생 문의

() , -> /.

1)
const successUrl = ${process.env.NEXT_PUBLIC_BACK_URL}/payment/checkout/confirm;
const failUrl = ${process.env.NEXT_PUBLIC_BACK_URL}/payment/fail;

const customerKey =
!isAnonymous && name.trim().length > 0 ? ${name}-${Date.now()} : ANONYMOUS;

const payment = tossPayments.payment({ customerKey });

payment.requestPayment({
method: "CARD",
amount: { currency: "KRW", value: finalAmount },
orderId: oid_${Date.now()},
orderName: "",
successUrl,
failUrl,
customerEmail: undefined,
customerName: isAnonymous ? "" : name || "",
});

2)
result = await sendHttpRequest<TossPaymentConfirmResponse>(
'',
'post',
'https://api.tosspayments.com/v1/payments/confirm',
{
Authorization: Basic ${this.configService.get('TOSSPAYMENTS_API_SECRET_KEY')},
'Content-Type': 'application/json',
},
JSON.stringify({ orderId, paymentKey, amount }),
);

?
Was this page helpful?