EBP API Docs v0.5.12
EN

Worldpay iframe Guide #

참고용 Worldpay 가이드 Url :
https://developer.worldpay.com/products/hosted-payment-pages/iframe

Store 구현 설명 #

  1. Worldpay Embedded Integration JS 로드
  2. iframe이 랜더링될 container 요소 생성
  3. WPCL.Library().setup() 호출로 iframe 주입
  4. resultCallback()을 이용한 결제 결과 처리
항목설명
url가장 중요
Store 서버가 Worldpay API를 통해 생성한 HPP Session URL
targetiframe이 삽입될 div의 id
language / country결제 UI 언어 및 국가 설정
successURL결제 성공 시 이동할 Store 페이지
cancelURL사용자가 결제를 취소한 경우 이동할 페이지
failureURL결제 실패 시 이동할 페이지
pendingURL결제 대기 상태일 경우 이동할 페이지
errorURL시스템 오류 발생 시 이동할 페이지
resultCallback결제 완료 후 Worldpay가 결과를 전달하는 콜백 함수

Store Iframe 적용 가이드 #


<head>
    <!-- Worldpay Embedded Integration JS (반드시 필요) -->
    <script src="https://payments.worldpay.com/resources/hpp/integrationshpp-embedded-integration-library.js"></script>
</head>

<body>
<!-- Worldpay HPP iframe이 삽입될 영역 -->
<div id="custom-html"></div>
<script type="text/javascript">
    /*
     * Store는 아래 항목들에 실제 값을 넣어 사용하면 됩니다.
     *  - url: 우리 API 등을 통해 받은 Worldpay HPP URL(Session URL)
     *  - language / country: 옵션 (언어/국가)
     *  - successURL / cancelURL / failureURL / errorURL: Store 페이지 이동 경로
     */

    var customOptions = {
        url: "Worldpay HPP URL정보",
        //ex : "https://payments-test.worldpay.com/app/hpp/integration/wpg/corporate?OrderKey=LGETEST%5ETESTPG_20260324164825&Ticket=00177477050780902KHAr6MXsykGwgb8tRugqcw7lHa-FWuEDCxQWUd&source=https%3A%2F%2Fsecure-test.worldpay.com"
        type: "iframe",
        inject: "onload",
        target: "custom-html",
        accessibility: true,
        debug: false,
        language: "MY",
        country: "GB",
        successURL: "성공URL (Store 전용)",
        //ex : "https://qtkic-gpay.ebp.lgsmartplatform.com/ebp2/jsp/test_result_worldpay_s.jsp"
        cancelURL: "취소URL (Store 전용)",
        //ex : "https://qtkic-gpay.ebp.lgsmartplatform.com/ebp2/jsp/test_result_worldpay_f.jsp"
        failureURL: "실패URL (Store 전용)",
        //ex : "https://qtkic-gpay.ebp.lgsmartplatform.com/ebp2/jsp/test_result_worldpay_err.jsp"
        pendingURL: "대기URL (Store 전용)",
        //ex : "https://qtkic-gpay.ebp.lgsmartplatform.com/ebp2/jsp/test_result_worldpay_p.jsp"
        errorURL: "에러URL (Store 전용)",
        //ex : "https://qtkic-gpay.ebp.lgsmartplatform.com/ebp2/jsp/test_result_worldpay_err.jsp"
        
        // 결제 완료 후 콜백
        resultCallback: function (responseData) {
            var redirectUrl;
            var status = responseData.order.status;
            switch (status) {
                case "success":
                    redirectUrl = "성공URL (Store 전용)";
                    //ex : "https://qtkic-gpay.ebp.lgsmartplatform.com/ebp2/jsp/test_result_worldpay_s.jsp"
                    break;
                case "error":
                    redirectUrl = "에러URL (Store 전용)";
                    //ex : "https://qtkic-gpay.ebp.lgsmartplatform.com/ebp2/jsp/test_result_worldpay_err.jsp"
                    break;
                default:
                    redirectUrl = "실패URL (Store 전용)";
                    //ex : "https://qtkic-gpay.ebp.lgsmartplatform.com/ebp2/jsp/test_result_worldpay_err.jsp"
            }
            window.location = redirectUrl;
        }
    };

    var libraryObject = new WPCL.Library();

    libraryObject.setup(customOptions);
</script>

</body>

</html>
Last updated: 2026-04-24 07:45:12 © 2026 LG Electronics Inc. All rights reserved.