@bootpay/client-js 5.2.0-beta.1 → 5.2.0-beta.11

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