@bootpay/client-js 5.0.0-beta.9 → 5.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -1
- package/dist/index.es.js +4933 -6288
- package/dist/index.umd.js +2 -1
- package/dist/package.json.d.ts +4 -2
- package/dist/src/bootpay-widget.d.ts +6 -2
- package/dist/src/bootpay.d.ts +2 -1
- package/dist/src/lib/bootpay-widget.d.ts +14 -1
- package/dist/src/lib/bootpay.d.ts +1 -1
- package/dist/src/lib/event/widget.d.ts +17 -0
- package/dist/src/lib/template/modal.d.ts +16 -0
- package/dist/src/lib/template/payment.d.ts +3 -3
- package/dist/src/lib/template/widget.d.ts +6 -1
- package/dist/src/models/bootpay-interface.d.ts +18 -0
- package/dist/src/models/bootpay-widget-interface.d.ts +6 -0
- package/dist/src/support/environment.d.ts +2 -1
- package/dist/src/support/event-logger.d.ts +42 -0
- package/dist/src/support/logger.d.ts +0 -42
- package/dist/src/support/widget-store.d.ts +4 -0
- package/package.json +4 -2
- package/vite.config.ts +11 -7
- package/dist/style.css +0 -1
- package/dist/test/payment/css/style.css +0 -52
- package/dist/test/payment/ehowlsla.html +0 -92
- package/dist/test/payment/iframe.html +0 -71
- package/dist/test/payment/index.html +0 -285
- package/dist/test/payment/js/development-ehowlsla.js +0 -286
- package/dist/test/payment/js/development.js +0 -971
- package/dist/test/payment/js/widget.js +0 -369
- package/dist/test/payment/widget.html +0 -164
- /package/{tsconfig.build.json → tsconfig.json.esnext} +0 -0
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<title>결제 테스트 페이지 (개발서버)</title>
|
|
5
|
-
<meta charset="utf-8"/>
|
|
6
|
-
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"/>
|
|
7
|
-
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
|
8
|
-
<meta name="apple-mobile-web-app-status-bar-style" content="none"/>
|
|
9
|
-
<!-- <script src="https://develop.yetham.com/js/common/common.min.js?ver=54210618"></script>-->
|
|
10
|
-
<!-- <script src="https://develop.yetham.com/js/common/wrest.min.js?ver=54210618"></script>-->
|
|
11
|
-
<!-- <script language="javascript" type="text/javascript" src="https://stdpay.inicis.com/stdjs/INIStdPay.js" charset="UTF-8"></script>-->
|
|
12
|
-
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
|
|
13
|
-
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
|
14
|
-
<link rel="stylesheet" media="all" href="./css/style.css"/>
|
|
15
|
-
<script src="https://develop.yetham.com/js/jquery-1.12.4.min.js?ver=54210618"></script>
|
|
16
|
-
<!-- <script src="https://develop.yetham.com/js/jquery-migrate-1.4.1.min.js?ver=54210618"></script>-->
|
|
17
|
-
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>-->
|
|
18
|
-
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
|
|
19
|
-
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
|
|
20
|
-
crossorigin="anonymous"></script>
|
|
21
|
-
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
|
|
22
|
-
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
|
|
23
|
-
crossorigin="anonymous"></script>
|
|
24
|
-
<script src="../../bootpay.js" type="application/javascript"></script>
|
|
25
|
-
<script src="../../bootpay-sdk.js" type="application/javascript"></script>
|
|
26
|
-
<!-- <script src="https://js.bootpay.co.kr/bootpay-4.2.2.min.js" type="application/javascript"></script>-->
|
|
27
|
-
<script src="https://d-cdn.bootapi.com/bootpay-latest.js" type="application/javascript"></script>
|
|
28
|
-
<!-- <script src="https://cdn.bootpay.co.kr/js/bootpay-3.3.6.min.js" type="application/javascript"></script>-->
|
|
29
|
-
<script src="./js/development.js" type="application/javascript"></script>
|
|
30
|
-
<meta content="width=device-width, initial-scale=1, user-scalable=no" name="viewport">
|
|
31
|
-
<!-- Google Tag Manager -->
|
|
32
|
-
<script>(function (w, d, s, l, i) {
|
|
33
|
-
w[l] = w[l] || []
|
|
34
|
-
w[l].push({
|
|
35
|
-
'gtm.start':
|
|
36
|
-
new Date().getTime(), event: 'gtm.js'
|
|
37
|
-
})
|
|
38
|
-
var f = d.getElementsByTagName(s)[0],
|
|
39
|
-
j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''
|
|
40
|
-
j.async = true
|
|
41
|
-
j.src =
|
|
42
|
-
'https://www.googletagmanager.com/gtm.js?id=' + i + dl
|
|
43
|
-
f.parentNode.insertBefore(j, f)
|
|
44
|
-
})(window, document, 'script', 'dataLayer', 'GTM-NQKMWJD')</script>
|
|
45
|
-
<!-- End Google Tag Manager -->
|
|
46
|
-
</head>
|
|
47
|
-
<body>
|
|
48
|
-
<div class="container">
|
|
49
|
-
<div class="card">
|
|
50
|
-
<div class="card-header">
|
|
51
|
-
<h5 class="card-title">테스트 결제 페이지입니다</h5>
|
|
52
|
-
<h6 class="card-subtitle mb-2 text-muted">테스트 서버로 결제 요청을 할 수 있습니다.</h6>
|
|
53
|
-
</div>
|
|
54
|
-
<div class="card-body">
|
|
55
|
-
<div class="form-group">
|
|
56
|
-
<label>모드</label>
|
|
57
|
-
<select class="form-control" name="env" onChange="changeMode()">
|
|
58
|
-
<option value="development">개발모드</option>
|
|
59
|
-
<option value="stage">스테이지모드</option>
|
|
60
|
-
<option value="production">실서버모드</option>
|
|
61
|
-
</select>
|
|
62
|
-
</div>
|
|
63
|
-
<div class="form-group">
|
|
64
|
-
<label>SDK Version</label>
|
|
65
|
-
<select class="form-control" name="version" onChange="saveData()">
|
|
66
|
-
<option value="v1">v1</option>
|
|
67
|
-
<option value="v2">v2</option>
|
|
68
|
-
</select>
|
|
69
|
-
</div>
|
|
70
|
-
<div class="form-group">
|
|
71
|
-
<label>통화(Currency)</label>
|
|
72
|
-
<select class="form-control" name="unit" onChange="saveData()">
|
|
73
|
-
<option value="krw">원화</option>
|
|
74
|
-
<option value="usd">달러</option>
|
|
75
|
-
</select>
|
|
76
|
-
</div>
|
|
77
|
-
<div class="form-group">
|
|
78
|
-
<label>Application ID</label>
|
|
79
|
-
<input class="form-control" value="" name="applicationId"/>
|
|
80
|
-
</div>
|
|
81
|
-
<div class="form-group">
|
|
82
|
-
<label>결제할 금액</label>
|
|
83
|
-
<input class="form-control" value="1000" name="amount"/>
|
|
84
|
-
</div>
|
|
85
|
-
<div class="form-group">
|
|
86
|
-
<label>면세로 설정할 금액</label>
|
|
87
|
-
<input class="form-control" value="0" name="taxFreeAmount"/>
|
|
88
|
-
</div>
|
|
89
|
-
<div class="form-group">
|
|
90
|
-
<label>PG</label>
|
|
91
|
-
<select class="form-control" name="pg_krw" onChange="saveData()">
|
|
92
|
-
<option value="이니시스">이니시스</option>
|
|
93
|
-
<option value="다날">다날</option>
|
|
94
|
-
<option value="케이씨피">KCP</option>
|
|
95
|
-
<option value="나이스페이">나이스페이</option>
|
|
96
|
-
<option value="토스">토스</option>
|
|
97
|
-
<option value="페이레터">페이레터</option>
|
|
98
|
-
<option value="페이앱">페이앱</option>
|
|
99
|
-
<option value="이지페이">이지페이</option>
|
|
100
|
-
<option value="유디페이">유디페이</option>
|
|
101
|
-
<option value="페이코">페이코</option>
|
|
102
|
-
<option value="카카오">카카오</option>
|
|
103
|
-
<option value="세틀뱅크">세틀뱅크</option>
|
|
104
|
-
<option value="티페이">티페이</option>
|
|
105
|
-
<option value="웰컴페이먼츠">웰컴페이먼츠</option>
|
|
106
|
-
<option value="스마트로">스마트로</option>
|
|
107
|
-
<option value="키움페이">키움페이</option>
|
|
108
|
-
<option value="모빌리언스">모빌리언스</option>
|
|
109
|
-
</select>
|
|
110
|
-
<select class="form-control" name="pg_usd" onChange="saveData()" style="display: none;">
|
|
111
|
-
<option value="페이팔">페이팔</option>
|
|
112
|
-
<option value="스트라이프">스트라이프</option>
|
|
113
|
-
<option value="페이먼트월">페이먼트월</option>
|
|
114
|
-
</select>
|
|
115
|
-
</div>
|
|
116
|
-
<div class="form-group">
|
|
117
|
-
<label>결제수단</label>
|
|
118
|
-
<select class="form-control" name="method" onChange="saveData()">
|
|
119
|
-
<option value="카드">카드결제</option>
|
|
120
|
-
<option value="휴대폰">휴대폰</option>
|
|
121
|
-
<option value="계좌이체">계좌이체</option>
|
|
122
|
-
<option value="가상계좌">가상계좌</option>
|
|
123
|
-
<option value="카카오페이">카카오페이</option>
|
|
124
|
-
<option value="네이버페이">네이버페이</option>
|
|
125
|
-
<option value="페이코">페이코</option>
|
|
126
|
-
<option value="간편">간편결제</option>
|
|
127
|
-
<option value="카드자동">카드정기결제(창결제)</option>
|
|
128
|
-
<option value="간편자동">간편자동결제(창결제)</option>
|
|
129
|
-
<option value="디지털카드">디지털카드</option>
|
|
130
|
-
<option value="디지털계좌이체">디지털계좌이체</option>
|
|
131
|
-
<option value="디지털가상계좌">디지털가상계좌</option>
|
|
132
|
-
<option value="디지털카드자동">디지털카드자동</option>
|
|
133
|
-
<option value="본인인증">본인인증</option>
|
|
134
|
-
<option value="카드수기">카드수기결제</option>
|
|
135
|
-
<option value="카드간편">카드간편</option>
|
|
136
|
-
<option value="카드간편자동">카드간편자동</option>
|
|
137
|
-
<option value="토스">토스</option>
|
|
138
|
-
<option value="페이먼트월">페이먼트월</option>
|
|
139
|
-
<option value="삼성페이">삼성페이</option>
|
|
140
|
-
<option value="애플페이">애플페이</option>
|
|
141
|
-
<option value="컬쳐랜드">컬쳐랜드상품권</option>
|
|
142
|
-
<option value="해피머니">해피머니상품권</option>
|
|
143
|
-
<option value="도서문화">도서문화상품권</option>
|
|
144
|
-
<option value="게임문화">게임문화상품권</option>
|
|
145
|
-
</select>
|
|
146
|
-
</div>
|
|
147
|
-
<div class="form-group">
|
|
148
|
-
<label>결제진행방법</label>
|
|
149
|
-
<select class="form-control" name="open_type" onChange="saveData()">
|
|
150
|
-
<option value="iframe">iFrame</option>
|
|
151
|
-
<option value="popup">팝업</option>
|
|
152
|
-
<option value="redirect">Redirect</option>
|
|
153
|
-
</select>
|
|
154
|
-
</div>
|
|
155
|
-
<div class="form-group">
|
|
156
|
-
<label>에스크로</label>
|
|
157
|
-
<select class="form-control" name="escrow" onChange="saveData()">
|
|
158
|
-
<option value="0">일반</option>
|
|
159
|
-
<option value="1">에스크로</option>
|
|
160
|
-
</select>
|
|
161
|
-
</div>
|
|
162
|
-
<div class="form-group">
|
|
163
|
-
<label>간편결제방식</label>
|
|
164
|
-
<select class="form-control" name="easy_payment_method" onChange="saveData()">
|
|
165
|
-
<option value="카드">카드</option>
|
|
166
|
-
<option value="포인트">포인트</option>
|
|
167
|
-
</select>
|
|
168
|
-
</div>
|
|
169
|
-
<div class="form-group">
|
|
170
|
-
<label>가상계좌모의통지</label>
|
|
171
|
-
<select class="form-control" name="test_deposit" onChange="saveData()">
|
|
172
|
-
<option value="0">통지안함</option>
|
|
173
|
-
<option value="1">통지함</option>
|
|
174
|
-
</select>
|
|
175
|
-
</div>
|
|
176
|
-
<div class="form-group">
|
|
177
|
-
<label>승인분리</label>
|
|
178
|
-
<select class="form-control" name="separately_confirmed" onChange="saveData()">
|
|
179
|
-
<option value="0">승인후리턴</option>
|
|
180
|
-
<option value="1">승인분리</option>
|
|
181
|
-
</select>
|
|
182
|
-
</div>
|
|
183
|
-
<div class="form-group">
|
|
184
|
-
<label>구매자 전화번호</label>
|
|
185
|
-
<input class="form-control" value="" name="phone"/>
|
|
186
|
-
</div>
|
|
187
|
-
<div class="form-group">
|
|
188
|
-
<label>User Token</label>
|
|
189
|
-
<div class="row">
|
|
190
|
-
<div class="col-9">
|
|
191
|
-
<input class="form-control" value="" name="userToken"/>
|
|
192
|
-
</div>
|
|
193
|
-
<div class="col-3">
|
|
194
|
-
<button class="btn btn-primary" onClick="getUserToken()">GetToken</button>
|
|
195
|
-
</div>
|
|
196
|
-
</div>
|
|
197
|
-
</div>
|
|
198
|
-
<div class="form-group">
|
|
199
|
-
<label>REST API 결제 URL</label>
|
|
200
|
-
<div class="row">
|
|
201
|
-
<div class="col-9">
|
|
202
|
-
<input class="form-control" value="" name="url"/>
|
|
203
|
-
</div>
|
|
204
|
-
<div class="col-3">
|
|
205
|
-
<button class="btn btn-primary" onClick="getPaymentUrl()">GetURL</button>
|
|
206
|
-
</div>
|
|
207
|
-
</div>
|
|
208
|
-
</div>
|
|
209
|
-
<div class="accordion" id="accordionButton">
|
|
210
|
-
<div class="card">
|
|
211
|
-
<div class="card-header" id="collapsePayment">
|
|
212
|
-
<h2 class="mb-0">
|
|
213
|
-
<button class="btn btn-link btn-block text-left" data-toggle="collapse"
|
|
214
|
-
data-target="paymentOne" aria-expanded="true" aria-controls="collapsePayment">
|
|
215
|
-
결제하기 Section
|
|
216
|
-
</button>
|
|
217
|
-
</h2>
|
|
218
|
-
</div>
|
|
219
|
-
<div id="paymentOne" class="collapse show" aria-labelledby="collapsePayment"
|
|
220
|
-
data-parent="#accordionButton">
|
|
221
|
-
<div class="card-body">
|
|
222
|
-
<div class="group mt-3">
|
|
223
|
-
<button class="btn btn-primary" onclick="requestMethod()">
|
|
224
|
-
결제하기
|
|
225
|
-
</button>
|
|
226
|
-
<button class="btn btn-warning ml-2" onClick="requestTotalPayment()">
|
|
227
|
-
통합결제창
|
|
228
|
-
</button>
|
|
229
|
-
<button class="btn btn-danger ml-2" onClick="requestPaymentToUrl()">
|
|
230
|
-
URL결제
|
|
231
|
-
</button>
|
|
232
|
-
</div>
|
|
233
|
-
</div>
|
|
234
|
-
</div>
|
|
235
|
-
</div>
|
|
236
|
-
<div class="card">
|
|
237
|
-
<div class="card-header" id="collapseSDK">
|
|
238
|
-
<h2 class="mb-0">
|
|
239
|
-
<button class="btn btn-link btn-block text-left" data-toggle="collapse" data-target="sdkOne"
|
|
240
|
-
aria-expanded="true" aria-controls="collapseSDK">
|
|
241
|
-
SDK Section
|
|
242
|
-
</button>
|
|
243
|
-
</h2>
|
|
244
|
-
</div>
|
|
245
|
-
<div id="sdkOne" class="collapse show" aria-labelledby="collapseSDK" data-parent="#accordionButton">
|
|
246
|
-
<div class="card-body">
|
|
247
|
-
<div class="btn-group mt-3 w-100" role="group">
|
|
248
|
-
<button class="btn btn-secondary" onClick="requestPasswordToken()">
|
|
249
|
-
비밀번호토큰
|
|
250
|
-
</button>
|
|
251
|
-
<button class="btn btn-secondary" onClick="requestChangePassword()">
|
|
252
|
-
비밀번호변경토큰
|
|
253
|
-
</button>
|
|
254
|
-
<button class="btn btn-secondary" onClick="requestAddCard()">
|
|
255
|
-
카드등록
|
|
256
|
-
</button>
|
|
257
|
-
</div>
|
|
258
|
-
<div class="btn-group mt-3 w-100" role="group">
|
|
259
|
-
<button class="btn btn-secondary" onClick="wallets()">
|
|
260
|
-
간편결제정보
|
|
261
|
-
</button>
|
|
262
|
-
<button class="btn btn-secondary" onClick="addBiometricData()">
|
|
263
|
-
생체인식정보등록
|
|
264
|
-
</button>
|
|
265
|
-
<button class="btn btn-secondary" onClick="destroyBiometricData()">
|
|
266
|
-
생체인식정보삭제
|
|
267
|
-
</button>
|
|
268
|
-
</div>
|
|
269
|
-
<div class="btn-group mt-3 w-100" role="group">
|
|
270
|
-
<button class="btn btn-secondary" onClick="requestWalletPayment()">
|
|
271
|
-
간편결제하기
|
|
272
|
-
</button>
|
|
273
|
-
<button class="btn btn-secondary" onClick="destroyWallet()">
|
|
274
|
-
간편결제삭제
|
|
275
|
-
</button>
|
|
276
|
-
</div>
|
|
277
|
-
</div>
|
|
278
|
-
</div>
|
|
279
|
-
</div>
|
|
280
|
-
</div>
|
|
281
|
-
</div>
|
|
282
|
-
</div>
|
|
283
|
-
</div>
|
|
284
|
-
</body>
|
|
285
|
-
</html>
|
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
document.addEventListener('DOMContentLoaded', function () {
|
|
2
|
-
document.getElementsByName('pg')[0].value = '케이씨피'
|
|
3
|
-
document.getElementsByName('method')[0].value = '카드'
|
|
4
|
-
})
|
|
5
|
-
|
|
6
|
-
document.addEventListener('bootpayclose', function (e) {
|
|
7
|
-
console.log(e)
|
|
8
|
-
console.log("결제창 닫힘")
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
function requestMethod() {
|
|
12
|
-
Bootpay.setEnvironmentMode('development', 'ehowlsla.bootpay.co.kr')
|
|
13
|
-
Bootpay.setLogLevel(1)
|
|
14
|
-
if (['카드정기결제', '정기결제'].indexOf(document.getElementsByName('method')[0].value) > -1) {
|
|
15
|
-
requestSubscribe()
|
|
16
|
-
} else if (['auth', '본인인증'].indexOf(document.getElementsByName('method')[0].value) > -1) {
|
|
17
|
-
requestAuthentication()
|
|
18
|
-
} else {
|
|
19
|
-
requestPayment()
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function requestPayment() {
|
|
24
|
-
Bootpay.requestPayment({
|
|
25
|
-
application_id: '5b9f51264457636ab9a07cdb',
|
|
26
|
-
pg: document.getElementsByName('pg')[0].value,
|
|
27
|
-
method: document.getElementsByName('method')[0].value,
|
|
28
|
-
price: document.getElementsByName('amount')[0].value,
|
|
29
|
-
tax_free: document.getElementsByName('taxFreeAmount')[0].value,
|
|
30
|
-
order_name: '결제 테스트 스웻터',
|
|
31
|
-
order_id: (new Date()).getTime(),
|
|
32
|
-
metadata: {
|
|
33
|
-
test: 1
|
|
34
|
-
},
|
|
35
|
-
user: {
|
|
36
|
-
username: '부트페이',
|
|
37
|
-
phone: '01000000000',
|
|
38
|
-
// email: 'aqure84@naver.com'
|
|
39
|
-
},
|
|
40
|
-
items: [
|
|
41
|
-
{
|
|
42
|
-
id: 'test',
|
|
43
|
-
name: '아이템1',
|
|
44
|
-
qty: 2,
|
|
45
|
-
price: parseInt(document.getElementsByName('amount')[0].value) / 2
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
extra: {
|
|
49
|
-
// popup: true,
|
|
50
|
-
use_order_id: true,
|
|
51
|
-
// escrow: true,
|
|
52
|
-
// offer_period: '20210401-20210501',
|
|
53
|
-
display_cash_receipt: false,
|
|
54
|
-
separately_confirmed: true,
|
|
55
|
-
card_quota: '0,2,3,4',
|
|
56
|
-
display_success_result: true,
|
|
57
|
-
display_error_result: true
|
|
58
|
-
// confirm_only_rest_api: true,
|
|
59
|
-
// popup: true
|
|
60
|
-
// confirm_message: '승인중이지롱'
|
|
61
|
-
// theme: '#000000',
|
|
62
|
-
// deposit_expiration: '2021-03-09 00:00:00'
|
|
63
|
-
}
|
|
64
|
-
}).then(
|
|
65
|
-
function (response) {
|
|
66
|
-
console.log(response)
|
|
67
|
-
if (response.event === 'confirm') {
|
|
68
|
-
if (window.confirm('승인할까요?')) {
|
|
69
|
-
Bootpay.confirm().then(
|
|
70
|
-
function (response) {
|
|
71
|
-
console.log(response)
|
|
72
|
-
if (response.event === 'issued') {
|
|
73
|
-
alert('가상계좌가 발급되었습니다.')
|
|
74
|
-
} else {
|
|
75
|
-
alert('승인 분리 결제가 완료되었습니다.')
|
|
76
|
-
}
|
|
77
|
-
}, function (error) {
|
|
78
|
-
switch (error.event) {
|
|
79
|
-
case 'error':
|
|
80
|
-
console.log(error)
|
|
81
|
-
alert("에러: " + error.message)
|
|
82
|
-
break;
|
|
83
|
-
case 'cancel':
|
|
84
|
-
console.log(error)
|
|
85
|
-
alert("닫힘: " + error.message)
|
|
86
|
-
break;
|
|
87
|
-
default:
|
|
88
|
-
throw error
|
|
89
|
-
// alert(error.message)
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
)
|
|
93
|
-
} else {
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
} else {
|
|
97
|
-
if (response.event === 'issued') {
|
|
98
|
-
alert('가상계좌가 발급되었습니다.')
|
|
99
|
-
} else {
|
|
100
|
-
alert('결제가 완료되었습니다.')
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}, function (error) {
|
|
104
|
-
switch (error.event) {
|
|
105
|
-
case 'error':
|
|
106
|
-
console.log(error)
|
|
107
|
-
alert("에러: " + error.message)
|
|
108
|
-
break;
|
|
109
|
-
case 'cancel':
|
|
110
|
-
console.log(error)
|
|
111
|
-
alert("닫힘: " + error.message)
|
|
112
|
-
break;
|
|
113
|
-
default:
|
|
114
|
-
throw error
|
|
115
|
-
// alert(error.message)
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
)
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function requestTotalPayment() {
|
|
122
|
-
Bootpay.setEnvironmentMode('development')
|
|
123
|
-
Bootpay.setLogLevel(1)
|
|
124
|
-
Bootpay.requestPayment({
|
|
125
|
-
application_id: '59a568d3e13f3336c21bf707',
|
|
126
|
-
price: document.getElementsByName('amount')[0].value,
|
|
127
|
-
tax_free: document.getElementsByName('taxFreeAmount')[0].value,
|
|
128
|
-
order_name: '결제 테스트 스웻터',
|
|
129
|
-
order_id: (new Date()).getTime(),
|
|
130
|
-
user: {
|
|
131
|
-
username: '강훈',
|
|
132
|
-
phone: '01095735114',
|
|
133
|
-
email: 'test@test.com'
|
|
134
|
-
},
|
|
135
|
-
items: [
|
|
136
|
-
{
|
|
137
|
-
id: 'test',
|
|
138
|
-
name: '아이템1',
|
|
139
|
-
qty: 2,
|
|
140
|
-
price: parseInt(document.getElementsByName('amount')[0].value) / 2
|
|
141
|
-
}
|
|
142
|
-
],
|
|
143
|
-
extra: {
|
|
144
|
-
use_order_id: true,
|
|
145
|
-
// offer_period: '20210401-20210501',
|
|
146
|
-
display_cash_receipt: false,
|
|
147
|
-
separately_confirmed: true,
|
|
148
|
-
// confirm_message: '승인중이지롱'
|
|
149
|
-
// theme: '#000000',
|
|
150
|
-
// deposit_expiration: '2021-03-09 00:00:00'
|
|
151
|
-
}
|
|
152
|
-
}).then(
|
|
153
|
-
function (response) {
|
|
154
|
-
console.log(response)
|
|
155
|
-
if (response.event === 'confirm') {
|
|
156
|
-
if (confirm('승인할까요?')) {
|
|
157
|
-
Bootpay.confirm().then(
|
|
158
|
-
function (response) {
|
|
159
|
-
console.log(response)
|
|
160
|
-
if (response.event === 'issued') {
|
|
161
|
-
alert('가상계좌가 발급되었습니다.')
|
|
162
|
-
} else {
|
|
163
|
-
alert('승인 분리 결제가 완료되었습니다.')
|
|
164
|
-
}
|
|
165
|
-
}, function (error) {
|
|
166
|
-
switch (error.event) {
|
|
167
|
-
case 'error':
|
|
168
|
-
console.log(error)
|
|
169
|
-
alert("에러: " + error.message)
|
|
170
|
-
break;
|
|
171
|
-
case 'cancel':
|
|
172
|
-
console.log(error)
|
|
173
|
-
alert("닫힘: " + error.message)
|
|
174
|
-
break;
|
|
175
|
-
default:
|
|
176
|
-
throw error
|
|
177
|
-
// alert(error.message)
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
)
|
|
181
|
-
} else {
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
} else {
|
|
185
|
-
if (response.event === 'issued') {
|
|
186
|
-
alert('가상계좌가 발급되었습니다.')
|
|
187
|
-
} else {
|
|
188
|
-
alert('결제가 완료되었습니다.')
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}, function (error) {
|
|
192
|
-
switch (error.event) {
|
|
193
|
-
case 'error':
|
|
194
|
-
console.log(error)
|
|
195
|
-
alert("에러: " + error.message)
|
|
196
|
-
break;
|
|
197
|
-
case 'cancel':
|
|
198
|
-
console.log(error)
|
|
199
|
-
alert("닫힘: " + error.message)
|
|
200
|
-
break;
|
|
201
|
-
default:
|
|
202
|
-
throw error
|
|
203
|
-
// alert(error.message)
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
)
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
function requestSubscribe() {
|
|
210
|
-
Bootpay.requestSubscription({
|
|
211
|
-
application_id: '59a568d3e13f3336c21bf707',
|
|
212
|
-
pg: document.getElementsByName('pg')[0].value,
|
|
213
|
-
method: document.getElementsByName('method')[0].value,
|
|
214
|
-
price: document.getElementsByName('amount')[0].value,
|
|
215
|
-
tax_free: document.getElementsByName('taxFreeAmount')[0].value,
|
|
216
|
-
order_name: '정기결제 입니다',
|
|
217
|
-
subscription_id: (new Date()).getTime(),
|
|
218
|
-
user: {
|
|
219
|
-
username: '강훈',
|
|
220
|
-
phone: '01095735114'
|
|
221
|
-
},
|
|
222
|
-
extra: {
|
|
223
|
-
use_order_id: true,
|
|
224
|
-
// offer_period: '20210401-20210501',
|
|
225
|
-
display_cash_receipt: false,
|
|
226
|
-
// subscribe_test_payment: true
|
|
227
|
-
// theme: '#000000',
|
|
228
|
-
// deposit_expiration: '2021-03-09 00:00:00'
|
|
229
|
-
}
|
|
230
|
-
}).then(
|
|
231
|
-
function (response) {
|
|
232
|
-
if (response.event === 'confirm') {
|
|
233
|
-
Bootpay.confirm().then(
|
|
234
|
-
function (response) {
|
|
235
|
-
if (response.event === 'done') {
|
|
236
|
-
alert('빌링키 발급 및 결제가 완료되었습니다.')
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
)
|
|
240
|
-
} else if (response.event === 'done') {
|
|
241
|
-
alert('빌링키 발급이 완료되었습니다.')
|
|
242
|
-
}
|
|
243
|
-
},
|
|
244
|
-
function (error) {
|
|
245
|
-
console.log(error.message)
|
|
246
|
-
}
|
|
247
|
-
)
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
function requestAuthentication() {
|
|
251
|
-
Bootpay.requestAuthentication({
|
|
252
|
-
application_id: '59a568d3e13f3336c21bf707',
|
|
253
|
-
pg: document.getElementsByName('pg')[0].value,
|
|
254
|
-
order_name: '본인인증 입니다',
|
|
255
|
-
authentication_id: (new Date()).getTime(),
|
|
256
|
-
user: {
|
|
257
|
-
username: '강훈',
|
|
258
|
-
phone: '01095735114'
|
|
259
|
-
},
|
|
260
|
-
extra: {
|
|
261
|
-
use_order_id: true,
|
|
262
|
-
// offer_period: '20210401-20210501',
|
|
263
|
-
display_cash_receipt: false,
|
|
264
|
-
// subscribe_test_payment: true
|
|
265
|
-
// theme: '#000000',
|
|
266
|
-
// deposit_expiration: '2021-03-09 00:00:00'
|
|
267
|
-
}
|
|
268
|
-
}).then(
|
|
269
|
-
function (response) {
|
|
270
|
-
if (response.event === 'confirm') {
|
|
271
|
-
Bootpay.confirm().then(
|
|
272
|
-
function (response) {
|
|
273
|
-
if (response.event === 'done') {
|
|
274
|
-
alert('본인인증이 완료되었습니다.')
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
)
|
|
278
|
-
} else if (response.event === 'done') {
|
|
279
|
-
alert('본인인증이 완료되었습니다.')
|
|
280
|
-
}
|
|
281
|
-
},
|
|
282
|
-
function (error) {
|
|
283
|
-
console.log(error.message)
|
|
284
|
-
}
|
|
285
|
-
)
|
|
286
|
-
}
|