@bootpay/client-js 5.2.0-beta.2 → 5.2.0-beta.20

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.
Files changed (59) hide show
  1. package/dist/index.d.ts +3 -0
  2. package/dist/index.mjs +9524 -0
  3. package/dist/index.umd.js +76 -57
  4. package/dist/src/bootpay-environment.d.ts +1 -0
  5. package/dist/src/bootpay-es5.d.ts +2 -1
  6. package/dist/src/bootpay-sdk.d.ts +3 -2
  7. package/dist/src/bootpay-widget.d.ts +4 -2
  8. package/dist/src/bootpay.d.ts +4 -3
  9. package/dist/src/index.d.ts +12 -12
  10. package/dist/src/lib/analytics.d.ts +2 -1
  11. package/dist/src/lib/bootpay-store.d.ts +1 -0
  12. package/dist/src/lib/bootpay-widget.d.ts +3 -2
  13. package/dist/src/lib/bootpay.d.ts +4 -3
  14. package/dist/src/lib/event/hooks/slider/event.d.ts +6 -0
  15. package/dist/src/lib/event/hooks/widget/message.d.ts +16 -4
  16. package/dist/src/lib/event/payment.d.ts +3 -2
  17. package/dist/src/lib/event/polling.d.ts +3 -2
  18. package/dist/src/lib/event/slider.d.ts +7 -0
  19. package/dist/src/lib/event/store.d.ts +1 -0
  20. package/dist/src/lib/event/user-token.d.ts +2 -1
  21. package/dist/src/lib/event/widget.d.ts +1 -0
  22. package/dist/src/lib/locale/message.d.ts +1 -1
  23. package/dist/src/lib/template/brandpay.d.ts +17 -4
  24. package/dist/src/lib/template/confirm-modal.d.ts +2 -1
  25. package/dist/src/lib/template/modal.d.ts +2 -1
  26. package/dist/src/lib/template/payment.d.ts +4 -3
  27. package/dist/src/lib/template/slider.d.ts +21 -0
  28. package/dist/src/lib/template/store.d.ts +1 -0
  29. package/dist/src/lib/template/user-token.d.ts +14 -4
  30. package/dist/src/lib/template/widget.d.ts +5 -5
  31. package/dist/src/support/alfred-progress/index.d.ts +2 -1
  32. package/dist/src/support/event-logger.d.ts +1 -0
  33. package/dist/src/support/event.d.ts +4 -1
  34. package/dist/src/support/ex-store.d.ts +2 -1
  35. package/dist/src/support/hook.d.ts +12 -0
  36. package/dist/src/support/hooks/widget-hooks.d.ts +9 -0
  37. package/dist/src/support/resource.d.ts +1 -0
  38. package/dist/src/support/session.d.ts +16 -0
  39. package/dist/src/support/storage.d.ts +2 -1
  40. package/dist/src/support/stores/bootpay-store.d.ts +4 -0
  41. package/dist/src/support/stores/widget-store.d.ts +3 -2
  42. package/dist/src/support/template-manager.d.ts +10 -3
  43. package/dist/src/types/bootpay-ex-interface.d.ts +53 -0
  44. package/dist/src/types/bootpay-interface.d.ts +312 -0
  45. package/dist/src/types/bootpay-sdk-interface.d.ts +17 -0
  46. package/dist/src/types/bootpay-widget-interface.d.ts +121 -0
  47. package/package.json +14 -4
  48. package/tsconfig.json +10 -6
  49. package/vite.config.ts +8 -9
  50. package/dist/index.es.js +0 -8387
  51. package/dist/package.json.d.ts +0 -56
  52. package/dist/src/bootpay-wallet.d.ts +0 -15
  53. package/dist/src/lib/bootpay-wallet.d.ts +0 -7
  54. package/dist/src/lib/event/hooks/wallet/message.d.ts +0 -24
  55. package/dist/src/lib/event/wallet.d.ts +0 -6
  56. package/dist/src/lib/template/wallet.d.ts +0 -15
  57. package/dist/src/support/stores/wallet-store.d.ts +0 -11
  58. package/dist/src/support/widget-store.d.ts +0 -20
  59. package/dist/vite.config.d.ts +0 -2
