@bootpay/client-js 5.0.0-beta.8 → 5.0.0-beta.9
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/dist/index.es.js +8458 -0
- package/dist/index.umd.js +1 -0
- package/dist/package.json.d.ts +53 -0
- package/dist/src/bootpay-es5.d.ts +0 -2
- package/dist/src/lib/template/payment.d.ts +0 -1
- package/dist/src/support/alfred-progress/index.d.ts +0 -1
- package/dist/src/support/bootpay-manager.d.ts +2 -2
- package/dist/src/test/index.d.ts +1 -0
- package/dist/src/test/moduleRequire.d.ts +1 -0
- package/dist/style.css +1 -0
- package/dist/test/payment/css/style.css +52 -0
- package/dist/test/payment/ehowlsla.html +92 -0
- package/dist/test/payment/iframe.html +71 -0
- package/dist/test/payment/index.html +285 -0
- package/dist/test/payment/js/development-ehowlsla.js +286 -0
- package/dist/test/payment/js/development.js +971 -0
- package/dist/test/payment/js/widget.js +369 -0
- package/dist/test/payment/widget.html +164 -0
- package/dist/vite.config.d.ts +2 -0
- package/package.json +7 -4
- package/{tsconfig-esnext.json → tsconfig.build.json} +8 -6
- package/vite.config.ts +23 -0
- package/dist/package.json +0 -47
- package/dist/src/bootpay-environment.js +0 -5
- package/dist/src/bootpay-environment.js.map +0 -1
- package/dist/src/bootpay-es5.js +0 -10
- package/dist/src/bootpay-es5.js.map +0 -1
- package/dist/src/bootpay-sdk.js +0 -243
- package/dist/src/bootpay-sdk.js.map +0 -1
- package/dist/src/bootpay-widget.js +0 -83
- package/dist/src/bootpay-widget.js.map +0 -1
- package/dist/src/bootpay.js +0 -319
- package/dist/src/bootpay.js.map +0 -1
- package/dist/src/index.js +0 -33
- package/dist/src/index.js.map +0 -1
- package/dist/src/lib/analytics.js +0 -137
- package/dist/src/lib/analytics.js.map +0 -1
- package/dist/src/lib/bootpay-widget.js +0 -171
- package/dist/src/lib/bootpay-widget.js.map +0 -1
- package/dist/src/lib/bootpay.js +0 -496
- package/dist/src/lib/bootpay.js.map +0 -1
- package/dist/src/lib/event/payment.js +0 -215
- package/dist/src/lib/event/payment.js.map +0 -1
- package/dist/src/lib/event/polling.js +0 -42
- package/dist/src/lib/event/polling.js.map +0 -1
- package/dist/src/lib/event/user-token.js +0 -51
- package/dist/src/lib/event/user-token.js.map +0 -1
- package/dist/src/lib/event/widget.js +0 -90
- package/dist/src/lib/event/widget.js.map +0 -1
- package/dist/src/lib/locale/message.js +0 -110
- package/dist/src/lib/locale/message.js.map +0 -1
- package/dist/src/lib/template/oopay.js +0 -66
- package/dist/src/lib/template/oopay.js.map +0 -1
- package/dist/src/lib/template/payment.js +0 -488
- package/dist/src/lib/template/payment.js.map +0 -1
- package/dist/src/lib/template/user-token.js +0 -281
- package/dist/src/lib/template/user-token.js.map +0 -1
- package/dist/src/lib/template/widget.js +0 -78
- package/dist/src/lib/template/widget.js.map +0 -1
- package/dist/src/models/bootpay-interface.js +0 -3
- package/dist/src/models/bootpay-interface.js.map +0 -1
- package/dist/src/models/bootpay-sdk-interface.js +0 -3
- package/dist/src/models/bootpay-sdk-interface.js.map +0 -1
- package/dist/src/models/bootpay-widget-interface.js +0 -3
- package/dist/src/models/bootpay-widget-interface.js.map +0 -1
- package/dist/src/models/const.js +0 -15
- package/dist/src/models/const.js.map +0 -1
- package/dist/src/support/alfred-progress/index.js +0 -64
- package/dist/src/support/alfred-progress/index.js.map +0 -1
- package/dist/src/support/bootpay-manager.js +0 -39
- package/dist/src/support/bootpay-manager.js.map +0 -1
- package/dist/src/support/environment.js +0 -89
- package/dist/src/support/environment.js.map +0 -1
- package/dist/src/support/event.js +0 -133
- package/dist/src/support/event.js.map +0 -1
- package/dist/src/support/logger.js +0 -130
- package/dist/src/support/logger.js.map +0 -1
- package/dist/src/support/resource.js +0 -125
- package/dist/src/support/resource.js.map +0 -1
- package/dist/src/support/storage.js +0 -191
- package/dist/src/support/storage.js.map +0 -1
- package/dist/src/support/template-manager.js +0 -47
- package/dist/src/support/template-manager.js.map +0 -1
- package/dist/src/support/util.js +0 -36
- package/dist/src/support/util.js.map +0 -1
- package/dist/src/support/widget-store.js +0 -73
- package/dist/src/support/widget-store.js.map +0 -1
|
@@ -0,0 +1,971 @@
|
|
|
1
|
+
const pgs = {
|
|
2
|
+
KRW: [
|
|
3
|
+
'이니시스', '다날', '케이씨피', '나이스페이', '토스', '페이레터', '페이앱', '이지페이', '페이코', '카카오', '세틀뱅크', '티페이',
|
|
4
|
+
'웰컴페이먼츠', '스마트로'
|
|
5
|
+
],
|
|
6
|
+
USD: [
|
|
7
|
+
'페이팔', '스트라이프'
|
|
8
|
+
]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const LEGACY_MAPPER_PG = {
|
|
12
|
+
'이니시스': 'inicis',
|
|
13
|
+
'다날': 'danal',
|
|
14
|
+
'케이씨피': 'kcp',
|
|
15
|
+
'나이스페이': 'nicepay',
|
|
16
|
+
'토스': 'toss',
|
|
17
|
+
'페이레터': 'payletter',
|
|
18
|
+
'페이앱': 'payapp',
|
|
19
|
+
'이지페이': 'easypay',
|
|
20
|
+
'페이코': 'payco',
|
|
21
|
+
'카카오': 'kakao',
|
|
22
|
+
'세틀뱅크': 'settlebank',
|
|
23
|
+
'티페이': 'tpay',
|
|
24
|
+
'웰컴페이먼츠': 'welcome',
|
|
25
|
+
'스마트로': 'smartro'
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const LEGACY_MAPPER_METHOD = {
|
|
29
|
+
'카드': 'card',
|
|
30
|
+
'휴대폰': 'phone',
|
|
31
|
+
'계좌이체': 'bank',
|
|
32
|
+
'가상계좌': 'vbank',
|
|
33
|
+
'카카오페이': 'kakaopay',
|
|
34
|
+
'네이버페이': 'npay',
|
|
35
|
+
'페이코': 'payco',
|
|
36
|
+
'간편': 'easy',
|
|
37
|
+
'카드자동': 'card_rebill',
|
|
38
|
+
'간편자동': 'easy_rebill',
|
|
39
|
+
'본인인증': 'auth',
|
|
40
|
+
'카드수기': 'card_auth',
|
|
41
|
+
'디지털카드': 'digital_card',
|
|
42
|
+
'디지털카드자동': 'digital_card_rebill'
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let Bootpay = window.Bootpay
|
|
46
|
+
|
|
47
|
+
document.addEventListener('DOMContentLoaded', function () {
|
|
48
|
+
setSaveData()
|
|
49
|
+
// getUserToken()
|
|
50
|
+
getPaymentUrl()
|
|
51
|
+
Bootpay.setVersion('1.0.0-test.1', 'TEST SDK')
|
|
52
|
+
Bootpay.setLogLevel(1)
|
|
53
|
+
// Bootpay.setLocale('en')
|
|
54
|
+
// Bootpay.setEnvironmentMode(document.getElementsByName('env')[0].value, 'dev-api.bootpay.co.kr/v3')
|
|
55
|
+
Bootpay.setEnvironmentMode(document.getElementsByName('env')[0].value)
|
|
56
|
+
Bootpay.setApplicationId(document.getElementsByName('applicationId')[0].value)
|
|
57
|
+
Bootpay.login({
|
|
58
|
+
id: 'gosomi'
|
|
59
|
+
}).then(
|
|
60
|
+
function () {
|
|
61
|
+
Bootpay.send()
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
// document.getElementsByName('pg')[0].value = '나이스페이'
|
|
65
|
+
// document.getElementsByName('method')[0].value = '네이버페이'
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
document.addEventListener('bootpayclose', function (e) {
|
|
69
|
+
console.log(e)
|
|
70
|
+
console.log("결제창 닫힘")
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
function getCacheMode() {
|
|
74
|
+
try {
|
|
75
|
+
const mode = window.localStorage.getItem('__mode')
|
|
76
|
+
return mode === undefined || mode === null ? 'development' : mode
|
|
77
|
+
} catch (e) {
|
|
78
|
+
return 'development'
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function saveData() {
|
|
83
|
+
let data = getCache()
|
|
84
|
+
const unit = document.getElementsByName('unit')[0].value
|
|
85
|
+
if (data.unit !== unit) {
|
|
86
|
+
document.getElementsByName('applicationId')[0].value = data.application_id[unit]
|
|
87
|
+
}
|
|
88
|
+
data.unit = unit
|
|
89
|
+
data.pg_krw = document.getElementsByName('pg_krw')[0].value
|
|
90
|
+
data.pg_usd = document.getElementsByName('pg_usd')[0].value
|
|
91
|
+
data.method = document.getElementsByName('method')[0].value
|
|
92
|
+
data.price = document.getElementsByName('amount')[0].value
|
|
93
|
+
data.tax_free = document.getElementsByName('taxFreeAmount')[0].value
|
|
94
|
+
data.env = document.getElementsByName('env')[0].value
|
|
95
|
+
data.application_id[data.unit] = document.getElementsByName('applicationId')[0].value
|
|
96
|
+
data.open_type = document.getElementsByName('open_type')[0].value
|
|
97
|
+
data.escrow = document.getElementsByName('escrow')[0].value
|
|
98
|
+
data.test_deposit = document.getElementsByName('test_deposit')[0].value
|
|
99
|
+
data.phone = document.getElementsByName('phone')[0].value
|
|
100
|
+
data.separately_confirmed = document.getElementsByName('separately_confirmed')[0].value
|
|
101
|
+
data.version = document.getElementsByName('version')[0].value
|
|
102
|
+
data.easy_payment_method = document.getElementsByName('easy_payment_method')[0].value
|
|
103
|
+
|
|
104
|
+
window.localStorage.setItem('__mode', document.getElementsByName('env')[0].value)
|
|
105
|
+
window.localStorage.setItem('__cache_' + document.getElementsByName('env')[0].value, JSON.stringify(data))
|
|
106
|
+
changePG(data['pg_' + data.unit])
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function changePG(selectPg) {
|
|
110
|
+
document.getElementsByName('pg_krw')[0].style.setProperty('display', 'none')
|
|
111
|
+
document.getElementsByName('pg_usd')[0].style.setProperty('display', 'none')
|
|
112
|
+
document.getElementsByName('pg_' + document.getElementsByName('unit')[0].value)[0].style.setProperty('display', 'block')
|
|
113
|
+
if (selectPg !== undefined) {
|
|
114
|
+
document.getElementsByName('pg_' + document.getElementsByName('unit')[0].value)[0].value = selectPg
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function changeMode() {
|
|
119
|
+
window.localStorage.setItem('__mode', document.getElementsByName('env')[0].value)
|
|
120
|
+
setSaveData()
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function getCache() {
|
|
124
|
+
try {
|
|
125
|
+
const data = JSON.parse(window.localStorage.getItem('__cache_' + document.getElementsByName('env')[0].value))
|
|
126
|
+
return data === undefined || data === null ? {
|
|
127
|
+
pg_krw: '나이스페이',
|
|
128
|
+
method: '카드',
|
|
129
|
+
price: 1000,
|
|
130
|
+
tax_free: 0,
|
|
131
|
+
application_id: {
|
|
132
|
+
krw: getDefaultApplicationId(document.getElementsByName('env')[0].value),
|
|
133
|
+
usd: getDefaultApplicationId(document.getElementsByName('env')[0].value),
|
|
134
|
+
},
|
|
135
|
+
open_type: 'iframe',
|
|
136
|
+
unit: 'krw',
|
|
137
|
+
escrow: '0',
|
|
138
|
+
separately_confirmed: '0',
|
|
139
|
+
phone: '01000000000',
|
|
140
|
+
test_deposit: '0',
|
|
141
|
+
version: 'v2'
|
|
142
|
+
} : data
|
|
143
|
+
} catch (e) {
|
|
144
|
+
return {
|
|
145
|
+
pg_krw: '나이스페이',
|
|
146
|
+
method: '카드',
|
|
147
|
+
price: 1000,
|
|
148
|
+
tax_free: 0,
|
|
149
|
+
application_id: {
|
|
150
|
+
krw: getDefaultApplicationId(document.getElementsByName('env')[0].value),
|
|
151
|
+
usd: getDefaultApplicationId(document.getElementsByName('env')[0].value),
|
|
152
|
+
},
|
|
153
|
+
open_type: 'iframe',
|
|
154
|
+
unit: 'krw',
|
|
155
|
+
escrow: '0',
|
|
156
|
+
phone: '01000000000',
|
|
157
|
+
separately_confirmed: '0',
|
|
158
|
+
test_deposit: '0',
|
|
159
|
+
version: 'v2'
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function getDefaultApplicationId(env) {
|
|
165
|
+
switch (env) {
|
|
166
|
+
case 'stage':
|
|
167
|
+
case 'production':
|
|
168
|
+
return '59a7a368396fa64fc5d4a7db'
|
|
169
|
+
default:
|
|
170
|
+
return '59a568d3e13f3336c21bf707'
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function setSaveData() {
|
|
175
|
+
document.getElementsByName('env')[0].value = getCacheMode()
|
|
176
|
+
const cache = getCache()
|
|
177
|
+
document.getElementsByName('unit')[0].value = cache.unit
|
|
178
|
+
document.getElementsByName('pg_krw')[0].value = cache.pg_krw
|
|
179
|
+
document.getElementsByName('pg_usd')[0].value = cache.pg_usd
|
|
180
|
+
document.getElementsByName('method')[0].value = cache.method
|
|
181
|
+
document.getElementsByName('amount')[0].value = cache.price
|
|
182
|
+
document.getElementsByName('taxFreeAmount')[0].value = cache.tax_free
|
|
183
|
+
document.getElementsByName('applicationId')[0].value = cache.application_id[cache.unit]
|
|
184
|
+
document.getElementsByName('open_type')[0].value = cache.open_type
|
|
185
|
+
document.getElementsByName('escrow')[0].value = cache.escrow
|
|
186
|
+
document.getElementsByName('test_deposit')[0].value = cache.test_deposit
|
|
187
|
+
document.getElementsByName('phone')[0].value = cache.phone
|
|
188
|
+
document.getElementsByName('separately_confirmed')[0].value = cache.separately_confirmed
|
|
189
|
+
document.getElementsByName('version')[0].value = cache.version
|
|
190
|
+
document.getElementsByName('easy_payment_method')[0].value = cache.easy_payment_method
|
|
191
|
+
changePG()
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function requestMethod() {
|
|
195
|
+
if (document.getElementsByName('version')[0].value === 'v2') {
|
|
196
|
+
try {
|
|
197
|
+
saveData()
|
|
198
|
+
Bootpay.setEnvironmentMode(document.getElementsByName('env')[0].value)
|
|
199
|
+
Bootpay.setLogLevel(1)
|
|
200
|
+
} catch (e) {
|
|
201
|
+
|
|
202
|
+
}
|
|
203
|
+
if (['카드자동', '정기결제', '간편자동', '디지털카드자동', '카드간편자동'].indexOf(document.getElementsByName('method')[0].value) > -1) {
|
|
204
|
+
requestSubscribe()
|
|
205
|
+
} else if (['auth', '본인인증'].indexOf(document.getElementsByName('method')[0].value) > -1) {
|
|
206
|
+
requestAuthentication()
|
|
207
|
+
} else {
|
|
208
|
+
requestPaymentV2()
|
|
209
|
+
}
|
|
210
|
+
} else {
|
|
211
|
+
try {
|
|
212
|
+
saveData()
|
|
213
|
+
window.BootPay.setMode(document.getElementsByName('env')[0].value)
|
|
214
|
+
} catch (e) {
|
|
215
|
+
}
|
|
216
|
+
requestPaymentV1()
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function getUserToken() {
|
|
221
|
+
if (document.getElementsByName('env')[0].value === 'development') {
|
|
222
|
+
$.ajax({
|
|
223
|
+
type: 'POST',
|
|
224
|
+
url: 'https://admin-dev.bootpay.co.kr/test/user_token',
|
|
225
|
+
dataType: 'json',
|
|
226
|
+
success: function (data) {
|
|
227
|
+
document.getElementsByName('userToken')[0].value = data.user_token
|
|
228
|
+
},
|
|
229
|
+
error: function (data) {
|
|
230
|
+
|
|
231
|
+
}
|
|
232
|
+
})
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function getPaymentUrl() {
|
|
237
|
+
if (document.getElementsByName('env')[0].value === 'development') {
|
|
238
|
+
$.ajax({
|
|
239
|
+
type: 'POST',
|
|
240
|
+
url: 'https://admin-dev.bootpay.co.kr/test/request/payment',
|
|
241
|
+
dataType: 'json',
|
|
242
|
+
success: function (data) {
|
|
243
|
+
document.getElementsByName('url')[0].value = data.url
|
|
244
|
+
},
|
|
245
|
+
error: function (data) {
|
|
246
|
+
|
|
247
|
+
}
|
|
248
|
+
})
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function requestPaymentV1() {
|
|
253
|
+
let price = 0
|
|
254
|
+
if (['카드자동', '정기결제', '간편자동', '디지털카드자동'].indexOf(document.getElementsByName('method')[0].value) > -1) {
|
|
255
|
+
} else if (['auth', '본인인증'].indexOf(document.getElementsByName('method')[0].value) > -1) {
|
|
256
|
+
} else {
|
|
257
|
+
price = document.getElementsByName('amount')[0].value
|
|
258
|
+
}
|
|
259
|
+
const unit = document.getElementsByName('unit')[0].value
|
|
260
|
+
const pg = LEGACY_MAPPER_PG[document.getElementsByName('pg_' + unit)[0].value]
|
|
261
|
+
const method = LEGACY_MAPPER_METHOD[document.getElementsByName('method')[0].value]
|
|
262
|
+
window.BootPay.request({
|
|
263
|
+
application_id: document.getElementsByName('applicationId')[0].value,
|
|
264
|
+
pg: pg,
|
|
265
|
+
method: method,
|
|
266
|
+
price: price,
|
|
267
|
+
tax_free: document.getElementsByName('taxFreeAmount')[0].value,
|
|
268
|
+
name: '(부트페이 봇) 결제상태 체크 봇',
|
|
269
|
+
order_id: (new Date()).getTime(),
|
|
270
|
+
show_agree_window: false,
|
|
271
|
+
user_info: {
|
|
272
|
+
username: '부트페이',
|
|
273
|
+
phone: document.getElementsByName('phone')[0].value,
|
|
274
|
+
email: 'test@bootpay.co.kr'
|
|
275
|
+
},
|
|
276
|
+
items: [
|
|
277
|
+
{
|
|
278
|
+
unique: 'test',
|
|
279
|
+
item_name: '테스트 아이템',
|
|
280
|
+
price: price,
|
|
281
|
+
qty: 1
|
|
282
|
+
}
|
|
283
|
+
],
|
|
284
|
+
extra: {
|
|
285
|
+
popup: document.getElementsByName('open_type')[0].value === 'popup' ? 1 : 0,
|
|
286
|
+
subscribe_test_payment: true,
|
|
287
|
+
vbank_result: true
|
|
288
|
+
}
|
|
289
|
+
}).error(function (data) {
|
|
290
|
+
var msg = "결제 에러입니다.: " + JSON.stringify(data)
|
|
291
|
+
alert(msg)
|
|
292
|
+
}).cancel(function (data) {
|
|
293
|
+
var msg = "결제 취소입니다.: " + JSON.stringify(data)
|
|
294
|
+
alert(msg)
|
|
295
|
+
}).confirm(function (data) {
|
|
296
|
+
if (confirm('승인할까요?')) {
|
|
297
|
+
window.BootPay.transactionConfirm(data)
|
|
298
|
+
} else {
|
|
299
|
+
alert('결제승인이 거절되었습니다')
|
|
300
|
+
}
|
|
301
|
+
}).done(function (data) {
|
|
302
|
+
console.log(data)
|
|
303
|
+
alert('결제가 완료되었습니다')
|
|
304
|
+
})
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function requestPaymentToUrl(url) {
|
|
308
|
+
Bootpay.requestPaymentUrl({
|
|
309
|
+
application_id: document.getElementsByName('applicationId')[0].value,
|
|
310
|
+
url: document.getElementsByName('url')[0].value
|
|
311
|
+
}).then(
|
|
312
|
+
function (response) {
|
|
313
|
+
console.log(response)
|
|
314
|
+
if (response.event === 'confirm') {
|
|
315
|
+
if (window.confirm('승인할까요?')) {
|
|
316
|
+
Bootpay.confirm().then(
|
|
317
|
+
function (response) {
|
|
318
|
+
console.log(response)
|
|
319
|
+
if (response.event === 'issued') {
|
|
320
|
+
alert('가상계좌가 발급되었습니다.')
|
|
321
|
+
// console.log('가상계좌 발급 끝')
|
|
322
|
+
} else {
|
|
323
|
+
alert('승인 분리 결제가 완료되었습니다.')
|
|
324
|
+
}
|
|
325
|
+
}, function (error) {
|
|
326
|
+
switch (error.event) {
|
|
327
|
+
case 'error':
|
|
328
|
+
console.log(error)
|
|
329
|
+
alert("에러: " + error.message)
|
|
330
|
+
break
|
|
331
|
+
case 'cancel':
|
|
332
|
+
console.log(error)
|
|
333
|
+
alert("닫힘: " + error.message)
|
|
334
|
+
break
|
|
335
|
+
default:
|
|
336
|
+
throw error
|
|
337
|
+
// alert(error.message)
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
)
|
|
341
|
+
} else {
|
|
342
|
+
|
|
343
|
+
}
|
|
344
|
+
} else {
|
|
345
|
+
if (response.event === 'issued') {
|
|
346
|
+
alert('가상계좌가 발급되었습니다.')
|
|
347
|
+
// console.log('가상계좌 발급 끝')
|
|
348
|
+
} else {
|
|
349
|
+
alert('결제가 완료되었습니다.')
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}, function (error) {
|
|
353
|
+
switch (error.event) {
|
|
354
|
+
case 'error':
|
|
355
|
+
console.log(error)
|
|
356
|
+
alert("에러: " + error.message)
|
|
357
|
+
break
|
|
358
|
+
case 'cancel':
|
|
359
|
+
console.log(error)
|
|
360
|
+
alert("닫힘: " + error.message)
|
|
361
|
+
break
|
|
362
|
+
default:
|
|
363
|
+
throw error
|
|
364
|
+
// alert(error.message)
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
)
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
function requestPaymentV2() {
|
|
371
|
+
const unit = document.getElementsByName('unit')[0].value
|
|
372
|
+
console.log(document.getElementsByName('separately_confirmed')[0].value === '1')
|
|
373
|
+
Bootpay.setLocale('ko')
|
|
374
|
+
Bootpay.requestPayment({
|
|
375
|
+
application_id: document.getElementsByName('applicationId')[0].value,
|
|
376
|
+
pg: document.getElementsByName('pg_' + unit)[0].value,
|
|
377
|
+
method: document.getElementsByName('method')[0].value,
|
|
378
|
+
price: document.getElementsByName('amount')[0].value,
|
|
379
|
+
tax_free: document.getElementsByName('taxFreeAmount')[0].value,
|
|
380
|
+
order_name: '(테스트)결제상태 체크 봇',
|
|
381
|
+
user_token: document.getElementsByName('userToken')[0].value,
|
|
382
|
+
order_id: String((new Date()).getTime()),
|
|
383
|
+
currency: unit.toUpperCase(),
|
|
384
|
+
metadata: {
|
|
385
|
+
test: 1
|
|
386
|
+
},
|
|
387
|
+
user: {
|
|
388
|
+
id: 'bootpay',
|
|
389
|
+
username: '부트페이',
|
|
390
|
+
phone: document.getElementsByName('phone')[0].value,
|
|
391
|
+
email: 'test@bootpay.co.kr'
|
|
392
|
+
},
|
|
393
|
+
items: [
|
|
394
|
+
{
|
|
395
|
+
id: 'test',
|
|
396
|
+
name: '아이템1',
|
|
397
|
+
qty: 2,
|
|
398
|
+
price: parseFloat(document.getElementsByName('amount')[0].value) / 2
|
|
399
|
+
}
|
|
400
|
+
],
|
|
401
|
+
extra: {
|
|
402
|
+
// use_compound_tax: true,
|
|
403
|
+
open_type: document.getElementsByName('open_type')[0].value,
|
|
404
|
+
// identity_no: '3292000492',
|
|
405
|
+
easy_payment_method: document.getElementsByName('easy_payment_method')[0].value,
|
|
406
|
+
// show_close_button: true,
|
|
407
|
+
// enable_easy_payments: ['페이코', '카카오페이'],
|
|
408
|
+
// except_card_companies: ['국민', '신한'],
|
|
409
|
+
// enable_card_companies: ['하나'],
|
|
410
|
+
// browser_open_type: [
|
|
411
|
+
// {
|
|
412
|
+
// browser: 'instagram',
|
|
413
|
+
// open_type: 'redirect'
|
|
414
|
+
// },
|
|
415
|
+
// {
|
|
416
|
+
// browser: 'mobile_chrome',
|
|
417
|
+
// open_type: 'popup'
|
|
418
|
+
// },
|
|
419
|
+
// {
|
|
420
|
+
// browser: 'mobile_safari',
|
|
421
|
+
// open_type: 'iframe'
|
|
422
|
+
// }
|
|
423
|
+
// ],
|
|
424
|
+
// popup: true,
|
|
425
|
+
// use_order_id: false,
|
|
426
|
+
// redirect_url: 'https://admin-dev.bootpay.co.kr/test/confirm',
|
|
427
|
+
// minimum_price_limit: false,
|
|
428
|
+
// escrow: true,
|
|
429
|
+
// offer_period: '20210401-20210501',
|
|
430
|
+
display_cash_receipt: false,
|
|
431
|
+
separately_confirmed: document.getElementsByName('separately_confirmed')[0].value === '1',
|
|
432
|
+
// card_quota: '0,2,3,4,5,6,7,8,9,10,11,12',
|
|
433
|
+
// direct_card_company: '국민',
|
|
434
|
+
// direct_card_quota: '00',
|
|
435
|
+
locale: 'en',
|
|
436
|
+
display_success_result: true,
|
|
437
|
+
// use_easypay_point: true,
|
|
438
|
+
display_error_result: true,
|
|
439
|
+
escrow: document.getElementsByName('escrow')[0].value === '1',
|
|
440
|
+
card_easy_option: {
|
|
441
|
+
title: '부트페이 카드웰렛'
|
|
442
|
+
},
|
|
443
|
+
select_phone_carrier: 'SKT',
|
|
444
|
+
// automatic_tax: true,
|
|
445
|
+
// timeout: 1,
|
|
446
|
+
// app_scheme: 'bootpay',
|
|
447
|
+
// common_event_webhook: true,
|
|
448
|
+
// confirm_only_rest_api: true,
|
|
449
|
+
// popup: true
|
|
450
|
+
// confirm_message: '승인중이지롱'
|
|
451
|
+
// theme: '#000000',
|
|
452
|
+
// locale: 'en',
|
|
453
|
+
test_deposit: document.getElementsByName('test_deposit')[0].value === '1',
|
|
454
|
+
// deposit_expiration: '2023-05-30 01:25:00'
|
|
455
|
+
}
|
|
456
|
+
}).then(
|
|
457
|
+
function (response) {
|
|
458
|
+
console.log(response)
|
|
459
|
+
if (response.event === 'confirm') {
|
|
460
|
+
if (window.confirm('승인할까요?')) {
|
|
461
|
+
Bootpay.confirm().then(
|
|
462
|
+
function (response) {
|
|
463
|
+
console.log(response)
|
|
464
|
+
if (response.event === 'issued') {
|
|
465
|
+
alert('가상계좌가 발급되었습니다.')
|
|
466
|
+
// console.log('가상계좌 발급 끝')
|
|
467
|
+
} else {
|
|
468
|
+
alert('승인 분리 결제가 완료되었습니다.')
|
|
469
|
+
}
|
|
470
|
+
}, function (error) {
|
|
471
|
+
switch (error.event) {
|
|
472
|
+
case 'error':
|
|
473
|
+
console.log(error)
|
|
474
|
+
alert("에러: " + error.message)
|
|
475
|
+
break
|
|
476
|
+
case 'cancel':
|
|
477
|
+
console.log(error)
|
|
478
|
+
alert("닫힘: " + error.message)
|
|
479
|
+
break
|
|
480
|
+
default:
|
|
481
|
+
throw error
|
|
482
|
+
// alert(error.message)
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
)
|
|
486
|
+
} else {
|
|
487
|
+
|
|
488
|
+
}
|
|
489
|
+
} else {
|
|
490
|
+
if (response.event === 'issued') {
|
|
491
|
+
alert('가상계좌가 발급되었습니다.')
|
|
492
|
+
// console.log('가상계좌 발급 끝')
|
|
493
|
+
} else {
|
|
494
|
+
alert('결제가 완료되었습니다.')
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}, function (error) {
|
|
498
|
+
switch (error.event) {
|
|
499
|
+
case 'error':
|
|
500
|
+
console.log(error)
|
|
501
|
+
alert("에러: " + error.message)
|
|
502
|
+
break
|
|
503
|
+
case 'cancel':
|
|
504
|
+
console.log(error)
|
|
505
|
+
alert("닫힘: " + error.message)
|
|
506
|
+
break
|
|
507
|
+
default:
|
|
508
|
+
throw error
|
|
509
|
+
// alert(error.message)
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
)
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
function requestTotalPayment() {
|
|
516
|
+
if (document.getElementsByName('version')[0].value === 'v2') {
|
|
517
|
+
try {
|
|
518
|
+
saveData()
|
|
519
|
+
Bootpay.setEnvironmentMode(document.getElementsByName('env')[0].value)
|
|
520
|
+
// Bootpay.setLogLevel(1)
|
|
521
|
+
} catch (e) {
|
|
522
|
+
|
|
523
|
+
}
|
|
524
|
+
requestTotalPaymentV2()
|
|
525
|
+
} else {
|
|
526
|
+
try {
|
|
527
|
+
saveData()
|
|
528
|
+
window.BootPay.setMode(document.getElementsByName('env')[0].value)
|
|
529
|
+
} catch (e) {
|
|
530
|
+
}
|
|
531
|
+
requestTotalPaymentV1()
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
function requestTotalPaymentV1() {
|
|
536
|
+
window.BootPay.request({
|
|
537
|
+
application_id: document.getElementsByName('applicationId')[0].value,
|
|
538
|
+
// pg: 'welcome',
|
|
539
|
+
// method: method,
|
|
540
|
+
price: document.getElementsByName('amount')[0].value,
|
|
541
|
+
tax_free: document.getElementsByName('taxFreeAmount')[0].value,
|
|
542
|
+
name: '(부트페이 봇) 결제상태 체크 봇',
|
|
543
|
+
order_id: (new Date()).getTime(),
|
|
544
|
+
show_agree_window: false,
|
|
545
|
+
user_info: {
|
|
546
|
+
username: '부트페이',
|
|
547
|
+
phone: document.getElementsByName('phone')[0].value,
|
|
548
|
+
email: 'test@bootpay.co.kr'
|
|
549
|
+
},
|
|
550
|
+
extra: {
|
|
551
|
+
popup: document.getElementsByName('open_type')[0].value === 'popup' ? 1 : 0,
|
|
552
|
+
subscribe_test_payment: true,
|
|
553
|
+
}
|
|
554
|
+
}).error(function (data) {
|
|
555
|
+
var msg = "결제 에러입니다.: " + JSON.stringify(data)
|
|
556
|
+
alert(msg)
|
|
557
|
+
}).cancel(function (data) {
|
|
558
|
+
var msg = "결제 취소입니다.: " + JSON.stringify(data)
|
|
559
|
+
alert(msg)
|
|
560
|
+
}).confirm(function (data) {
|
|
561
|
+
if (confirm('승인할까요?')) {
|
|
562
|
+
window.BootPay.transactionConfirm(data)
|
|
563
|
+
} else {
|
|
564
|
+
alert('결제승인이 거절되었습니다')
|
|
565
|
+
}
|
|
566
|
+
}).done(function (data) {
|
|
567
|
+
console.log(data)
|
|
568
|
+
alert('결제가 완료되었습니다')
|
|
569
|
+
})
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
function requestTotalPaymentV2() {
|
|
573
|
+
// Bootpay.setLogLevel(1)
|
|
574
|
+
Bootpay.requestPayment({
|
|
575
|
+
application_id: document.getElementsByName('applicationId')[0].value,
|
|
576
|
+
pg: '나이스페이',
|
|
577
|
+
price: document.getElementsByName('amount')[0].value,
|
|
578
|
+
tax_free: document.getElementsByName('taxFreeAmount')[0].value,
|
|
579
|
+
order_name: '결제 테스트 스웻터',
|
|
580
|
+
order_id: (new Date()).getTime(),
|
|
581
|
+
user: {
|
|
582
|
+
// username: '강훈',
|
|
583
|
+
// phone: '01095735114',
|
|
584
|
+
// email: 'test@test.com'
|
|
585
|
+
},
|
|
586
|
+
items: [
|
|
587
|
+
{
|
|
588
|
+
id: 'test',
|
|
589
|
+
name: '아이템1',
|
|
590
|
+
qty: 2,
|
|
591
|
+
price: parseFloat(document.getElementsByName('amount')[0].value) / 2
|
|
592
|
+
}
|
|
593
|
+
],
|
|
594
|
+
user_token: document.getElementsByName('userToken')[0].value,
|
|
595
|
+
extra: {
|
|
596
|
+
open_type: document.getElementsByName('open_type')[0].value,
|
|
597
|
+
// open_type: 'redirect',
|
|
598
|
+
// use_order_id: true,
|
|
599
|
+
// offer_period: '20210401-20210501',
|
|
600
|
+
display_cash_receipt: false,
|
|
601
|
+
separately_confirmed: false,
|
|
602
|
+
// timeout: 1000,
|
|
603
|
+
redirect_url: 'https://admin-dev.bootpay.co.kr/test/confirm',
|
|
604
|
+
// common_event_webhook: true,
|
|
605
|
+
// confirm_message: '승인중이지롱'
|
|
606
|
+
// theme: '#000000',
|
|
607
|
+
// deposit_expiration: '2023-06-09 01:25:00'
|
|
608
|
+
}
|
|
609
|
+
}).then(
|
|
610
|
+
function (response) {
|
|
611
|
+
console.log(response)
|
|
612
|
+
if (response.event === 'confirm') {
|
|
613
|
+
if (confirm('승인할까요?')) {
|
|
614
|
+
Bootpay.confirm().then(
|
|
615
|
+
function (response) {
|
|
616
|
+
console.log(response)
|
|
617
|
+
if (response.event === 'issued') {
|
|
618
|
+
console.log('발급 계상계좌')
|
|
619
|
+
alert('가상계좌가 발급되었습니다.')
|
|
620
|
+
} else {
|
|
621
|
+
alert('승인 분리 결제가 완료되었습니다.')
|
|
622
|
+
}
|
|
623
|
+
}, function (error) {
|
|
624
|
+
switch (error.event) {
|
|
625
|
+
case 'error':
|
|
626
|
+
console.log(error)
|
|
627
|
+
alert("에러: " + error.message)
|
|
628
|
+
break
|
|
629
|
+
case 'cancel':
|
|
630
|
+
console.log(error)
|
|
631
|
+
alert("닫힘: " + error.message)
|
|
632
|
+
break
|
|
633
|
+
default:
|
|
634
|
+
throw error
|
|
635
|
+
// alert(error.message)
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
)
|
|
639
|
+
} else {
|
|
640
|
+
|
|
641
|
+
}
|
|
642
|
+
} else {
|
|
643
|
+
if (response.event === 'issued') {
|
|
644
|
+
alert('가상계좌가 발급되었습니다.')
|
|
645
|
+
} else {
|
|
646
|
+
alert('결제가 완료되었습니다.')
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}, function (error) {
|
|
650
|
+
switch (error.event) {
|
|
651
|
+
case 'error':
|
|
652
|
+
console.log(error)
|
|
653
|
+
alert("에러: " + error.message)
|
|
654
|
+
break
|
|
655
|
+
case 'cancel':
|
|
656
|
+
console.log(error)
|
|
657
|
+
alert("닫힘: " + error.message)
|
|
658
|
+
break
|
|
659
|
+
default:
|
|
660
|
+
throw error
|
|
661
|
+
// alert(error.message)
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
)
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
function requestSubscribe() {
|
|
668
|
+
const unit = document.getElementsByName('unit')[0].value
|
|
669
|
+
Bootpay.requestSubscription({
|
|
670
|
+
application_id: document.getElementsByName('applicationId')[0].value,
|
|
671
|
+
pg: document.getElementsByName('pg_' + unit)[0].value,
|
|
672
|
+
method: document.getElementsByName('method')[0].value,
|
|
673
|
+
price: document.getElementsByName('amount')[0].value,
|
|
674
|
+
tax_free: document.getElementsByName('taxFreeAmount')[0].value,
|
|
675
|
+
order_name: '정기결제 입니다',
|
|
676
|
+
subscription_id: (new Date()).getTime(),
|
|
677
|
+
user_token: document.getElementsByName('userToken')[0].value,
|
|
678
|
+
metadata: {
|
|
679
|
+
test: '123',
|
|
680
|
+
domain: 'bootpay.co.kr'
|
|
681
|
+
},
|
|
682
|
+
user: {
|
|
683
|
+
id: 'bootpay2'
|
|
684
|
+
// username: '강훈',
|
|
685
|
+
// phone: '01095735114'
|
|
686
|
+
},
|
|
687
|
+
extra: {
|
|
688
|
+
open_type: document.getElementsByName('open_type')[0].value,
|
|
689
|
+
// use_order_id: true,
|
|
690
|
+
redirect_url: 'https://dev-api.bootpay.co.kr/callback',
|
|
691
|
+
// offer_period: '20210401-20210501',
|
|
692
|
+
// display_cash_receipt: false,
|
|
693
|
+
subscription_comment: '매월 1,000원이 결제됩니다',
|
|
694
|
+
subscribe_test_payment: true,
|
|
695
|
+
// use_bootpay_inapp_sdk: true
|
|
696
|
+
// theme: '#000000',
|
|
697
|
+
// deposit_expiration: '2021-03-09 00:00:00'
|
|
698
|
+
}
|
|
699
|
+
}).then(
|
|
700
|
+
function (response) {
|
|
701
|
+
if (response.event === 'confirm') {
|
|
702
|
+
Bootpay.confirm().then(
|
|
703
|
+
function (response) {
|
|
704
|
+
if (response.event === 'done') {
|
|
705
|
+
alert('빌링키 발급 및 결제가 완료되었습니다.')
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
)
|
|
709
|
+
} else if (response.event === 'done') {
|
|
710
|
+
alert('빌링키 발급이 완료되었습니다.')
|
|
711
|
+
}
|
|
712
|
+
},
|
|
713
|
+
function (error) {
|
|
714
|
+
console.log(error.message)
|
|
715
|
+
}
|
|
716
|
+
)
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
function requestAuthentication() {
|
|
720
|
+
const unit = document.getElementsByName('unit')[0].value
|
|
721
|
+
Bootpay.requestAuthentication({
|
|
722
|
+
application_id: document.getElementsByName('applicationId')[0].value,
|
|
723
|
+
pg: document.getElementsByName('pg_' + unit)[0].value,
|
|
724
|
+
order_name: '본인인증 입니다',
|
|
725
|
+
authentication_id: (new Date()).getTime(),
|
|
726
|
+
user: {
|
|
727
|
+
// username: '강훈',
|
|
728
|
+
// phone: '01095735114'
|
|
729
|
+
},
|
|
730
|
+
extra: {
|
|
731
|
+
open_type: document.getElementsByName('open_type')[0].value,
|
|
732
|
+
// use_order_id: true,
|
|
733
|
+
// age_limit: 50,
|
|
734
|
+
// carrier: 'SKT',
|
|
735
|
+
// foreigner: true,
|
|
736
|
+
// birthday: '19841025',
|
|
737
|
+
// gender: 1,
|
|
738
|
+
// offer_period: '20210401-20210501',
|
|
739
|
+
display_cash_receipt: false,
|
|
740
|
+
show_close_button: true,
|
|
741
|
+
// close_button_color: '#000000'
|
|
742
|
+
// subscribe_test_payment: true
|
|
743
|
+
// theme: '#000000',
|
|
744
|
+
// deposit_expiration: '2021-03-09 00:00:00'
|
|
745
|
+
redirect_url: 'https://dev-api.bootpay.co.kr/callback'
|
|
746
|
+
}
|
|
747
|
+
}).then(
|
|
748
|
+
function (response) {
|
|
749
|
+
if (response.event === 'confirm') {
|
|
750
|
+
Bootpay.confirm().then(
|
|
751
|
+
function (response) {
|
|
752
|
+
if (response.event === 'done') {
|
|
753
|
+
alert('본인인증이 완료되었습니다.')
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
)
|
|
757
|
+
} else if (response.event === 'done') {
|
|
758
|
+
alert('본인인증이 완료되었습니다.')
|
|
759
|
+
}
|
|
760
|
+
},
|
|
761
|
+
function (error) {
|
|
762
|
+
console.log(error.message)
|
|
763
|
+
}
|
|
764
|
+
)
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
function requestPasswordToken() {
|
|
768
|
+
BootpaySDK.setEnvironmentMode(
|
|
769
|
+
document.getElementsByName('env')[0].value,
|
|
770
|
+
'gosomi.bootpay.co.kr'
|
|
771
|
+
)
|
|
772
|
+
BootpaySDK.setLogLevel(1)
|
|
773
|
+
BootpaySDK.setUUID('test-uuid')
|
|
774
|
+
BootpaySDK.requestPasswordToken(document.getElementsByName('userToken')[0].value).then(
|
|
775
|
+
function (token) {
|
|
776
|
+
console.log(token)
|
|
777
|
+
}, function (error) {
|
|
778
|
+
console.log(error)
|
|
779
|
+
}
|
|
780
|
+
)
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
function requestChangePassword() {
|
|
784
|
+
BootpaySDK.setEnvironmentMode(
|
|
785
|
+
document.getElementsByName('env')[0].value,
|
|
786
|
+
'gosomi.bootpay.co.kr'
|
|
787
|
+
)
|
|
788
|
+
BootpaySDK.setEnvironmentMode(document.getElementsByName('env')[0].value)
|
|
789
|
+
BootpaySDK.setLogLevel(1)
|
|
790
|
+
BootpaySDK.setUUID('test-uuid')
|
|
791
|
+
BootpaySDK.requestChangePassword(document.getElementsByName('userToken')[0].value).then(
|
|
792
|
+
function (token) {
|
|
793
|
+
console.log(token)
|
|
794
|
+
}, function (error) {
|
|
795
|
+
console.log(error)
|
|
796
|
+
}
|
|
797
|
+
)
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
function requestAddCard() {
|
|
801
|
+
BootpaySDK.setEnvironmentMode(
|
|
802
|
+
document.getElementsByName('env')[0].value,
|
|
803
|
+
'gosomi.bootpay.co.kr'
|
|
804
|
+
)
|
|
805
|
+
BootpaySDK.setLogLevel(1)
|
|
806
|
+
BootpaySDK.setUUID('test-uuid')
|
|
807
|
+
BootpaySDK.requestAddCard(document.getElementsByName('userToken')[0].value).then(
|
|
808
|
+
function (token) {
|
|
809
|
+
console.log(token)
|
|
810
|
+
}, function (error) {
|
|
811
|
+
console.log(error)
|
|
812
|
+
}
|
|
813
|
+
)
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
function wallets() {
|
|
817
|
+
BootpaySDK.setEnvironmentMode(document.getElementsByName('env')[0].value)
|
|
818
|
+
BootpaySDK.setLogLevel(1)
|
|
819
|
+
BootpaySDK.setUUID('test-uuid')
|
|
820
|
+
BootpaySDK.wallets(document.getElementsByName('userToken')[0].value).then(
|
|
821
|
+
function (token) {
|
|
822
|
+
console.log(token)
|
|
823
|
+
}, function (error) {
|
|
824
|
+
console.log(error)
|
|
825
|
+
}
|
|
826
|
+
)
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
function addBiometricData() {
|
|
830
|
+
BootpaySDK.setEnvironmentMode(document.getElementsByName('env')[0].value)
|
|
831
|
+
BootpaySDK.setLogLevel(1)
|
|
832
|
+
BootpaySDK.setUUID('test-uuid')
|
|
833
|
+
BootpaySDK.requestPasswordToken(document.getElementsByName('userToken')[0].value).then(
|
|
834
|
+
function (token) {
|
|
835
|
+
BootpaySDK.createBiometricAuthenticate({
|
|
836
|
+
userToken: document.getElementsByName('userToken')[0].value,
|
|
837
|
+
os: 'android',
|
|
838
|
+
token: token
|
|
839
|
+
}).then(function (data) {
|
|
840
|
+
console.log(data)
|
|
841
|
+
}, function (error) {
|
|
842
|
+
console.log(error)
|
|
843
|
+
})
|
|
844
|
+
}, function (error) {
|
|
845
|
+
console.log(error)
|
|
846
|
+
}
|
|
847
|
+
)
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
function destroyBiometricData() {
|
|
851
|
+
BootpaySDK.setEnvironmentMode(document.getElementsByName('env')[0].value)
|
|
852
|
+
BootpaySDK.setLogLevel(1)
|
|
853
|
+
BootpaySDK.setUUID('test-uuid')
|
|
854
|
+
BootpaySDK.requestPasswordToken(document.getElementsByName('userToken')[0].value).then(
|
|
855
|
+
function (token) {
|
|
856
|
+
BootpaySDK.destroyBiometricAuthenticate({
|
|
857
|
+
userToken: document.getElementsByName('userToken')[0].value,
|
|
858
|
+
token: token
|
|
859
|
+
}).then(function (data) {
|
|
860
|
+
console.log(data)
|
|
861
|
+
}, function (error) {
|
|
862
|
+
console.log(error)
|
|
863
|
+
})
|
|
864
|
+
}, function (error) {
|
|
865
|
+
console.log(error)
|
|
866
|
+
}
|
|
867
|
+
)
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
// function requestWalletPayment() {
|
|
871
|
+
// BootpaySDK.setEnvironmentMode(
|
|
872
|
+
// document.getElementsByName('env')[0].value,
|
|
873
|
+
// 'gosomi.bootpay.co.kr'
|
|
874
|
+
// )
|
|
875
|
+
// BootpaySDK.setLogLevel(1)
|
|
876
|
+
// BootpaySDK.setUUID('test-uuid')
|
|
877
|
+
// BootpaySDK.wallets(document.getElementsByName('userToken')[0].value).then(
|
|
878
|
+
// function (response) {
|
|
879
|
+
// const wallet_id = response.wallets[0].wallet_id;
|
|
880
|
+
// BootpaySDK.requestPasswordToken(
|
|
881
|
+
// document.getElementsByName('userToken')[0].value,
|
|
882
|
+
// ).then(function (token) {
|
|
883
|
+
// BootpaySDK.requestWalletPayment({
|
|
884
|
+
// wallet_id: wallet_id,
|
|
885
|
+
// token: token,
|
|
886
|
+
// authenticate_type: 'token',
|
|
887
|
+
// application_id: '59a568d3e13f3336c21bf707',
|
|
888
|
+
// price: document.getElementsByName('amount')[0].value,
|
|
889
|
+
// tax_free: document.getElementsByName('taxFreeAmount')[0].value,
|
|
890
|
+
// order_name: '결제 테스트 스웻터',
|
|
891
|
+
// user_token: document.getElementsByName('userToken')[0].value,
|
|
892
|
+
// order_id: (new Date()).getTime(),
|
|
893
|
+
// metadata: {
|
|
894
|
+
// test: 1
|
|
895
|
+
// },
|
|
896
|
+
// user: {
|
|
897
|
+
// username: '부트페이',
|
|
898
|
+
// phone: '01000000000',
|
|
899
|
+
// // email: 'aqure84@naver.com'
|
|
900
|
+
// },
|
|
901
|
+
// items: [
|
|
902
|
+
// {
|
|
903
|
+
// id: 'test',
|
|
904
|
+
// name: '아이템1',
|
|
905
|
+
// qty: 2,
|
|
906
|
+
// price: parseInt(document.getElementsByName('amount')[0].value) / 2
|
|
907
|
+
// }
|
|
908
|
+
// ],
|
|
909
|
+
// extra: {
|
|
910
|
+
// open_type: 'iframe',
|
|
911
|
+
// // popup: true,
|
|
912
|
+
// use_order_id: true,
|
|
913
|
+
// redirect_url: 'https://dev-api.bootpay.co.kr/callback',
|
|
914
|
+
// // escrow: true,
|
|
915
|
+
// // offer_period: '20210401-20210501',
|
|
916
|
+
// display_cash_receipt: false,
|
|
917
|
+
// // separately_confirmed: true,
|
|
918
|
+
// card_quota: '0,2,3,4,5,6,7,8,9,10,11,12',
|
|
919
|
+
// display_success_result: true,
|
|
920
|
+
// display_error_result: true,
|
|
921
|
+
// card_easy_option: {
|
|
922
|
+
// title: '부트페이 카드웰렛'
|
|
923
|
+
// }
|
|
924
|
+
// // confirm_only_rest_api: true,
|
|
925
|
+
// // popup: true
|
|
926
|
+
// // confirm_message: '승인중이지롱'
|
|
927
|
+
// // theme: '#000000',
|
|
928
|
+
// // deposit_expiration: '2021-03-09 00:00:00'
|
|
929
|
+
// }
|
|
930
|
+
// }).then(function (response) {
|
|
931
|
+
// console.log(response)
|
|
932
|
+
// }, function (error) {
|
|
933
|
+
// console.log(error)
|
|
934
|
+
// })
|
|
935
|
+
// }, function (error) {
|
|
936
|
+
// console.log(error)
|
|
937
|
+
// })
|
|
938
|
+
// }, function (error) {
|
|
939
|
+
// console.log(error)
|
|
940
|
+
// }
|
|
941
|
+
// )
|
|
942
|
+
// }
|
|
943
|
+
|
|
944
|
+
// function destroyWallet() {
|
|
945
|
+
// BootpaySDK.setEnvironmentMode(document.getElementsByName('env')[0].value)
|
|
946
|
+
// BootpaySDK.setLogLevel(1)
|
|
947
|
+
// BootpaySDK.setUUID('test-uuid')
|
|
948
|
+
// BootpaySDK.wallets(document.getElementsByName('userToken')[0].value).then(
|
|
949
|
+
// function (response) {
|
|
950
|
+
// const wallet_id = response.wallets[0].wallet_id
|
|
951
|
+
// BootpaySDK.requestPasswordToken(
|
|
952
|
+
// document.getElementsByName('userToken')[0].value,
|
|
953
|
+
// ).then(function (token) {
|
|
954
|
+
// BootpaySDK.destroyWallet({
|
|
955
|
+
// authenticate_type: 'password',
|
|
956
|
+
// user_token: document.getElementsByName('userToken')[0].value,
|
|
957
|
+
// wallet_id: wallet_id,
|
|
958
|
+
// token: token
|
|
959
|
+
// }).then((response) => {
|
|
960
|
+
// console.log(response)
|
|
961
|
+
// }, (error) => {
|
|
962
|
+
// console.log(error)
|
|
963
|
+
// })
|
|
964
|
+
// }, function (error) {
|
|
965
|
+
// console.log(error)
|
|
966
|
+
// })
|
|
967
|
+
// }, function (error) {
|
|
968
|
+
// console.log(error)
|
|
969
|
+
// }
|
|
970
|
+
// )
|
|
971
|
+
// }
|