npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aodjo/gitfle-payco

v1.0.1

Published

PAYCO Payment SDK for Node.js

Readme

Gitfle

자신의 평소 코딩 습관을 진단 받아 보세요

프로젝트 소개

이 프로젝트는 조코딩 x OpenAI x Primer AI 해커톤를 위해 제작되었습니다. 이 레포지토리의 모든 저작물에 대한 저작권은 Junsung Lee에 있습니다. (자세한 내용은 LICENSE를 확인하세요) 이 레포지토리는 Junsung Lee에 의해 관리됩니다. 이 레포지토리는 대회가 종료됨에 따라 26. 03. 08. 이후 Public Archive 처리 되었습니다. 이 프로젝트에 관해 문의가 있으신가요? [email protected]를 통해 문의주세요.

Gitfle 소개

  • 본인의 Github으로 로그인을 하면, Gitfle 에서 본인의 레포지토리를 선택할 수 있어요.
  • 선택한 레포지토리를 AI Agent가 각각 탐색하면서 평가를 해요.
  • 각각의 Agent의 평가를 기반으로 최종 레포트와 학습 방향을 정리해 줘요.

레포지토리 소개

위 레포지토리는 Payco 단건 결제 에 관해 다룹니다. Gitfle 프로젝트의 레포지토리는 여러 레포지토리로 분리되어 있으며, 이 레포지토리는 그 중 하나에 속합니다. 자세한 내용은 아래 표를 확인하세요. (별(*)표는 현재 레포지토리를 의미합니다.)

| Part | URL | | ----- | ----- | | client | aodjo/gitfle-client | | server | aodjo/gitfle-server | | *payco | aodjo/gitfle-payco | | naverpay | aodjo/gitfle-naverpay | | kakaopay | aodjo/gitfle-kakaopay |

Installation

npm install @aodjo/gitfle-payco

Usage

초기화

import { Payco } from '@aodjo/gitfle-payco'

const payco = new Payco({
  sellerKey: 'S0FSJE',      // PAYCO에서 발급받은 가맹점 코드
  cpId: 'PARTNERTEST',      // PAYCO에서 발급받은 상점 ID
  productId: 'PROD_EASY',   // PAYCO에서 발급받은 상품 ID
  mode: 'development'       // 'development' | 'production'
})

결제 플로우

1. 주문 예약

const reserve = await payco.reserve({
  sellerOrderReferenceKey: 'order-123',  // 가맹점 주문번호
  totalPaymentAmt: 10000,                 // 총 결제금액
  orderTitle: '테스트 상품',               // 주문명
  returnUrl: 'https://example.com/payco/callback',  // 결제 완료 후 콜백 URL
  orderMethod: 'EASYPAY',                 // EASYPAY: 비회원, EASYPAY_F: 회원
  orderChannel: 'PC',                     // PC | MOBILE
  inAppYn: 'N',                          // 인앱결제 여부
  orderProducts: [{
    productAmt: 10000,
    productPaymentAmt: 10000,
    orderQuantity: 1,
    sortOrdering: 1,
    productName: '테스트 상품',
    sellerOrderProductReferenceKey: 'item-123'
  }]
})

// 결제창 URL로 리다이렉트
// reserve.result.orderSheetUrl

2. 결제 승인

returnUrl로 전달된 파라미터를 사용하여 승인 처리:

// returnUrl에서 받은 파라미터
// code, reserveOrderNo, sellerOrderReferenceKey, paymentCertifyToken, totalPaymentAmt

const approval = await payco.approve({
  reserveOrderNo: '202302082005802285',
  sellerOrderReferenceKey: 'order-123',
  paymentCertifyToken: 'JeF_D0w-1OW2...',
  totalPaymentAmt: 10000
})

// 결제 완료
console.log('주문번호:', approval.result.orderNo)
console.log('취소용 키:', approval.result.orderCertifyKey)

3. 결제 취소

const cancel = await payco.cancel({
  orderNo: '202302082002764740',
  orderCertifyKey: 'GiB3gCceGTsWAvgs...',
  cancelTotalAmt: 10000
})

console.log('취소 완료:', cancel.result.cancelYmdt)

에러 처리

import { PaycoApiError, PaycoNetworkError, PaycoErrorCodes } from '@aodjo/gitfle-payco'

try {
  const reserve = await payco.reserve({ ... })
} catch (error) {
  if (error instanceof PaycoApiError) {
    console.log('API 에러:', error.code, error.message)

    if (error.code === PaycoErrorCodes.ALREADY_PAID) {
      console.log('이미 결제된 주문입니다.')
    }
  } else if (error instanceof PaycoNetworkError) {
    console.log('네트워크 에러:', error.statusCode, error.message)
  }
}

테스트 환경

개발 환경에서는 아래 테스트 가맹점 정보를 사용할 수 있습니다:

| 항목 | 값 | |------|-----| | sellerKey | S0FSJE | | cpId | PARTNERTEST | | productId | PROD_EASY |

API Reference

Payco

constructor(options: PaycoOptions)

| 옵션 | 타입 | 필수 | 설명 | |------|------|------|------| | sellerKey | string | O | 가맹점 고유 코드 | | cpId | string | O | 상점 ID | | productId | string | O | 상품 ID | | mode | 'development' | 'production' | X | 환경 (기본: development) |

reserve(params: ReserveRequest): Promise<ReserveResponse>

주문 예약 API를 호출합니다.

approve(params: ApprovalRequest): Promise<ApprovalResponse>

결제 승인 API를 호출합니다.

cancel(params: CancelRequest): Promise<CancelResponse>

결제 취소 API를 호출합니다.

라이선스

MIT 라이선스입니다. 자세한 내용은 LICENSE를 참고하세요.