react-use-iamport
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

react-use-iamport

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>
  );
}

Readme

Keywords

none

Package Sidebar

Install

npm i react-use-iamport

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

24.9 kB

Total Files

13

Last publish

Collaborators

  • cereme