결제 완료시 토스 결제 화면 노출되는 문제

재 Capacitor, NextJS().
android나 success url, . ?

android, . ,
. (-> -> )

.

await paymentWidget?.requestPayment({
  orderId: paymentData.orderUid,
  orderName,
  customerName: user.name,
  customerEmail: user.email,
  customerMobilePhone: user.phoneNumber.replaceAll('-', ''),
  ...getRedirectUrls(params, appInfo),
});

// 플랫폼별 리다이렉트 URL 생성
const getRedirectUrls = (params: URLSearchParams, appInfo: any) => {
  if (isNative) {
    // 네이티브(iOS/Android)에서는 앱 스킴 사용
    return {
      successUrl: `${appInfo.id}://customer/payment/success?${params.toString()}`,
      failUrl: `${appInfo.id}://customer/payment/fail?${params.toString()}`,
    };
  } else {
    // 웹에서는 일반 URL 사용
    return {
      successUrl: `${window.location.origin}/customer/payment/success?${params.toString()}`,
      failUrl: `${window.location.origin}/customer/payment/fail?${params.toString()}`,
    };
  }
};
Was this page helpful?