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

@compy-ryu/payments

v0.2.28

Published

여러분의 미션에 콤피 페이를 추가해보세요!

Readme

사용법

import { Payments } from "@compy-ryu/payments";

function App() {
  return (<Payments
            defaultCardList={/* 초기 카드 목록 (선택 옵션) */} 
            companyList={} /* 카드사 목록 (선택 옵션) */
  					amountPaid={}  /* 결제 필요 금액 */
            onClickPayment={(cardId) => console.log(`결제 시 발생될 클릭 이벤트 => 카드 아이디 : ${cardId}`)}
            onClickCancel={(event) => console.log(`결제 취소 시 발생될 클릭 이벤트 => 이벤트 객체: ${event}`)}
            onUpdatedCardData={(cardList) => { 
              /* 카드 정보 업데이트(추가/제거/편집) 시 발생될 이벤트 */
              console.log(`저장된 카드 목록 배열 : ${cardList}`);
            }}
            />);
}

설치

Yarn

yarn add @compy/payments

Npm

npm install @compy/payments

Component Props

defaultCardList

첫 로드 시 기본으로 소지할 카드 목록을 지정합니다. 이후 카드 업데이트 목록 정보는 하단의 onUpdatedCardData() 문단을 참조해주세요.

데이터 예시

const cardList = [
  {
    id: '아이디 (문자열)',
    cardName: '카드명',
    companyId: '회사 아이디(companyList의 아이디 값)',
    cardNumber: ['1234', '1234', '1234', '1234'],
    expireMonth: '12',
    expireYear: '25',
    userName: '카드 소유자 이름',
    securityCode: '123',
    cardPassword: '23',
  },
  {
    id: '아이디 (문자열)',
    cardName: '카드명',
    companyId: '회사 아이디(companyList의 아이디 값)',
    cardNumber: ['1234', '1234', '1234', '1234'],
    expireMonth: '12',
    expireYear: '25',
    userName: '카드 소유자 이름',
    securityCode: '123',
    cardPassword: '23',
  },
];

companyList

사용자가 카드 선택 시 추가할 수 있는 카드사 목록을 설정할 수 있습니다.

데이터 예시

const CARD_COMPANY: Record<number, CardCompany> = {
  1: { name: '포코 카드', color: 'purple', icon: '👾' },
  2: { name: '준 카드', color: 'yellow', icon: '😆' },
  3: { name: '공원 카드', color: 'sky', icon: '🌳' },
  4: { name: '월터 카드', color: 'white', icon: '👻' },
  5: { name: '리트 카드', color: 'white', icon: '🎬' },
  6: { name: '로이 카드', color: 'yellow', icon: '🚀' },
  7: { name: '헤인티 카드', color: 'orange', icon: '🌻' },
  8: { name: '발리스타 카드', color: 'purple', icon: '⭐️' },
  9: { name: '아사 카드', color: 'sky', icon: '🥛' },
  10: { name: '콤피 카드', color: 'green', icon: '🦖' },
};
  • id 값은 cardList의 companyId로 연결됩니다.

amountPaid : number

결제 금액을 설정할 수 있습니다. number 타입으로 값을 전달해주세요.

onClickPayment (cardId : string)

결제 버튼을 클릭할 시 발생될 이벤트입니다. 사용자가 선택한 카드의 id(string) 값이 첫번째 매개변수로 전달됩니다.

onClickCancel

결제를 취소할 시 발생될 이벤트입니다. 이벤트 객체가 첫번째 매개변수로 전달됩니다.

onUpdatedCardData

카드 정보를 추가 / 제거 / 업데이트할 시 발생될 이벤트입니다. 최신화된 카드 목록이 첫번째 매개변수로 전달됩니다.

<CardWalletApp
  onUpdatedCardData={(cardList) => { 
    /* 카드 정보 업데이트(추가/제거/편집) 시 발생될 이벤트 */
    console.log(`저장된 카드 목록 배열 : ${cardList}`);
  }} 
/>

/*
- 카드 추가, 편집, 제거 시 아래와 같이 배열을 반환합니다.

[
  {
    id: '아이디 (문자열)',
    cardName: '카드명',
    companyId: '회사 아이디(companyList의 아이디 값)',
    cardNumber: ['1234', '1234', '1234', '1234'],
    expireMonth: '12',
    expireYear: '25',
    userName: '카드 소유자 이름',
    securityCode: '123',
    cardPassword: '23',
  },
  {
    id: '아이디 (문자열)',
    cardName: '카드명',
    companyId: '회사 아이디(companyList의 아이디 값)',
    cardNumber: ['1234', '1234', '1234', '1234'],
    expireMonth: '12',
    expireYear: '25',
    userName: '카드 소유자 이름',
    securityCode: '123',
    cardPassword: '23',
  },
];

*/

스타일 가이드

이 컴포넌트는 부모 엘리먼트의 font-size를 따라갑니다. 컴포넌트 내 요소의 전반적인 글씨 크기를 조절하고 싶으시다면 상위 컨테이너에서 font-size를 설정하여주세요.

<div style={{font-size: '18px'}}>
  <Payment/>
</div>