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 🙏

© 2024 – Pkg Stats / Ryan Hefner

cordova-plugin-iamport-kcp

v0.9.9

Published

Cordova Plugin for KCP Payment via Iamport

Downloads

18

Readme

cordova-plugin-iamport-kcp

아임포트 KCP결제 및 휴대폰 본인인증을 cordova 환경에서 연동하기 위한 플러그인입니다.

준비 사항

결제테스트까지 수행하기 위해서는 아임포트 관리자 페이지 에서 계정 생성이 필요합니다.
계정 생성 후 시스템 설정 > 내정보에서 발급된 가맹점식별코드 확인이 필요합니다.

설치

이 플러그인은 아임포트 연동에 맞게 커스터마이즈된 inappbrowser(fork 버전) 플러그인을 의존합니다.

아래 명령어에 기재된 cordovakcp는 실제 사용을 원하는 scheme 값으로 대체하여 설치하면 됩니다.(개발 중인 앱을 대표할 수 있는 문자열로 다른앱과 겹치지 않게 고유한 값을 사용해주세요)

cordova plugin add cordova-plugin-iamport-kcp --variable URL_SCHEME=cordovakcp --save

플러그인 설치가 되면 javascript module이 자동 복사/등록됩니다.(cordova-iamport.js)

결제가 필요한 순간에 다음과 같이 javascript 호출을 통해 inappbrowser를 통해 결제 프로세스를 시작할 수 있습니다.

CordovaIamport.payment(user_code, param, callback)

휴대폰 본인인증은 다음의 javascript 호출을 통해 가능합니다.

CordovaIamport.certification(user_code, param, callback)

1. 특징

cordova 특성상 inappbrowser를 통해 결제프로세스가 진행되므로 모바일 브라우저 연동과는 다소 차이가 있습니다. m_redirect_url속성을 overwrite하여 inappbrowser결제를 구현하고 있기 때문에 다음과 같은 차이점이 있습니다.
(참조 : cordova-iamport.js)

  • m_redirect_url속성을 선언할 필요가 없음(선언해도 overwrite됨)
  • callback에 전달되는 rsp속성이 제한됨(success, imp_uid, merchant_uid, error_msg 뿐)

2. 결제연동 Example

CordovaIamport.payment('imp33886024', {
    pay_method : 'card',
    merchant_uid : 'merchant_' + new Date().getTime(),
    name : '주문명:결제테스트',
    amount : 1400,
    buyer_email : '[email protected]',
    buyer_name : '구매자이름',
    buyer_tel : '010-1234-5678',
    buyer_addr : '서울특별시 강남구 삼성동',
    buyer_postcode : '123-456'
}, function(rsp) {
    if ( rsp.success ) {
        var msg = '결제가 완료되었습니다.';
        msg += '고유ID : ' + rsp.imp_uid;
        msg += '상점 거래ID : ' + rsp.merchant_uid;
    } else {
        var msg = '결제에 실패하였습니다.';
        msg += '에러내용 : ' + rsp.error_msg;
    }
    alert(msg);
});

3. 본인인증 Example

CordovaIamport.payment('가맹점식별코드', {
    name : '홍길동'
}, function(rsp) {
    if ( rsp.success ) {
        var msg = '본인인증이 완료되었습니다.';
        msg += '고유ID : ' + rsp.imp_uid;
    } else {
        var msg = '본인인증에 실패하였습니다.';
        msg += '에러내용 : ' + rsp.error_msg;
    }
    alert(msg);
});