@portone/browser-sdk 0.0.1 → 0.0.3

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 (61) hide show
  1. package/README.md +25 -4
  2. package/dist/utils.d.ts +18 -0
  3. package/dist/v2/entity/Address.d.ts +8 -0
  4. package/dist/v2/entity/Bank.d.ts +78 -0
  5. package/dist/v2/entity/BillingKeyMethod.d.ts +7 -0
  6. package/dist/v2/entity/CardCompany.d.ts +25 -0
  7. package/dist/v2/entity/Carrier.d.ts +18 -0
  8. package/dist/v2/entity/CashReceiptType.d.ts +6 -0
  9. package/dist/v2/entity/Country.d.ts +252 -0
  10. package/dist/v2/entity/Currency.d.ts +184 -0
  11. package/dist/v2/entity/Customer.d.ts +15 -0
  12. package/dist/v2/entity/EasyPayProvider.d.ts +21 -0
  13. package/dist/v2/entity/FreeInstallmentPlan.d.ts +19 -0
  14. package/dist/v2/entity/Gender.d.ts +6 -0
  15. package/dist/v2/entity/GiftCertificateType.d.ts +7 -0
  16. package/dist/v2/entity/Installment.d.ts +24 -0
  17. package/dist/v2/entity/Locale.d.ts +6 -0
  18. package/dist/v2/entity/OfferPeriod.d.ts +27 -0
  19. package/dist/v2/entity/PayMethod.d.ts +1 -0
  20. package/dist/v2/entity/PgProvider.d.ts +44 -0
  21. package/dist/v2/entity/Product.d.ts +8 -0
  22. package/dist/v2/entity/ProductType.d.ts +10 -0
  23. package/dist/v2/entity/StoreDetails.d.ts +14 -0
  24. package/dist/v2/entity/TransactionType.d.ts +12 -0
  25. package/dist/v2/entity/WindowType.d.ts +15 -0
  26. package/dist/v2/entity/bypass/identityVerification/Danal.d.ts +23 -0
  27. package/dist/v2/entity/bypass/identityVerification/index.d.ts +4 -0
  28. package/dist/v2/entity/bypass/issueBillingKey/Naverpay.d.ts +8 -0
  29. package/dist/v2/entity/bypass/issueBillingKey/PaypalV2.d.ts +24 -0
  30. package/dist/v2/entity/bypass/issueBillingKey/SmartroV2.d.ts +8 -0
  31. package/dist/v2/entity/bypass/issueBillingKey/index.d.ts +10 -0
  32. package/dist/v2/entity/bypass/payment/Kakaopay.d.ts +3 -0
  33. package/dist/v2/entity/bypass/payment/Ksnet.d.ts +7 -0
  34. package/dist/v2/entity/bypass/payment/Naverpay.d.ts +31 -0
  35. package/dist/v2/entity/bypass/payment/NiceV2.d.ts +39 -0
  36. package/dist/v2/entity/bypass/payment/PaypalV2.d.ts +44 -0
  37. package/dist/v2/entity/bypass/payment/SmartroV2.d.ts +9 -0
  38. package/dist/v2/entity/bypass/payment/TossBrandpay.d.ts +46 -0
  39. package/dist/v2/entity/bypass/payment/Tosspayments.d.ts +8 -0
  40. package/dist/v2/entity/bypass/payment/index.d.ts +18 -0
  41. package/dist/v2/entity/index.d.ts +27 -0
  42. package/dist/v2/exception/CheckoutServiceErrorCode.d.ts +1 -0
  43. package/dist/v2/exception/GrpcErrorCode.d.ts +1 -0
  44. package/dist/v2/exception/IdentityVerificationError.d.ts +20 -0
  45. package/dist/v2/exception/IssueBillingKeyError.d.ts +19 -0
  46. package/dist/v2/exception/ModuleError.d.ts +14 -0
  47. package/dist/v2/exception/PaymentError.d.ts +20 -0
  48. package/dist/v2/exception/TxServiceIdentityVerificationErrorCode.d.ts +1 -0
  49. package/dist/v2/exception/TxServiceIssueErrorCode.d.ts +1 -0
  50. package/dist/v2/exception/TxServicePayErrorCode.d.ts +1 -0
  51. package/dist/v2/exception/index.d.ts +8 -0
  52. package/dist/v2/index.d.ts +15 -0
  53. package/dist/v2/loader.d.ts +16 -0
  54. package/dist/v2/requestIdentityVerification.d.ts +25 -0
  55. package/dist/v2/requestIssueBillingKey.d.ts +49 -0
  56. package/dist/v2/requestPayment.d.ts +91 -0
  57. package/dist/v2.cjs +851 -0
  58. package/dist/v2.js +833 -0
  59. package/package.json +42 -9
  60. package/v2/index.d.ts +0 -1120
  61. package/v2/index.js +0 -84
