{"_id":"@aodjo/gitfle-naverpay","name":"@aodjo/gitfle-naverpay","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@aodjo/gitfle-naverpay","version":"1.0.0","description":"NaverPay payment API client for Node.js","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc","dev":"tsc --watch","clean":"rm -rf dist"},"keywords":["naverpay","naver","payment","korea","fintech"],"author":"","license":"MIT","repository":{"type":"git","url":"git+https://github.com/aodjo/gitfle-naverpay.git"},"devDependencies":{"@types/node":"^22.0.0","typescript":"^5.0.0"},"_id":"@aodjo/gitfle-naverpay@1.0.0","gitHead":"48c920176f0dcecccf899f04208a9b7e70b85b18","bugs":{"url":"https://github.com/aodjo/gitfle-naverpay/issues"},"homepage":"https://github.com/aodjo/gitfle-naverpay#readme","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-Eu+ggUB+nfjNSx6mBet8DR9fHUk89xWHI/5ecpfHSA479hZEAHSIJzn6xrjz0x4oIknSNXF3wdMWcjEsOrtr3w==","shasum":"94dc57d43a1291e57fe6b23239afc2f325d4882c","tarball":"https://registry.npmjs.org/@aodjo/gitfle-naverpay/-/gitfle-naverpay-1.0.0.tgz","fileCount":19,"unpackedSize":44612,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIC055abmSw6uSREfJmSE/EKvk8s8DsXlsRm4Q9X/zJpVAiEAm6KQog+hSgO8TpaGRXYmPwIY23g5CD/5O2w6E3yHKbE="}]},"_npmUser":{"name":"aodjo","email":"me@junx.dev"},"directories":{},"maintainers":[{"name":"aodjo","email":"me@junx.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gitfle-naverpay_1.0.0_1772903989469_0.47098662659500845"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-07T17:19:49.411Z","1.0.0":"2026-03-07T17:19:49.627Z","modified":"2026-03-07T17:19:49.793Z"},"maintainers":[{"name":"aodjo","email":"me@junx.dev"}],"description":"NaverPay payment API client for Node.js","homepage":"https://github.com/aodjo/gitfle-naverpay#readme","keywords":["naverpay","naver","payment","korea","fintech"],"repository":{"type":"git","url":"git+https://github.com/aodjo/gitfle-naverpay.git"},"bugs":{"url":"https://github.com/aodjo/gitfle-naverpay/issues"},"license":"MIT","readme":"# Gitfle\r\n\r\n자신의 평소 코딩 습관을 진단 받아 보세요\r\n\r\n## 프로젝트 소개\r\n\r\n> 이 프로젝트는 [조코딩 x OpenAI x Primer AI 해커톤](https://hack.primer.kr/8)를 위해 제작되었습니다. <br/>\r\n> 이 레포지토리의 모든 저작물에 대한 저작권은 [Junsung Lee](https://junx.dev/)에 있습니다. (자세한 내용은 [LICENSE](/LICENSE)를 확인하세요) <br/>\r\n> 이 레포지토리는 [Junsung Lee](https://junx.dev/)에 의해 관리됩니다. <br/>\r\n> 이 레포지토리는 대회가 종료됨에 따라 26. 03. 08. 이후 Public Archive 처리 되었습니다. <br/>\r\n> 이 프로젝트에 관해 문의가 있으신가요? [me@junx.dev](mailto:me@junx.dev)를 통해 문의주세요.\r\n\r\n## Gitfle 소개\r\n\r\n- 본인의 Github으로 로그인을 하면, Gitfle 에서 본인의 레포지토리를 선택할 수 있어요.\r\n- 선택한 레포지토리를 AI Agent가 각각 탐색하면서 평가를 해요.\r\n- 각각의 Agent의 평가를 기반으로 최종 레포트와 학습 방향을 정리해 줘요.\r\n\r\n## 레포지토리 소개\r\n> 위 레포지토리는 `네이버페이 단건 결제` 에 관해 다룹니다. <br/>\r\n> Gitfle 프로젝트의 레포지토리는 여러 레포지토리로 분리되어 있으며, 이 레포지토리는 그 중 하나에 속합니다. <br />\r\n> 자세한 내용은 아래 표를 확인하세요. (별(\\*)표는 현재 레포지토리를 의미합니다.)\r\n\r\n| Part | URL |\r\n| ----- | ----- |\r\n| client | [aodjo/gitfle-client](https://github.com/aodjo/gitfle-client) |\r\n| server | [aodjo/gitfle-server](https://github.com/aodjo/gitfle-server) |\r\n| payco | [aodjo/gitfle-payco](https://github.com/aodjo/gitfle-payco) |\r\n| \\*naverpay | [aodjo/gitfle-naverpay](https://github.com/aodjo/gitfle-naverpay) |\r\n| kakaopay | [aodjo/gitfle-kakaopay](https://github.com/aodjo/gitfle-kakaopay) |\r\n\r\n## 설치\r\n\r\n```bash\r\nnpm install @aodjo/gitfle-kakaopay\r\n```\r\n\r\n## 사용법\r\n\r\n```typescript\r\nimport { NaverPay } from '@aodjo/gitfle-kakaopay';\r\n\r\nconst naverpay = new NaverPay({\r\n  clientId: process.env.NAVERPAY_CLIENT_ID,\r\n  clientSecret: process.env.NAVERPAY_CLIENT_SECRET,\r\n  chainId: process.env.NAVERPAY_CHAIN_ID,\r\n  mode: 'development', // 또는 'production'\r\n});\r\n```\r\n\r\n### 결제 예약\r\n\r\n```typescript\r\nconst reserve = await naverpay.reserve({\r\n  merchantPayKey: 'order_123',\r\n  productName: '코인 100개',\r\n  productCount: 1,\r\n  totalPayAmount: 8000,\r\n  taxScopeAmount: 8000,\r\n  taxExScopeAmount: 0,\r\n  returnUrl: 'http://example.com/payment/callback',\r\n});\r\n\r\nconsole.log(reserve.reserveId);\r\n```\r\n\r\n### 결제창 URL 생성\r\n\r\n```typescript\r\nconst paymentUrl = naverpay.getPaymentUrl(reserve.reserveId);\r\n// 사용자를 이 URL로 리다이렉트\r\n```\r\n\r\n### 결제 승인\r\n\r\nreturnUrl 콜백에서 paymentId를 수신한 후:\r\n\r\n```typescript\r\nconst approve = await naverpay.approve({\r\n  paymentId: 'received_payment_id',\r\n});\r\n\r\nconsole.log(approve.detail.totalPayAmount);\r\n```\r\n\r\n### 결제 취소\r\n\r\n```typescript\r\nconst cancel = await naverpay.cancel({\r\n  paymentId: 'payment_id',\r\n  cancelAmount: 8000,\r\n  cancelReason: '고객 요청',\r\n  cancelRequester: '2', // 1: 구매자, 2: 가맹점 관리자\r\n  taxScopeAmount: 8000,\r\n  taxExScopeAmount: 0,\r\n});\r\n\r\nconsole.log(cancel.totalRestAmount);\r\n```\r\n\r\n## 환경 설정\r\n\r\n| 모드 | API 도메인 | 서비스 도메인 |\r\n|------|-----------|--------------|\r\n| development | dev-pay.paygate.naver.com | test-m.pay.naver.com |\r\n| production | pay.paygate.naver.com | m.pay.naver.com |\r\n\r\n## 에러 처리\r\n\r\n```typescript\r\nimport { NaverPayApiError, NaverPayNetworkError, NaverPayValidationError } from '@aodjo/gitfle-kakaopay';\r\n\r\ntry {\r\n  await naverpay.approve({ paymentId: 'invalid' });\r\n} catch (error) {\r\n  if (error instanceof NaverPayApiError) {\r\n    console.error(`API 에러 [${error.code}]: ${error.errorMessage}`);\r\n  } else if (error instanceof NaverPayNetworkError) {\r\n    console.error('네트워크 에러:', error.message);\r\n  } else if (error instanceof NaverPayValidationError) {\r\n    console.error(`검증 에러 [${error.field}]: ${error.message}`);\r\n  }\r\n}\r\n```\r\n\r\n## 라이선스\r\n\r\nMIT 라이선스입니다. 자세한 내용은 [LICENSE](/LICENSE)를 참고하세요.\r\n","readmeFilename":"README.md","_rev":"1-b457c2a607133b3067480cd150c255dd"}