{"_id":"@augustosamame/culqi-hook-v4","name":"@augustosamame/culqi-hook-v4","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@augustosamame/culqi-hook-v4","version":"0.0.1","author":{"name":"Augusto Samamé"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/augustosamame/culqi-hook.git"},"main":"dist/culqi-hook.js","scripts":{"format":"prettier --write '**'","build":"rm -rf dist && microbundle --external react --globals react=React --strict --no-compress"},"devDependencies":{"microbundle":"^0.11.0","parcel":"^1.12.3","parcel-bundler":"^1.12.3","prettier":"^1.17.1","react":"^16.8.6","react-dom":"^16.8.6"},"bugs":{"url":"https://github.com/augustosamame/culqi-hook/issues"},"gitHead":"18386d93ce864dc4af321542d1b69fe141e5883d","description":"The modern alternative to culqi checkout.","homepage":"https://github.com/augustosamame/culqi-hook#readme","_id":"@augustosamame/culqi-hook-v4@0.0.1","_nodeVersion":"12.22.9","_npmVersion":"6.14.15","dist":{"integrity":"sha512-iqDTYNAGQunaFoxUS/i8tOOcVBWe38qIYYR9PKWTFQ3rAuqQp3iZN4UTknTqGO1nwXtY0PBlw5Tpm54jC5RbGA==","shasum":"7e6e32b524d2ee04d7148263b96067fc12521b48","tarball":"https://registry.npmjs.org/@augustosamame/culqi-hook-v4/-/culqi-hook-v4-0.0.1.tgz","fileCount":9,"unpackedSize":34850,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGAwfzy+tXClE7uwmSme4kPwDiplB81ciFn6JJvTakWIAiADXZrYy2NpFNxgsh7tyD9Gr1Ix0BsJ5E75yBVClZvIVA=="}]},"_npmUser":{"name":"augustosamame","email":"augustosamame@gmail.com"},"directories":{},"maintainers":[{"name":"augustosamame","email":"augustosamame@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/culqi-hook-v4_0.0.1_1691725731111_0.8199261174781662"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-11T03:48:50.991Z","0.0.1":"2023-08-11T03:48:51.324Z","modified":"2023-08-11T03:48:51.604Z"},"maintainers":[{"name":"augustosamame","email":"augustosamame@gmail.com"}],"description":"The modern alternative to culqi checkout.","homepage":"https://github.com/augustosamame/culqi-hook#readme","repository":{"type":"git","url":"git+https://github.com/augustosamame/culqi-hook.git"},"author":{"name":"Augusto Samamé"},"bugs":{"url":"https://github.com/augustosamame/culqi-hook/issues"},"license":"MIT","readme":"# Culqi Hook\nThe modern alternative to culqi checkout.\n\nA small hook to integrate Culqi with the most recent react's feature: hooks.\nTested from React 16.8.1 upwards.\n\n## How to install\nWell, this is straightforward:\n\n```\nyarn add culqi-hook\n```\n\n## Documentation\nCurrently Culqi Hook doesn't have a full documentation, but you can read a full example [here](https://github.com/bregydoc/culqi-hook/blob/master/example/index.js)\n\n\n## A quick example\n\n```js\nimport { useCulqi } from \"culqi-hook\";\n\nconst App = () => {\n  const [result, createToken] = useCulqi(\"pk_test_POQJOT184VO1HOkc\");\n\n  const newToken = () => {\n    createToken({\n      cardNumber: \"4111111111111111\",\n      email: \"bregy.malpartida@utec.edu.pe\",\n      cvv: \"123\",\n      expirationYear: \"2020\",\n      expirationMonth: \"09\"\n    });\n  };\n\n  return (\n    <div>\n      <h1>culqi-hook, use example</h1>\n      <div>{result.ready ? \"Ready!\" : \"Starting...\"}</div>\n      <div>{result.loading ? \"Loading...\" : \"Loaded!\"}</div>\n      <br />\n      <div>\n        Result: {result.token ? \"[TOKEN] \" : result.error ? \"[ERROR] \" : \"\"}\n        {result.token ? result.token : \"\"}\n        {result.error ? result.error.userMessage : \"\"}\n      </div>\n      <button onClick={newToken}>Generate Token</button>\n    </div>\n  );\n};\n\nReactDOM.render(<App />, document.getElementById(\"root\"));\n\n```\n","readmeFilename":"README.md"}