@@ -0,0 +1,312 @@
1
+ import { ResponseBootpayWidgetTermsModel } from './bootpay-widget-interface';
2
+
3
+
4
+
5
+ interface RequestPaymentBaseModel {
6
+ ver?: string // version
7
+ sdk?: boolean // sdk 사용여부
8
+ sdk_version?: string
9
+ sdk_type?: number
10
+ application_id?: string // application_id
11
+ pg?: string // PG 명
12
+ method?: string | string[] // 결제 수단
13
+ order_name: string
14
+ price: number
15
+ tax_free?: number
16
+ deposit_price?: number
17
+ platform_type?: number
18
+ currency?: string // 결제 currency 화폐단위
19
+ uuid?: string // UUID
20
+ sk?: string // 세션 고유키
21
+ ti?: number // 재방문까지 걸린 시각
22
+ tk?: string // 결제 고유키
23
+ user_token?: string // user token 값을 보낸다
24
+ wallet_id?: string
25
+ widget_key?: string
26
+ commission_keys?: CommissionKeyModel
27
+ redirect_url?: string
28
+ metadata?: any // 사용자가 보내는 custom data
29
+ user?: UserModel
30
+ items?: ItemModel[]
31
+ extra?: ExtraModel
32
+ env?: EnvironmentModel
33
+ terms?: ResponseBootpayWidgetTermsModel[]
34
+ widget_sandbox?: boolean
35
+ widget?: 1 | 0
36
+ locale?: string
37
+ }
38
+
39
+ /**
40
+ * 결제 요청 모델
41
+ * Comment by GOSOMI
42
+ * @date: 2021-04-13
43
+ */
44
+ export interface RequestPaymentModel extends RequestPaymentBaseModel {
45
+ order_id: string
46
+ }
47
+
48
+ export interface RequestPaymentUrlModel {
49
+ application_id?: string
50
+ url?: string
51
+ }
52
+
53
+ export interface RequestSubscriptionModel extends RequestPaymentBaseModel {
54
+ subscription_id: string
55
+ subscribe_brandpay_type?: 'sequential' | 'select' | undefined
56
+ }
57
+
58
+ export interface RequestAuthenticationModel {
59
+ ver?: string
60
+ sdk?: boolean
61
+ application_id: string
62
+ authentication_id: string
63
+ metadata?: any // 메타 데이터
64
+ pg: string
65
+ method?: string
66
+ order_name: string // 본인인증 요청명
67
+ redirect_url?: string
68
+ platform_type?: number
69
+ uuid?: string
70
+ sk?: string
71
+ ti?: number
72
+ tk?: string
73
+ user: UserModel
74
+ extra: ExtraModel
75
+ }
76
+
77
+ /**
78
+ * User Model
79
+ * Comment by GOSOMI
80
+ * @date: 2021-04-13
81
+ */
82
+ export interface UserModel {
83
+ id?: string | undefined
84
+ username?: string
85
+ email?: string
86
+ addr?: string
87
+ phone?: string
88
+ }
89
+
90
+ /**
91
+ * Item Model
92
+ * Comment by GOSOMI
93
+ * @date: 2021-04-13
94
+ */
95
+ export interface ItemModel {
96
+ id: string // 상품 고유 ID
97
+ code?: string // item model code
98
+ name: string // 상품명
99
+ price: number // 상품가격
100
+ img?: string // 이미지 경로
101
+ qty: number // 상품수량
102
+ cat1?: string
103
+ cat2?: string
104
+ cat3?: string
105
+ }
106
+
107
+ export interface ItemAnalyticsModel {
108
+ cat1?: string
109
+ cat2?: string
110
+ cat3?: string
111
+ img?: string
112
+ name?: string
113
+ id: string
114
+ price: number
115
+ }
116
+
117
+ export interface ItemAnalyticsLegacyModel {
118
+ cat1?: string
119
+ cat2?: string
120
+ cat3?: string
121
+ item_img?: string
122
+ item_name?: string
123
+ unique: string
124
+ price: number
125
+ }
126
+
127
+ /**
128
+ * 통계 일반 common model
129
+ * Comment by GOSOMI
130
+ * @date: 2022-03-02
131
+ */
132
+ export interface BootpayAnalyticsModel {
133
+ application_id?: string
134
+ uuid?: string
135
+ time?: number
136
+ url?: string
137
+ referer?: string
138
+ sk?: string
139
+ user_id?: string
140
+ page_type?: string
141
+ items?: Array<ItemAnalyticsModel> | Array<ItemAnalyticsLegacyModel>
142
+ }
143
+
144
+ export interface BootpayAnalyticsBaseModel {
145
+ uuid: string
146
+ time: number
147
+ }
148
+
149
+ /**
150
+ * 통계 User Model
151
+ * Comment by GOSOMI
152
+ * @date: 2022-03-02
153
+ */
154
+ export interface BootpayAnalyticsUserModel {
155
+ application_id?: string
156
+ id: string
157
+ username?: string
158
+ birth?: string
159
+ phone?: string
160
+ email?: string
161
+ gender?: string
162
+ area?: string
163
+ }
164
+
165
+ interface OpenTypeFilterModel {
166
+ browser: string
167
+ open_type: 'iframe' | 'popup' | 'redirect'
168
+ }
169
+
170
+ /**
171
+ * Extra Model
172
+ * Comment by GOSOMI
173
+ * @date: 2021-04-13
174
+ */
175
+ export interface ExtraModel {
176
+ open_type?: string // 결제 진행 방법, iframe, popup, redirect
177
+ browser_open_type?: Array<OpenTypeFilterModel>
178
+ escrow?: boolean // 에스크로 결제 여부
179
+ redirect_url?: string // 결제 진행 방법이 redirect인 경우 결제 완료시 이동한 마지막 URL
180
+ card_quota?: string | string[] | number[] // 카드 할부 개월수 노출 설정 ( PG 설정에 따름 )
181
+ seller_name?: string // 가맹점 이름 변경
182
+ delivery_day?: number // 배송일자
183
+ locale?: string // 결제 언어 선택
184
+ offer_period?: string // 제공기간 설정 ( PG사 마다 설정 방법이 상이 )
185
+ display_cash_receipt?: boolean // 현금 영수증 체크 노출 Y,N, default: true
186
+ deposit_expiration?: string // dateformat ('yyyy-mm-dd HH:MM:SS')
187
+ app_scheme?: string // 아이폰 앱 to 앱 호출
188
+ use_card_point?: boolean // 카드 포인트 사용 설정 ( 일부 PG만 지원 ), default: false
189
+ direct_card?: string // 특정 카드사로 바로 호출 ( 일부 PG만 지원 )
190
+ use_order_id?: boolean // PG사로 결제 데이터를 전송할때 receipt_id가 아닌 가맹점이 설정한 order_id로 전송 ,default: false
191
+ separately_confirmed?: boolean // 승인 분리 default: false
192
+ confirm_message?: string // 승인중 나오는 메세지 custom
193
+ display_success_result?: boolean // 결제 결과 display 옵션
194
+ display_error_result?: boolean // 결제 결과 display 옵션
195
+ test_deposit?: boolean // 테스트 모드일때 가상계좌 입금 모의 통지 여부, default: false
196
+ ad_id?: string // 원스토어 ThirdParty ad_id
197
+ sim_operator?: string // 원스토어 ThirdParty sim_operator
198
+ installer_package_name?: string // 원스토어 ThirdParty installer_package_name
199
+ timeout?: number // 분단위 결제 만료 시간 timeout ( default: 30분 )
200
+ common_event_webhook?: boolean // 닫기, 만료등의 이벤트 웹훅을 받을지 여부 ( default: false )
201
+
202
+ first_subscription_comment?: string // 정기결제 첫 결제 진행시 코멘트 ( price > 0 조건일 때 나오는 메세지 )
203
+ subscription_comment?: string // 정기결제 하단 코멘트 추가 관련 옵션
204
+ subscribe_test_payment?: boolean // 자동결제 카드 등록시 결제로 유효성 검사
205
+
206
+ enable_easy_payments?: Array<string> // 노출될 간편결제 리스트
207
+ except_card_companies?: Array<string> // 감춰질 카드사 리스트
208
+ enable_card_companies?: Array<string> // 보여질 카드사 리스트
209
+ direct_card_company?: string // 다이렉트 카드사 옵션
210
+ direct_card_quota?: string // 다이렉트 카드 quota 옵션
211
+
212
+ minimum_price_limit?: boolean // 최소금액 제한
213
+ confirm_grace_seconds?: number // 결제 승인 시간 유예 (단위, sec)
214
+
215
+ automatic_tax?: boolean // 해외결제 자동 세금 옵션
216
+ dynamic_tax_rates?: number // stripe tax 옵션
217
+ tax_rates?: number // stripe tax 옵션
218
+
219
+ show_close_button?: boolean // default false - iframe 모드일 경우 닫기 버튼을 보여줄지 체크
220
+
221
+ select_phone_carrier?: string // 휴대폰 소액결제시 통신사 prefix
222
+ phone_editable?: boolean // 휴대폰 소액결제시 전화번호 edit 가능 ( 다날만 적용 )
223
+ age_limit?: number // 본인인증시 나이 제한 설정
224
+
225
+ easy_payment_method?: 'card' | '카드' | 'point' | '포인트' // 네이버페이 결제시 point, card prefix
226
+ cash_receipt_type?: '소득공제' | '지출증빙' // 네이버포인트 결제시 현금영수증 발행 default - 소득공제 , option- 지출증빙
227
+ identity_no?: string // 현금영수증 발행 주체 ( 전화번호 or 사업자 등록증 )
228
+ override_global_event?: boolean
229
+ cash_receipt_not_published?: boolean
230
+ webhook_delay_duration?: number // webhook delay duration ( sec )
231
+
232
+ force_browser_mode?: 'pc' | 'mobile' // 강제로 브라우저 모드 지정 옵션 ( 현재 미구현 PG사마다 정책이 달라서 확인 이후에 업데이트 될 예정 )
233
+ }
234
+
235
+ export interface WidgetExtraModel extends Partial<ExtraModel> {
236
+ card_quota?: string | string[] | number[] // 카드 할부 개월수 노출 설정
237
+ direct_card_company?: string
238
+ direct_card_quota?: string
239
+
240
+ hide_title?: boolean
241
+ hide_divider_line?: boolean
242
+ inline_styles?: BootpayWidgetInlineStyleModel
243
+ }
244
+
245
+ export interface ConfirmModel {
246
+ event: string
247
+ receipt_id: string
248
+ gateway_url: string
249
+ data?: any
250
+ }
251
+
252
+ export interface ErrorModel {
253
+ event: string
254
+ pg_error_code?: string
255
+ error_code: string
256
+ message: string
257
+ }
258
+
259
+ interface BootpayWidgetInlineStyleModel {
260
+ mobile?: {
261
+ containerStyle?: {
262
+ 'padding-top'?: string
263
+ 'padding-bottom'?: string
264
+ 'padding-left'?: string
265
+ 'padding-right'?: string
266
+ }
267
+ }
268
+ pc?: {
269
+ containerStyle?: {
270
+ 'padding-top'?: string
271
+ 'padding-bottom'?: string
272
+ 'padding-left'?: string
273
+ 'padding-right'?: string
274
+ }
275
+ }
276
+ }
277
+
278
+ /**
279
+ * 사용자 환경 설정 관련 environment
280
+ * Comment by GOSOMI
281
+ * @date: 2021-12-09
282
+ */
283
+ export interface EnvironmentModel {
284
+ width: number
285
+ height: number
286
+ }
287
+
288
+ export interface PopupDisplayResponseModel {
289
+ gatewayUrl: string
290
+ receiptId: string
291
+ name: string
292
+ message?: string // 메세지 정보는 아직 사용중이지 않음
293
+ price: number
294
+ }
295
+
296
+ export interface CommissionKeyModel {
297
+ commerce?: string
298
+ marketer?: string
299
+ }
300
+
301
+ export interface BootpaySliderOption {
302
+ title?: string
303
+ responseEvent: string
304
+ sliders: BootpaySliderSelectOption[]
305
+ }
306
+
307
+ export interface BootpaySliderSelectOption {
308
+ key: string
309
+ name: string
310
+ hook?: Function
311
+ class?: string
312
+ }
@@ -0,0 +1,17 @@
1
+ import { RequestPaymentModel } from './bootpay-interface';
2
+
3
+
4
+
5
+ export interface BiometricDataModel {
6
+ userToken: string,
7
+ os?: string
8
+ token: string
9
+ }
10
+
11
+ export interface RequestPaymentWalletModel extends RequestPaymentModel {
12
+ user_token?: string
13
+ authenticate_type: string
14
+ token: string
15
+ wallet_id: string
16
+ easy_type?: string
17
+ }
@@ -0,0 +1,121 @@
1
+ import { ExtraModel, RequestPaymentModel, WidgetExtraModel } from './bootpay-interface';
2
+
3
+
4
+
5
+ export interface RequestBootpayWidgetModel extends Partial<RequestPaymentModel> {
6
+ subscription_id?: string
7
+ use_only_brandpay?: boolean
8
+ subscribe_brandpay_type?: 'select' | 'sequential' | null | undefined
9
+ use_terms?: boolean
10
+ sandbox?: boolean
11
+ use_bootpay_inapp_sdk?: boolean
12
+ external_terms?: ExternalBootpayWidgetTermsModel[]
13
+ use_popup?: boolean
14
+ extra?: WidgetExtraModel
15
+ hooks?: WidgetHookFunction
16
+ }
17
+
18
+ export interface ResponseBootpayWidgetTermsModel {
19
+ term_id?: string
20
+ pk: string
21
+ title: string
22
+ agree?: boolean
23
+ }
24
+
25
+ export interface ExternalBootpayWidgetTermsModel {
26
+ pk: string
27
+ title: string
28
+ url: string
29
+ required: 'required' | 'optional'
30
+ }
31
+
32
+ export interface ExternalBootpaySelectModel {
33
+ payment_type?: string
34
+ method_alias?: string
35
+ wallet_id?: string
36
+ }
37
+
38
+ export interface PaymentParametersModel {
39
+ pg?: string
40
+ method?: string
41
+ wallet_id?: string
42
+ terms?: ResponseBootpayWidgetTermsModel[]
43
+ widget_key?: string
44
+ widget_sandbox?: boolean
45
+ extra?: ExtraModel
46
+ }
47
+
48
+ export interface WidgetStoreData {
49
+ el?: string
50
+ application_id?: string
51
+ order_name?: string
52
+ price?: number
53
+ tax_free?: number
54
+ deposit_price?: number
55
+ currency?: string
56
+ user_token?: string
57
+ pg?: string
58
+ method?: string
59
+ wallet_id?: string
60
+ use_only_brandpay?: boolean
61
+ use_bootpay_inapp_sdk?: boolean
62
+ use_terms?: boolean
63
+ sandbox?: boolean
64
+ widget_key?: string
65
+ widget_type?: number
66
+ external_terms?: ExternalBootpayWidgetTermsModel[]
67
+ extra?: ExtraModel
68
+ }
69
+
70
+ export interface WidgetHookFunction {
71
+ ready?: (data: any) => void
72
+ allTermsAccepted?: (data: any) => void
73
+ resize?: (data: any) => void
74
+ paymentMethodUpdated?: (data: any) => void
75
+ termsConsentUpdated?: (data: any) => void
76
+ brandpayWalletUpdated?: (data: WidgetBrandpayWalletModel[]) => void
77
+ brandpayManagerWindowClosed?: () => void
78
+ brandpayManagerWindowReady?: (data: any) => void
79
+ }
80
+
81
+ export interface WidgetBrandpayUpdateModel {
82
+ el?: string
83
+ application_id: string
84
+ widget_key: string
85
+ user_token: string
86
+ sandbox: boolean
87
+ is_popup: boolean
88
+ }
89
+
90
+ export interface WidgetBrandpayWalletModel {
91
+ wallet_id: string
92
+ type: number
93
+ payment_status: number
94
+ sandbox: boolean
95
+ order: number
96
+ name: string
97
+ card_code?: string
98
+ expired_at: string
99
+ latest_purchased_at: string
100
+ batch_data: {
101
+ bank_code?: string
102
+ bank_account?: string
103
+ bank_username?: string
104
+ card_company?: string
105
+ card_hash?: string
106
+ card_company_code?: string
107
+ card_no?: string
108
+ card_type?: number
109
+ }
110
+ }
111
+
112
+ export interface RequestBootpayBrandpayLaunchManager {
113
+ application_id: string
114
+ widget_key: string
115
+ user_token: string
116
+ el?: string
117
+ sandbox?: boolean
118
+ use_popup?: boolean
119
+ subscribe_brandpay_type?: 'select' | 'sequential' | null | undefined
120
+ hooks?: WidgetHookFunction
121
+ }
package/package.json CHANGED
@@ -1,8 +1,13 @@
1
1
  {
2
2
  "name": "@bootpay/client-js",
3
- "version": "5.2.0-beta.2",
4
- "main": "dist/index.es.js",
5
- "types": "dist/src/index.d.ts",
3
+ "version": "5.2.0-beta.20",
4
+ "main": "dist/index.mjs",
5
+ "exports": {
6
+ ".": {
7
+ "import": "./dist/index.mjs",
8
+ "types": "./dist/index.d.ts"
9
+ }
10
+ },
6
11
  "styles": "dist/index.css",
7
12
  "scripts": {
8
13
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -28,6 +33,11 @@
28
33
  "@babel/plugin-transform-object-assign": "^7.22.5",
29
34
  "@babel/plugin-proposal-class-properties": "^7.18.6",
30
35
  "@babel/plugin-transform-destructuring": "^7.24.8",
36
+ "@babel/plugin-proposal-export-default-from": "^7.27.1",
37
+ "@babel/plugin-transform-class-properties": "^7.27.1",
38
+ "@babel/plugin-proposal-decorators": "^7.28.0",
39
+ "@babel/plugin-transform-private-methods": "^7.27.1",
40
+ "@babel/plugin-transform-typescript": "^7.28.0",
31
41
  "@babel/preset-env": "^7.22.5",
32
42
  "@babel/preset-typescript": "^7.22.5",
33
43
  "@babel/runtime-corejs3": "^7.22.5",
@@ -41,7 +51,7 @@
41
51
  "vite": "^5.4.3",
42
52
  "vite-plugin-dts": "^3.6.4",
43
53
  "vite-plugin-tsconfig": "^1.0.4",
44
- "vite-plugin-css-injected-by-js": "^3.3.0"
54
+ "vite-plugin-css-injected-by-js": "3.3.1"
45
55
  },
46
56
  "resolutions": {
47
57
  "@webpack-cli/serve": "^1.3.1"
package/tsconfig.json CHANGED
@@ -19,13 +19,17 @@
19
19
  "strict": false,
20
20
  "rootDir": "./",
21
21
  "baseUrl": "./src/",
22
- "paths": {
23
- "*": [
24
- "../node_modules/*",
25
- "./*"
26
- ]
27
- }
22
+ "typeRoots": [
23
+ "../node_modules/@types",
24
+ "../src/types"
25
+ ]
28
26
  },
27
+ "include": [
28
+ "src/**/*.ts",
29
+ "src/**/*.js",
30
+ "src/**/*.json",
31
+ "src/**/*.vue"
32
+ ],
29
33
  "exclude": [
30
34
  "**/*.spec.ts",
31
35
  "node_modules",
package/vite.config.ts CHANGED
@@ -1,26 +1,25 @@
1
1
  import { defineConfig } from 'vite'
2
2
  import dts from 'vite-plugin-dts'
3
3
  import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js'
4
-
5
- const path = require('path')
4
+ import path from 'path'
6
5
 
7
6
  export default defineConfig({
8
7
  build: {
9
- minify: 'esbuild',
10
- lib: {
8
+ minify: 'esbuild',
9
+ lib: {
11
10
  entry: path.resolve(__dirname, 'src/index.ts'),
12
11
  name: 'Bootpay',
13
- fileName: (format) => `index.${ format }.js`
12
+ fileName: 'index'
14
13
  }
15
14
  },
16
- base: './',
17
- root: './',
18
15
  plugins: [
19
- dts(),
16
+ dts({ copyDtsFiles: true, insertTypesEntry: true }),
20
17
  cssInjectedByJsPlugin()
21
18
  ],
19
+ base: './',
20
+ root: './',
22
21
  publicDir: '_public',
23
22
  resolve: {
24
- extensions: ['.css', '.sass', '.scss', '.ts', '.js']
23
+ extensions: ['.css', '.sass', '.scss', '.ts', '.js', '.d.ts']
25
24
  }
26
25
  })