PageSourceSearch

https://order.kyobobook.co.kr/assets/js/cart/methods/setSettlementMethodBenefits.js

js kyobobook.co.kr collected 2026-09-24 08:32:48 UTC 1,389 bytes, 47 lines download raw bytes

1/**
2 * 결제수단 혜택 조회 후 렌더링
3 * @returns {Promise<boolean>} 실패 시 false 반환
4 */
5export async function setSettlementMethodBenefits() {
6    // API 호출: GET → order.utils.asyncManual
7    const callApi = '/api/comm/ord/v2/settlement-method-benefit';
8    const opts   = { method: 'GET' };
9
10    const chkData = await order.utils.asyncManual(callApi, opts);
11
12    // 샘플과 동일하게 resultCode 체크
13    if (chkData.resultCode !== 'S200') {
14        await KbbJS.ui.alert({
15            title: '구매불가 알림',
16            text:  chkData.resultMessage,
17            confirmButtonText: '확인',
18        });
19        return false;
20    }
21
22    // 데이터 파싱
23    const list = chkData.data?.list;
24    if (!Array.isArray(list) || list.length === 0) {
25        return true;
26    }
27
28    // 줄바꿈 처리
29    list.forEach(item => {
30        if (item.eventContents) {
31            item.eventContents = item.eventContents.replace(/\n/g, '<br>');
32        }
33    });
34
35    // 템플릿 렌더링
36    const template = $.templates('#orderSettlementBenefitList');
37    const rendered = template.render(list);
38    $('[data-order-settlementBenefitArea]').append(rendered);
39    $('#orderSettlementBenefits').show();
40
41    // 폴드 박스 설정
42    if (typeof setFoldBox === 'function') {
43        setFoldBox('[data-order-settlementBenefitArea]');
44    }
45
46    return true;
47}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.