Paypal 결제위젯 연동 INVALID_PAYMENT_METHOD

web서 toss payments .
react"@tosspayments/tosspayments-sdk": "^2.2.4" .

럼 paypal , requestPayment

은 failUrl
http://localhost:3000/payments/toss/fail?code=INVALID_PAYMENT_METHOD&message=Payment%20has%20already%20been%20requested.&orderId=48db89da-b1f2-4830-9f9f-5e00f6fe7b77

const widgetsRef = useRef<TossPaymentsWidgets | null>(null);

const initWidgets = async () => {
if (process.env.TOSS_PAYMENTS_API_KEY) {
const tossPayments = await loadTossPayments(
process.env.TOSS_PAYMENTS_API_KEY
);
const customerKey = getRandomId();
const widgets = tossPayments.widgets({ customerKey });
widgetsRef.current = widgets;
}
};


// 서 currency, amount
widgetsRef.current.setAmount({
currency: currency,
value: amount,
});


//
widgetsRef.current.requestPayment({
orderId: orderId,
orderName: test-order-name,
successUrl: ${window.location.origin}/payments/toss/success,
failUrl: ${window.location.origin}/payments/toss/fail,
customerEmail: "test@test.com",
customerName: "testNickname",
});


. 제 UI () .

, 제 paypal. currency는 USD

: vecmuledph
!
image.png
Was this page helpful?