@portone/browser-sdk 0.0.2 → 0.0.4

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 (96) hide show
  1. package/dist/{types/utils.d.ts → utils.d.ts} +4 -1
  2. package/dist/v2/entity/BillingKeyAndPayMethod.d.ts +4 -0
  3. package/dist/{types/v2 → v2}/entity/Currency.d.ts +0 -1
  4. package/dist/v2/entity/EasyPayPaymentMethod.d.ts +7 -0
  5. package/dist/{types/v2 → v2}/entity/EasyPayProvider.d.ts +1 -4
  6. package/dist/{types/v2 → v2}/entity/GiftCertificateType.d.ts +1 -0
  7. package/dist/v2/entity/IssueBillingKeyUIType.d.ts +4 -0
  8. package/dist/v2/entity/LoadableUIType.d.ts +3 -0
  9. package/dist/{types/v2 → v2}/entity/OfferPeriod.d.ts +11 -0
  10. package/dist/v2/entity/PayMethod.d.ts +1 -0
  11. package/dist/v2/entity/PaymentUIType.d.ts +4 -0
  12. package/dist/{types/v2 → v2}/entity/PgProvider.d.ts +2 -0
  13. package/dist/{types/v2 → v2}/entity/TransactionType.d.ts +2 -0
  14. package/dist/v2/entity/bypass/issueBillingKey/TosspayV2.d.ts +7 -0
  15. package/dist/v2/entity/bypass/issueBillingKey/Welcome.d.ts +6 -0
  16. package/dist/{types/v2 → v2}/entity/bypass/issueBillingKey/index.d.ts +4 -2
  17. package/dist/v2/entity/bypass/issueBillingKeyAndPay/Welcome.d.ts +55 -0
  18. package/dist/v2/entity/bypass/issueBillingKeyAndPay/index.d.ts +4 -0
  19. package/dist/{types/v2/entity/bypass/issueBillingKey → v2/entity/bypass/loadIssueBillingKeyUI}/PaypalV2.d.ts +1 -1
  20. package/dist/v2/entity/bypass/loadIssueBillingKeyUI/index.d.ts +4 -0
  21. package/dist/{types/v2/entity/bypass/payment → v2/entity/bypass/loadPaymentUI}/PaypalV2.d.ts +1 -1
  22. package/dist/v2/entity/bypass/loadPaymentUI/index.d.ts +4 -0
  23. package/dist/{types/v2/entity/bypass/payment/TosspaymentsBrandpay.d.ts → v2/entity/bypass/payment/TossBrandpay.d.ts} +22 -3
  24. package/dist/v2/entity/bypass/payment/TosspayV2.d.ts +17 -0
  25. package/dist/v2/entity/bypass/payment/Welcome.d.ts +108 -0
  26. package/dist/{types/v2 → v2}/entity/bypass/payment/index.d.ts +6 -4
  27. package/dist/{types/v2 → v2}/entity/index.d.ts +8 -0
  28. package/dist/v2/exception/CheckoutServiceErrorCode.d.ts +1 -0
  29. package/dist/v2/exception/IssueBillingKeyAndPayError.d.ts +24 -0
  30. package/dist/v2/exception/LoadIssueBillingKeyUIError.d.ts +16 -0
  31. package/dist/v2/exception/LoadPaymentUIError.d.ts +16 -0
  32. package/dist/v2/exception/ModuleError.d.ts +14 -0
  33. package/dist/{types/v2 → v2}/exception/index.d.ts +4 -0
  34. package/dist/v2/index.d.ts +30 -0
  35. package/dist/v2/loadIssueBillingKeyUI.d.ts +27 -0
  36. package/dist/v2/loadPaymentUI.d.ts +36 -0
  37. package/dist/v2/loader.d.ts +31 -0
  38. package/dist/v2/requestIdentityVerification.d.ts +25 -0
  39. package/dist/{types/v2/request/IssueBillingKey.d.ts → v2/requestIssueBillingKey.d.ts} +22 -9
  40. package/dist/v2/requestIssueBillingKeyAndPay.d.ts +51 -0
  41. package/dist/{types/v2/request/Payment.d.ts → v2/requestPayment.d.ts} +28 -10
  42. package/dist/v2/updateLoadIssueBillingKeyUIRequest.d.ts +2 -0
  43. package/dist/v2/updateLoadPaymentUIRequest.d.ts +2 -0
  44. package/dist/{chunk-f7332846.js → v2.cjs} +264 -7
  45. package/dist/v2.js +861 -18
  46. package/package.json +8 -26
  47. package/dist/chunk-4ed6f045.js +0 -66
  48. package/dist/chunk-ced8f127.js +0 -13
  49. package/dist/loader.d.ts +0 -14
  50. package/dist/types/v2/entity/PayMethod.d.ts +0 -1
  51. package/dist/types/v2/entity/index.js +0 -2
  52. package/dist/types/v2/exception/CheckoutServiceErrorCode.d.ts +0 -1
  53. package/dist/types/v2/exception/index.js +0 -2
  54. package/dist/types/v2/index.d.ts +0 -5
  55. package/dist/types/v2/request/IdentityVerification.d.ts +0 -14
  56. package/dist/types/v2/request/index.d.ts +0 -5
  57. package/dist/types/v2/response/IdentityVerification.d.ts +0 -13
  58. package/dist/types/v2/response/IssueBillingKey.d.ts +0 -12
  59. package/dist/types/v2/response/Payment.d.ts +0 -13
  60. package/dist/types/v2/response/index.d.ts +0 -5
  61. package/dist/v2-entity.js +0 -2
  62. package/dist/v2-exception.js +0 -2
  63. package/dist/v2.d.ts +0 -11
  64. package/dist/{types/v2 → v2}/entity/Address.d.ts +0 -0
  65. package/dist/{types/v2 → v2}/entity/Bank.d.ts +0 -0
  66. package/dist/{types/v2 → v2}/entity/BillingKeyMethod.d.ts +0 -0
  67. package/dist/{types/v2 → v2}/entity/CardCompany.d.ts +0 -0
  68. package/dist/{types/v2 → v2}/entity/Carrier.d.ts +0 -0
  69. package/dist/{types/v2 → v2}/entity/CashReceiptType.d.ts +0 -0
  70. package/dist/{types/v2 → v2}/entity/Country.d.ts +0 -0
  71. package/dist/{types/v2 → v2}/entity/Customer.d.ts +0 -0
  72. package/dist/{types/v2 → v2}/entity/FreeInstallmentPlan.d.ts +0 -0
  73. package/dist/{types/v2 → v2}/entity/Gender.d.ts +0 -0
  74. package/dist/{types/v2 → v2}/entity/Installment.d.ts +1 -1
  75. /package/dist/{types/v2 → v2}/entity/Locale.d.ts +0 -0
  76. /package/dist/{types/v2 → v2}/entity/Product.d.ts +0 -0
  77. /package/dist/{types/v2 → v2}/entity/ProductType.d.ts +0 -0
  78. /package/dist/{types/v2 → v2}/entity/StoreDetails.d.ts +0 -0
  79. /package/dist/{types/v2 → v2}/entity/WindowType.d.ts +0 -0
  80. /package/dist/{types/v2 → v2}/entity/bypass/identityVerification/Danal.d.ts +0 -0
  81. /package/dist/{types/v2 → v2}/entity/bypass/identityVerification/index.d.ts +0 -0
  82. /package/dist/{types/v2 → v2}/entity/bypass/issueBillingKey/Naverpay.d.ts +0 -0
  83. /package/dist/{types/v2 → v2}/entity/bypass/issueBillingKey/SmartroV2.d.ts +0 -0
  84. /package/dist/{types/v2 → v2}/entity/bypass/payment/Kakaopay.d.ts +0 -0
  85. /package/dist/{types/v2 → v2}/entity/bypass/payment/Ksnet.d.ts +0 -0
  86. /package/dist/{types/v2 → v2}/entity/bypass/payment/Naverpay.d.ts +0 -0
  87. /package/dist/{types/v2 → v2}/entity/bypass/payment/NiceV2.d.ts +0 -0
  88. /package/dist/{types/v2 → v2}/entity/bypass/payment/SmartroV2.d.ts +0 -0
  89. /package/dist/{types/v2 → v2}/entity/bypass/payment/Tosspayments.d.ts +0 -0
  90. /package/dist/{types/v2 → v2}/exception/GrpcErrorCode.d.ts +0 -0
  91. /package/dist/{types/v2 → v2}/exception/IdentityVerificationError.d.ts +0 -0
  92. /package/dist/{types/v2 → v2}/exception/IssueBillingKeyError.d.ts +0 -0
  93. /package/dist/{types/v2 → v2}/exception/PaymentError.d.ts +0 -0
  94. /package/dist/{types/v2 → v2}/exception/TxServiceIdentityVerificationErrorCode.d.ts +0 -0
  95. /package/dist/{types/v2 → v2}/exception/TxServiceIssueErrorCode.d.ts +0 -0
  96. /package/dist/{types/v2 → v2}/exception/TxServicePayErrorCode.d.ts +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@portone/browser-sdk",
