requestPayment의 metadata 파라미터 사용방법 문의

    async function requestPayment() {
        // 공통 결제 데이터 객체를 생성합니다.
        const paymentData = {
            method: method, // 'CARD', 'VIRTUAL_ACCOUNT', 'TRANSFER' 중 하나
            amount: {
                currency: "KRW",
                value: amount,
            },
            orderId: orderId,
            orderName: orderName,
            successUrl: window.location.origin + successUrl,
            failUrl: window.location.origin + failUrl,
            customerEmail: customerEmail,
            customerName: customerName,
            customerMobilePhone: customerMobilePhone,
            metadata: {
                product_type: product_type,
                lecture_code: lecture_code,
            },
        };

        // 결제 수단에 따라 추가 옵션을 설정합니다.
        if (method === 'VIRTUAL_ACCOUNT') {
            paymentData.virtualAccount = {
                cashReceipt: {
                    type: "미발행",
                },
                validHours: 168,
            };
        } else if (method === 'TRANSFER') {
            paymentData.transfer = {
                cashReceipt: {
                    type: "미발행",
                },
            };
        }

        // 결제 요청을 수행합니다.
        await payment.requestPayment(paymentData);
    }

    requestPayment().catch((r) => {
        const btn_arr = []
        btn_arr["confirm"] = {func: `location.href='${failUrl}';`};
        custom_alert(r.message, "", btn_arr);
    });


metadata에 2면 successUrl?
도 successUrl

?
Was this page helpful?