https://github.com/junhoyeo/iamport-typings
π³β¨π TypeScript type definitions for PortOne (formerly Iamport) / κ΅λ΄ PG κ²°μ μ°λ μλΉμ€, ν¬νΈμ(ꡬ μμν¬νΈ)λ₯Ό μν νμ
μ€ν¬λ¦½νΈ νμ
μ μΈμ μ 곡ν©λλ€.
https://github.com/junhoyeo/iamport-typings
iamport types typescript
Last synced: 6 months ago
JSON representation
π³β¨π TypeScript type definitions for PortOne (formerly Iamport) / κ΅λ΄ PG κ²°μ μ°λ μλΉμ€, ν¬νΈμ(ꡬ μμν¬νΈ)λ₯Ό μν νμ μ€ν¬λ¦½νΈ νμ μ μΈμ μ 곡ν©λλ€.
- Host: GitHub
- URL: https://github.com/junhoyeo/iamport-typings
- Owner: junhoyeo
- Created: 2020-05-13T11:10:15.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2025-05-21T05:07:19.000Z (about 1 year ago)
- Last Synced: 2025-10-08T11:56:52.132Z (9 months ago)
- Topics: iamport, types, typescript
- Language: TypeScript
- Homepage:
- Size: 43.9 KB
- Stars: 35
- Watchers: 1
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