3
3
  "type": "module",
4
- "version": "0.0.2",
4
+ "version": "0.0.4",
5
5
  "description": "PortOne SDK for browser",
6
6
  "keywords": [
7
7
  "PortOne",
@@ -16,39 +16,21 @@
16
16
  "files": [
17
17
  "dist"
18
18
  ],
19
- "main": "./dist/v2.js",
20
- "types": "./dist/v2.d.ts",
19
+ "main": "./dist/v2.cjs",
20
+ "module": "./dist/v2.js",
21
+ "types": "./dist/v2/index.d.ts",
21
22
  "typesVersions": {
22
23
  "*": {
23
24
  "v2": [
24
25
  "dist/v2"
25
- ],
26
- "types/v2/entity": [
27
- "dist/types/v2/entity"
28
- ],
29
- "types/v2/exception": [
30
- "dist/types/v2/exception"
31
26
  ]
32
27
  }
33
28
  },
34
29
  "exports": {
35
30
  "./v2": {
36
- "import": {
37
- "types": "./dist/v2.d.ts",
38
- "default": "./dist/v2.js"
39
- }
40
- },
41
- "./types/v2/entity": {
42
- "import": {
43
- "types": "./dist/types/v2/entity/index.d.ts",
44
- "default": "./dist/v2-entity.js"
45
- }
46
- },
47
- "./types/v2/exception": {
48
- "import": {
49
- "types": "./dist/types/v2/exception/index.d.ts",
50
- "default": "./dist/v2-exception.js"
51
- }
31
+ "types": "./dist/v2/index.d.ts",
32
+ "require": "./dist/v2.cjs",
33
+ "import": "./dist/v2.js"
52
34
  }
53
35
  },
54
36
  "config": {
@@ -56,7 +38,7 @@
56
38
  "dirSrc": "./src"
57
39
  },
58
40
  "scripts": {
59
- "build": "rollup -c && tsconfig-replace-paths -s src",
41
+ "build": "rm -rf dist && rollup -c && tsconfig-replace-paths -s src",
60
42
  "prepublishOnly": "npm run build"
61
43
  },
62
44
  "devDependencies": {
@@ -1,66 +0,0 @@
1
- import { T as TransactionType } from './chunk-ced8f127.js';
2
-
3
- function isIdentityVerificationError(error) {
4
- return (isPortOneError(error) &&
5
- error.__portOneErrorType === 'IdentityVerificationError');
6
- }
7
- class IdentityVerificationError extends Error {
8
- constructor({ code, message, identityVerificationId, identityVerificationTxId, }) {
9
- super(message);
10
- this.__portOneErrorType = 'IdentityVerificationError';
11
- this.transactionType = TransactionType.IDENTITY_VERIFICATION;
12
- this.code = code;
13
- this.message = message;
14
- this.identityVerificationId = identityVerificationId;
15
- this.identityVerificationTxId = identityVerificationTxId;
16
- }
17
- }
18
-
19
- function isIssueBillingKeyError(error) {
20
- return (isPortOneError(error) && error.__portOneErrorType === 'IssueBillingKeyError');
21
- }
22
- class IssueBillingKeyError extends Error {
23
- constructor({ code, message, billingKey, }) {
24
- super(message);
25
- this.__portOneErrorType = 'IssueBillingKeyError';
26
- this.transactionType = TransactionType.ISSUE_BILLING_KEY;
27
- this.code = code;
28
- this.message = message;
29
- this.billingKey = billingKey;
30
- }
31
- }
32
-
33
- function isPaymentError(error) {
34
- return isPortOneError(error) && error.__portOneErrorType === 'PaymentError';
35
- }
36
- class PaymentError extends Error {
37
- constructor({ code, message, txId, paymentId, }) {
38
- super(message);
39
- this.__portOneErrorType = 'PaymentError';
40
- this.transactionType = TransactionType.PAYMENT;
41
- this.code = code;
42
- this.message = message;
43
- this.txId = txId;
44
- this.paymentId = paymentId;
45
- }
46
- }
47
-
48
- function isPortOneError(error) {
49
- return (error != null &&
50
- typeof error === 'object' &&
51
- '__portOneErrorType' in error &&
52
- typeof error.__portOneErrorType === 'string');
53
- }
54
-
55
- var index = /*#__PURE__*/Object.freeze({
56
- __proto__: null,
57
- IdentityVerificationError: IdentityVerificationError,
58
- IssueBillingKeyError: IssueBillingKeyError,
59
- PaymentError: PaymentError,
60
- isIdentityVerificationError: isIdentityVerificationError,
61
- isIssueBillingKeyError: isIssueBillingKeyError,
62
- isPaymentError: isPaymentError,
63
- isPortOneError: isPortOneError
64
- });
65
-
66
- export { IdentityVerificationError as I, PaymentError as P, isPortOneError as a, isIdentityVerificationError as b, isIssueBillingKeyError as c, IssueBillingKeyError as d, isPaymentError as e, index as i };
@@ -1,13 +0,0 @@
1
- /**
2
- * 트랜잭션 유형
3
- * - PAYMENT: 결제
4
- * - ISSUE_BILLING_KEY: 빌링키 발급
5
- * - IDENTITY_VERIFICATION: 본인 인증
6
- */
7
- const TransactionType = {
8
- PAYMENT: 'PAYMENT',
9
- ISSUE_BILLING_KEY: 'ISSUE_BILLING_KEY',
10
- IDENTITY_VERIFICATION: 'IDENTITY_VERIFICATION',
11
- };
12
-
13
- export { TransactionType as T };
package/dist/loader.d.ts DELETED
@@ -1,14 +0,0 @@
1
- import type { Request, Response } from './types/v2/index.js';
2
- declare global {
3
- interface Window {
4
- PortOne: PortOne | undefined;
5
- }
6
- }
7
- interface PortOne {
8
- requestPayment(request: Request.Payment): Promise<Response.Payment>;
9
- requestIssueBillingKey(request: Request.IssueBillingKey): Promise<Response.IssueBillingKey>;
10
- requestIdentityVerification(request: Request.IdentityVerification): Promise<Response.IdentityVerification>;
11
- }
12
- export declare function loadScript(): Promise<PortOne>;
13
- export declare function setPortOneJsSdkUrl(url: string): string;
14
- export {};
@@ -1 +0,0 @@
1
- export type PayMethod = 'CARD' | 'VIRTUAL_ACCOUNT' | 'TRANSFER' | 'MOBILE' | 'GIFT_CERTIFICATE' | 'EASY_PAY' | 'PAYPAL';
@@ -1,2 +0,0 @@
1
- export { B as Bank, a as BillingKeyMethod, C as CardCompany, b as Carrier, c as Country, d as Currency, E as EasyPayProvider, G as Gender, e as GiftCertificateType, L as Locale, P as PgProvider, W as WindowType } from '../../../chunk-f7332846.js';
2
- export { T as TransactionType } from '../../../chunk-ced8f127.js';
@@ -1 +0,0 @@
1
- export type CheckoutServiceErrorCode = 'ParsePrepareResponseFailed' | 'ParsePgRawResponseFailed' | 'BadRequest';
@@ -1,2 +0,0 @@
1
- export { I as IdentityVerificationError, d as IssueBillingKeyError, P as PaymentError, b as isIdentityVerificationError, c as isIssueBillingKeyError, e as isPaymentError, a as isPortOneError } from '../../../chunk-4ed6f045.js';
2
- import '../../../chunk-ced8f127.js';
@@ -1,5 +0,0 @@
1
- import * as Entity from './entity/index.js';
2
- import * as Request from './request/index.js';
3
- import * as Response from './response/index.js';
4
- import * as Exception from './exception/index.js';
5
- export { Entity, Request, Response, Exception };
@@ -1,14 +0,0 @@
1
- import { Entity } from '../index.js';
2
- type IdentityVerificationRequest = {
3
- storeId: string;
4
- identityVerificationId: string;
5
- channelKey?: string;
6
- pgProvider?: Entity.PgProvider;
7
- isTestChannel?: boolean;
8
- customer?: Entity.Customer;
9
- windowType?: Entity.WindowTypes;
10
- redirectUrl?: string;
11
- customData?: string;
12
- bypass?: Entity.IdentityVerificationBypass;
13
- };
14
- export default IdentityVerificationRequest;
@@ -1,5 +0,0 @@
1
- import IdentityVerification from './IdentityVerification.js';
2
- import IssueBillingKey from './IssueBillingKey.js';
3
- import Payment from './Payment.js';
4
- type Transaction = Payment | IssueBillingKey | IdentityVerification;
5
- export type { IdentityVerification, IssueBillingKey, Payment, Transaction };
@@ -1,13 +0,0 @@
1
- import { Entity } from '../index.js';
2
- /**
3
- * iframe/popup 방식으로 PG사 창이 렌더링 된 경우
4
- * 프로세스 종료 후, 콜백 함수로 전달 될 본인인증 정보 데이터
5
- */
6
- type IdentityVerificationResponse = {
7
- transactionType: typeof Entity.TransactionType.IDENTITY_VERIFICATION;
8
- identityVerificationId?: string;
9
- identityVerificationTxId: string;
10
- code?: string;
11
- message?: string;
12
- };
13
- export default IdentityVerificationResponse;
@@ -1,12 +0,0 @@
1
- import { Entity } from '../index.js';
2
- /**
3
- * iframe/popup 방식으로 PG사 창이 렌더링 된 경우
4
- * 프로세스 종료 후, 콜백 함수로 전달 될 빌링키 발급 정보 데이터
5
- */
6
- type IssueBillingKeyResponse = {
7
- transactionType: typeof Entity.TransactionType.ISSUE_BILLING_KEY;
8
- billingKey?: string;
9
- code?: string;
10
- message?: string;
11
- };
12
- export default IssueBillingKeyResponse;
@@ -1,13 +0,0 @@
1
- import { Entity } from '../index.js';
2
- /**
3
- * iframe/popup 방식으로 PG사 창이 렌더링 된 경우
4
- * 프로세스 종료 후, 콜백 함수로 전달 될 결제 정보 데이터
5
- */
6
- type PaymentResponse = {
7
- transactionType: typeof Entity.TransactionType.PAYMENT;
8
- txId: string;
9
- paymentId?: string;
10
- code?: string;
11
- message?: string;
12
- };
13
- export default PaymentResponse;
@@ -1,5 +0,0 @@
1
- import IdentityVerification from './IdentityVerification.js';
2
- import IssueBillingKey from './IssueBillingKey.js';
3
- import Payment from './Payment.js';
4
- type Transaction = IdentityVerification | IssueBillingKey | Payment;
5
- export type { IdentityVerification, IssueBillingKey, Payment, Transaction };
package/dist/v2-entity.js DELETED
@@ -1,2 +0,0 @@
1
- export { B as Bank, a as BillingKeyMethod, C as CardCompany, b as Carrier, c as Country, d as Currency, E as EasyPayProvider, G as Gender, e as GiftCertificateType, L as Locale, P as PgProvider, W as WindowType } from './chunk-f7332846.js';
2
- export { T as TransactionType } from './chunk-ced8f127.js';
@@ -1,2 +0,0 @@
1
- export { I as IdentityVerificationError, d as IssueBillingKeyError, P as PaymentError, b as isIdentityVerificationError, c as isIssueBillingKeyError, e as isPaymentError, a as isPortOneError } from './chunk-4ed6f045.js';
2
- import './chunk-ced8f127.js';
package/dist/v2.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import { Request, Response, Entity, Exception } from './types/v2/index.js';
2
- import { setPortOneJsSdkUrl } from './loader.js';
3
- export declare function requestPayment(request: Request.Payment): Promise<Response.Payment | undefined>;
4
- export declare function requestIssueBillingKey(request: Request.IssueBillingKey): Promise<Response.IssueBillingKey | undefined>;
5
- declare const PortOne: {
6
- requestPayment: typeof requestPayment;
7
- requestIssueBillingKey: typeof requestIssueBillingKey;
8
- };
9
- export { Request, Response, Entity, Exception };
10
- export { setPortOneJsSdkUrl as __INTERNAL__setPortOneSdkUrl };
11
- export default PortOne;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,5 +1,5 @@
1
- import { OneOfType } from '../../utils.js';
2
1
  import { Entity } from '../index.js';
2
+ import { OneOfType } from '../../utils.js';
3
3
  export type Installment = {
4
4
  freeInstallmentPlans?: Entity.FreeInstallmentPlan[];
5
5
  /**
File without changes
File without changes
File without changes
File without changes
File without changes