Skip to content

cereme/react-use-iamport

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

react-use-iamport

npm version npm downloads license bundle size

Install

yarn add react-use-iamport

How to use

import useIamport from 'react-use-iamport';

function Page() {
  const [loaded, requestPay] = useIamport('impYourID');

  const impParams = {
    pg: 'kcp',
    pay_method: 'card',
    merchant_uid: 'test',
    name: 'test order title',
    amount: 3900,
    buyer_email: 'ceremebsy@gmail.com',
    buyer_name: 'cereme',
  };

  const onRequestPay = () => {
    requestPay(impParams, console.log, console.log);
  };

  return (
    <div>
      {!loaded && <p> loading useIamport </P>}
      {loaded && <button onClick={onRequestPay}>Request Pay!</button>}
    </div>
  );
}

About

Iamport React custom hook Wrapper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published