Iamport Typings
> κ΅λ΄ PG κ²°μ μ°λ μλΉμ€, [ν¬νΈμ(ꡬ μμν¬νΈ)](https://portone.io)λ₯Ό μν νμ
μ€ν¬λ¦½νΈ νμ
μ μΈμ μ 곡ν©λλ€.
## βοΈ μ¬μ©νλ κ³³
## π¦ μ€μΉ
```bash
npm install -D iamport-typings
# Or using yarn
yarn add -D iamport-typings
```
ν¨ν€μ§λ₯Ό μ€μΉν©λλ€.
## π λ‘λλ§΅
λ©μλλ³ μ§μ μν©μ
λλ€. PRμ μΈμ λ νμ! π
- [x] `init`
- [x] `request_pay`
- [ ] `agency`
- [ ] `certification`
- [ ] `close`
- [ ] `communicate`
- [ ] `naver_zzim`
## π μ¬μ© λ°©λ²
```json
// tsconfig.json
{
"compilerOptions": {
"types": ["iamport-typings"]
}
}
```
μ¬μ©ν νλ‘μ νΈ λ£¨νΈ λλ ν 리μ μλ `tsconfig.json` νμΌμ `compilerOptions.types`μ `iamport-typings`λ₯Ό μΆκ°νκΈ°λ§ νλ©΄ λ!
```tsx
const { IMP } = window;
```
`Window` μΈν°νμ΄μ€λ₯Ό νμ₯νκΈ° λλ¬Έμ, κΈ°μ‘΄μ²λΌ μμ κ°μ΄ λ°λ‘ μ¬μ©ν μ μλ΅λλ€! π
```tsx
import Iamport from 'iamport-typings';
declare global {
interface Window {
IMP?: Iamport;
}
}
```
```tsx
import { RequestPayParams, RequestPayResponse } from 'iamport-typings';
const onClickPayment = () => {
const { IMP } = window;
IMP.init('your_imp_uid');
const params: RequestPayParams = {
...
};
IMP.request_pay(params, onPaymentAccepted);
};
const onPaymentAccepted = (response: RequestPayResponse) => {
const { imp_uid, merchant_uid } = response;
console.log(imp_uid, merchant_uid);
};
```
μμ κ°μ΄ κ°κ°μ μΈν°νμ΄μ€λ₯Ό κ°μ Έμ μ¬μ©νλ κ²λ κ°λ₯ν©λλ€.
### μμν¬νΈ κ°μ²΄
| μΈν°νμ΄μ€ μ΄λ¦ | μ€λͺ
|
| ----------- | --- |
| `Iamport` | μμν¬νΈ κ°μ²΄ |
### [κ²°μ μμ² νλΌλ―Έν°](https://developers.portone.io/docs/ko/sdk/javascript-sdk/payrq?v=v1)
| μΈν°νμ΄μ€ μ΄λ¦ | μ€λͺ
|
| ----------- | --- |
| `RequestPayParams` | `request_pay` λ©μλλ₯Ό μν κ²°μ μΉμΈμ νμν μ 보λ₯Ό λ΄κ³ μλ κ°μ²΄λ‘, `RequestPayAdditionalParams`μμ νμ₯λ¨ |
| `RequestPayAdditionalParams` | `request_pay` λ©μλλ₯Ό μν μΆκ° μμ± |
| μΈν°νμ΄μ€ μ΄λ¦ | μ€λͺ
|
| ----------- | --- |
| `RequestPayNaverAdditionalParams` | [λ€μ΄λ²νμ΄ μ°λ μ `RequestPayParams` μ μΆκ°λλ νλΌλ―Έν°](https://github.com/iamport/iamport-manual/blob/master/NAVERPAY/sample/naverpay-pg.md) |
| `RequestPayNaverParams` | `RequestPayParams & RequestPayNaverAdditionalParams` |
#### κΈ°ν
| νμ
μ΄λ¦ | μ€λͺ
| Codegen |
| ------- | --- | ------- |
| [`Pg`](https://github.com/junhoyeo/iamport-typings/blob/main/src/Pg.ts) | | [Codegen](https://github.com/junhoyeo/iamport-typings/blob/main/scripts/codegen-pg.js) |
| [`PaymentMethod`](https://github.com/junhoyeo/iamport-typings/blob/main/src/PaymentMethod.ts) | | [Codegen](https://github.com/junhoyeo/iamport-typings/blob/main/scripts/codegen-payment-method.js) |
| [`PayPalSupportedCurrency`](https://github.com/junhoyeo/iamport-typings/blob/main/src/paypal/PayPalSupportedCurrency.ts) | [PayPal μ§μ κ²°μ ν΅ν](https://developer.paypal.com/docs/reports/reference/paypal-supported-currencies/)μ μ λμΈ νμ
(union type) | [Codegen](https://github.com/junhoyeo/iamport-typings/blob/main/scripts/codegen-paypal.js) |
| `Currency` | κ²°μ ν΅ν ꡬλΆμ½λ (`'KRW' \| 'USD' \| 'EUR' \| 'JPY' \| PayPalSupportedCurrency`) | |
| [`CardCode`](https://github.com/junhoyeo/iamport-typings/blob/main/src/card/CardCode.ts) | [μΉ΄λμ¬ κΈμ΅κ²°μ μ νμ€ μ½λ](https://chaifinance.notion.site/53589280bbc94fab938d93257d452216?v=eb405baf52134b3f90d438e3bf763630)μ μ λμΈ νμ
(union type) | [Codegen](https://github.com/junhoyeo/iamport-typings/blob/main/scripts/codegen-card-codes.js) |
| `Language` | `'en' \| 'ko' \| 'zh'` | |
| `EscrowProduct` | | |
| νμ
μ΄λ¦ | μ€λͺ
|
| ----------- | --- |
| `NaverProductCategoryType` | |
| `NaverProductCategoryId` | |
| `NaverPayReferrer` | |
| `NaverProduct` | [λ€μ΄λ²νμ΄ μν μ 보](https://github.com/iamport/iamport-manual/blob/master/NAVERPAY/sample/naverpay-pg.md#naverproducts-%ED%8C%8C%EB%9D%BC%EB%AF%B8%ED%84%B0) |
### [κ²°μ μλ΅ νλΌλ―Έν°](https://developers.portone.io/docs/ko/sdk/javascript-sdk/payrt?v=v1)
| μΈν°νμ΄μ€ μ΄λ¦ | μ€λͺ
|
| ----------- | --- |
| `RequestPayResponse` | κ²°μ κ²°κ³Όμ μ 보λ₯Ό λ΄κ³ μλ κ°μ²΄λ‘, `request_pay` λ©μλμ μ§μ λλ μ½λ°± ν¨μμ μΈμλ‘, `RequestPayAdditionalResponse`μμ νμ₯λ¨ |
| `RequestPayAdditionalResponse` | `request_pay` λ©μλμ μ½λ°±μ μν μΆκ° μμ± |
| `RequestPayResponseCallback` | `request_pay` λ©μλμ ν¨μ νμ
리ν°λ΄ |