@@ -0,0 +1,8 @@
1
+ export interface PortOneError extends Error {
2
+ __portOneErrorType: string;
3
+ }
4
+ export declare function isPortOneError(error: unknown): error is PortOneError;
5
+ export * from './IdentityVerificationError.js';
6
+ export * from './IssueBillingKeyError.js';
7
+ export * from './ModuleError.js';
8
+ export * from './PaymentError.js';
@@ -0,0 +1,15 @@
1
+ import { requestPayment } from './requestPayment.js';
2
+ import { requestIssueBillingKey } from './requestIssueBillingKey.js';
3
+ import { requestIdentityVerification } from './requestIdentityVerification.js';
4
+ declare const PortOne: {
5
+ requestPayment: typeof requestPayment;
6
+ requestIssueBillingKey: typeof requestIssueBillingKey;
7
+ requestIdentityVerification: typeof requestIdentityVerification;
8
+ };
9
+ export { setPortOneJsSdkUrl as __INTERNAL__setPortOneSdkUrl } from './loader.js';
10
+ export { requestPayment, type PaymentRequest, type PaymentResponse, } from './requestPayment.js';
11
+ export { requestIssueBillingKey, type IssueBillingKeyRequest, type IssueBillingKeyResponse, } from './requestIssueBillingKey.js';
12
+ export { requestIdentityVerification, type IdentityVerificationRequest, type IdentityVerificationResponse, } from './requestIdentityVerification.js';
13
+ export * as Entity from './entity/index.js';
14
+ export * from './exception/index.js';
15
+ export default PortOne;
@@ -0,0 +1,16 @@
1
+ import type { PaymentRequest, PaymentResponse } from './requestPayment.js';
2
+ import type { IssueBillingKeyRequest, IssueBillingKeyResponse } from './requestIssueBillingKey.js';
3
+ import type { IdentityVerificationRequest, IdentityVerificationResponse } from './requestIdentityVerification.js';
4
+ declare global {
5
+ interface Window {
6
+ PortOne: PortOne | undefined;
7
+ }
8
+ }
9
+ interface PortOne {
10
+ requestPayment(request: PaymentRequest): Promise<PaymentResponse>;
11
+ requestIssueBillingKey(request: IssueBillingKeyRequest): Promise<IssueBillingKeyResponse>;
12
+ requestIdentityVerification(request: IdentityVerificationRequest): Promise<IdentityVerificationResponse>;
13
+ }
14
+ export declare function loadScript(): Promise<PortOne>;
15
+ export declare function setPortOneJsSdkUrl(url: string): string;
16
+ export {};
@@ -0,0 +1,25 @@
1
+ import { Entity } from './index.js';
2
+ export declare function requestIdentityVerification(request: IdentityVerificationRequest): Promise<IdentityVerificationResponse | undefined>;
3
+ export type IdentityVerificationRequest = {
4
+ storeId: string;
5
+ identityVerificationId: string;
6
+ channelKey?: string;
7
+ pgProvider?: Entity.PgProvider;
8
+ isTestChannel?: boolean;
9
+ customer?: Entity.Customer;
10
+ windowType?: Entity.WindowTypes;
11
+ redirectUrl?: string;
12
+ customData?: string;
13
+ bypass?: Entity.IdentityVerificationBypass;
14
+ };
15
+ /**
16
+ * iframe/popup 방식으로 PG사 창이 렌더링 된 경우
17
+ * 프로세스 종료 후, 콜백 함수로 전달 될 본인인증 정보 데이터
18
+ */
19
+ export type IdentityVerificationResponse = {
20
+ transactionType: typeof Entity.TransactionType.IDENTITY_VERIFICATION;
21
+ identityVerificationId?: string;
22
+ identityVerificationTxId: string;
23
+ code?: string;
24
+ message?: string;
25
+ };
@@ -0,0 +1,49 @@
1
+ import { CapsToCamel } from '../utils.js';
2
+ import { Entity } from './index.js';
3
+ export declare function requestIssueBillingKey(request: IssueBillingKeyRequest): Promise<IssueBillingKeyResponse | undefined>;
4
+ export type IssueBillingKeyRequest = {
5
+ displayAmount?: number;
6
+ currency?: Entity.Currency;
7
+ storeId: string;
8
+ channelKey?: string;
9
+ pgProvider?: Entity.PgProvider;
10
+ isTestChannel?: boolean;
11
+ billingKeyMethod: Entity.BillingKeyMethod;
12
+ issueName?: string;
13
+ issueId?: string;
14
+ billingKey?: string;
15
+ customer?: Entity.Customer;
16
+ windowType?: Entity.WindowTypes;
17
+ redirectUrl?: string;
18
+ locale?: Entity.Locale;
19
+ customData?: Record<string, any>;
20
+ appScheme?: string;
21
+ noticeUrls?: string[];
22
+ bypass?: Entity.IssueBillingKeyBypass;
23
+ } & (BillingKeyMethodOptions<'CARD', Card> | BillingKeyMethodOptions<'MOBILE', Mobile> | BillingKeyMethodOptions<'EASY_PAY', EasyPay> | BillingKeyMethodOptions<'PAYPAL', Paypal>);
24
+ /**
25
+ * iframe/popup 방식으로 PG사 창이 렌더링 된 경우
26
+ * 프로세스 종료 후, 콜백 함수로 전달 될 빌링키 발급 정보 데이터
27
+ */
28
+ export type IssueBillingKeyResponse = {
29
+ transactionType: typeof Entity.TransactionType.ISSUE_BILLING_KEY;
30
+ billingKey?: string;
31
+ code?: string;
32
+ message?: string;
33
+ };
34
+ type BillingKeyMethodOptions<Method extends Entity.BillingKeyMethod, T> = {
35
+ billingKeyMethod: Method;
36
+ } & {
37
+ [K in Method as CapsToCamel<K>]?: T;
38
+ };
39
+ type Card = {
40
+ cardCompany?: Entity.CardCompany;
41
+ };
42
+ type EasyPay = {
43
+ availableCards?: Entity.CardCompany[];
44
+ };
45
+ type Mobile = {
46
+ carrier?: Entity.Carrier;
47
+ };
48
+ type Paypal = Record<string, never>;
49
+ export {};
@@ -0,0 +1,91 @@
1
+ import { CapsToCamel, OneOfType } from '../utils.js';
2
+ import { Entity } from './index.js';
3
+ export declare function requestPayment(request: PaymentRequest): Promise<PaymentResponse | undefined>;
4
+ export type PaymentRequest = {
5
+ storeId: string;
6
+ paymentId: string;
7
+ orderName: string;
8
+ totalAmount: number;
9
+ channelKey?: string;
10
+ pgProvider?: Entity.PgProvider;
11
+ isTestChannel?: boolean;
12
+ taxFreeAmount?: number;
13
+ vatAmount?: number;
14
+ customer?: Entity.Customer;
15
+ windowType?: Entity.WindowTypes;
16
+ redirectUrl?: string;
17
+ noticeUrls?: string[];
18
+ confirmUrl?: string;
19
+ appScheme?: string;
20
+ isEscrow?: boolean;
21
+ products?: Entity.Product[];
22
+ isCulturalExpense?: boolean;
23
+ currency: Entity.Currency;
24
+ locale?: Entity.Locale;
25
+ customData?: Record<string, any>;
26
+ offerPeriod?: Entity.OfferPeriod;
27
+ productType?: Entity.ProductType;
28
+ storeDetails?: Entity.StoreDetails;
29
+ bypass?: Entity.PaymentBypass;
30
+ country?: Entity.Country;
31
+ shippingAddress?: Entity.Address;
32
+ } & (PayMethodOptions<'CARD', Card> | PayMethodOptions<'VIRTUAL_ACCOUNT', VirtualAccount> | PayMethodOptions<'TRANSFER', Transfer> | PayMethodOptions<'MOBILE', Mobile> | PayMethodOptions<'GIFT_CERTIFICATE', GiftCertificate> | PayMethodOptions<'EASY_PAY', EasyPay> | PayMethodOptions<'PAYPAL', Paypal>);
33
+ /**
34
+ * iframe/popup 방식으로 PG사 창이 렌더링 된 경우
35
+ * 프로세스 종료 후, 콜백 함수로 전달 될 결제 정보 데이터
36
+ */
37
+ export type PaymentResponse = {
38
+ transactionType: typeof Entity.TransactionType.PAYMENT;
39
+ txId: string;
40
+ paymentId?: string;
41
+ code?: string;
42
+ message?: string;
43
+ };
44
+ type PayMethodOptions<Method extends Entity.PayMethod, T> = {
45
+ payMethod: Method;
46
+ } & {
47
+ [K in Method as CapsToCamel<K>]?: T;
48
+ };
49
+ type Card = {
50
+ cardCompany?: Entity.CardCompany;
51
+ installment?: Entity.Installment;
52
+ useCardPoint?: boolean;
53
+ useAppCardOnly?: boolean;
54
+ availableCards?: Entity.CardCompany[];
55
+ useFreeInterestFromMall?: boolean;
56
+ };
57
+ type VirtualAccount = {
58
+ cashReceiptType?: Entity.CashReceiptType;
59
+ customerIdentifier?: string;
60
+ accountExpiry?: OneOfType<{
61
+ validHours: number;
62
+ dueDate: string;
63
+ }>;
64
+ bankCode?: Entity.Bank;
65
+ fixedOption?: OneOfType<{
66
+ pgAccountId: string;
67
+ accountNumber: string;
68
+ }>;
69
+ };
70
+ type Transfer = {
71
+ cashReceiptType?: Entity.CashReceiptType;
72
+ customerIdentifier?: string;
73
+ bankCode?: Entity.Bank;
74
+ };
75
+ type Mobile = {
76
+ carrier?: Entity.Carrier;
77
+ };
78
+ type GiftCertificate = {
79
+ giftCertificateType?: Entity.GiftCertificateType;
80
+ };
81
+ type EasyPay = {
82
+ easyPayProvider?: Entity.EasyPayProvider;
83
+ installment?: Entity.Installment;
84
+ availableCards?: Entity.CardCompany[];
85
+ useFreeInterestFromMall?: boolean;
86
+ cashReceiptType?: Entity.CashReceiptType;
87
+ customerIdentifier?: string;
88
+ useCardPoint?: boolean;
89
+ };
90
+ type Paypal = Record<string, never>;
91
+ export {};