{"_id":"1d3-sdk","_rev":"1-3d3e10e83cf2154140523bfece58449d","name":"1d3-sdk","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"1d3-sdk","version":"1.0.0","description":"1D3 Javascript package","main":"index.js","scripts":{"lint":"eslint .","test":"jest"},"jest":{"testPathIgnorePatterns":["<rootDir>/__tests__/data/","<rootDir>/__tests__/mock/","<rootDir>/node_modules/","<rootDir/index.js"]},"repository":{"type":"git","url":"git+https://github.com/dev1d3/checkoutpage-sdk-js.git"},"license":"MIT","devDependencies":{"eslint":"^4.19.1","eslint-config-airbnb-base":"^13.0.0","eslint-plugin-import":"^2.13.0","jest":"^23.2.0"},"bugs":{"url":"https://github.com/dev1d3/checkoutpage-sdk-js/issues"},"homepage":"https://github.com/dev1d3/checkoutpage-sdk-js#readme","_id":"1d3-sdk@1.0.0","_nodeVersion":"12.22.9","_npmVersion":"8.5.1","dist":{"integrity":"sha512-w41Atcpky34EcWso7iFIYPCURcjWOEn9+0q8sXk2Q9nL6yQxBt4E+uXMKgdPis7MezV69VsCCzo9sN4Ovpp7Bg==","shasum":"15f03592efb986359f08f63ff302e2b81abfc1f1","tarball":"https://registry.npmjs.org/1d3-sdk/-/1d3-sdk-1.0.0.tgz","fileCount":8,"unpackedSize":9042,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFrfBnjBN4mf8II05a7bwy1FmDMrNPPZoo1VvKzfHT9hAiAowaSiToaNksBDz/Gfs6/IvTE7cuQPFvD+U4C8ly0vbQ=="}]},"_npmUser":{"name":"1d3","email":"developers@1d3.com"},"directories":{},"maintainers":[{"name":"1d3","email":"developers@1d3.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/1d3-sdk_1.0.0_1702569546669_0.0951013883254952"},"_hasShrinkwrap":false},"1.0.1":{"name":"1d3-sdk","version":"1.0.1","description":"1D3 Javascript package","main":"index.js","scripts":{"lint":"eslint .","test":"jest"},"jest":{"testPathIgnorePatterns":["<rootDir>/__tests__/data/","<rootDir>/__tests__/mock/","<rootDir>/node_modules/","<rootDir/index.js"]},"repository":{"type":"git","url":"git+https://github.com/dev1d3/checkoutpage-sdk-js.git"},"license":"MIT","devDependencies":{"eslint":"^4.19.1","eslint-config-airbnb-base":"^13.0.0","eslint-plugin-import":"^2.13.0","jest":"^23.2.0"},"bugs":{"url":"https://github.com/dev1d3/checkoutpage-sdk-js/issues"},"homepage":"https://github.com/dev1d3/checkoutpage-sdk-js#readme","_id":"1d3-sdk@1.0.1","_nodeVersion":"12.22.9","_npmVersion":"8.5.1","dist":{"integrity":"sha512-klz7qoWzZDWeiY9U3zMEnQwRz/7cr2Jit1rvRxOnQPAtOM/LS4XbjunHqaA95OAIavDBZRK23qH0FtU6W+rS3w==","shasum":"d6c92b87907872ffcfecb8ba8b72e46145909d48","tarball":"https://registry.npmjs.org/1d3-sdk/-/1d3-sdk-1.0.1.tgz","fileCount":8,"unpackedSize":9059,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEPZSuvkghaUQ96fvwOfm+8n2icCa7ZIWbizIIbQk6kmAiBJi6bXj/ugaV9C2qJlM92ukaxZMFyvT2i4t7Ofc5JaKg=="}]},"_npmUser":{"name":"1d3","email":"developers@1d3.com"},"directories":{},"maintainers":[{"name":"1d3","email":"developers@1d3.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/1d3-sdk_1.0.1_1702570097934_0.7951777689873474"},"_hasShrinkwrap":false}},"time":{"created":"2023-12-14T15:59:06.668Z","1.0.0":"2023-12-14T15:59:06.911Z","modified":"2023-12-14T16:08:18.257Z","1.0.1":"2023-12-14T16:08:18.080Z"},"maintainers":[{"name":"1d3","email":"developers@1d3.com"}],"description":"1D3 Javascript package","homepage":"https://github.com/dev1d3/checkoutpage-sdk-js#readme","repository":{"type":"git","url":"git+https://github.com/dev1d3/checkoutpage-sdk-js.git"},"bugs":{"url":"https://github.com/dev1d3/checkoutpage-sdk-js/issues"},"license":"MIT","readme":"# 1D3 Javascript package\n\n### What is it?\n\nIt is package that will help you with generating payment URL according to \n[1D3 documentation](https://docs.1d3.com/en/en_PP_Integration.html).\n\n### How to use?\n\n#### Get checkout page URL\n\n1. Install the package (with your package manager):\n```shell\nnpm install 1d3-sdk\nyarn add 1d3-sdk\n```\n\n2. Require somewhere in your code, set parameters and get the URL:\n```javascript\nconst { Payment } = require('1d3-sdk');\n\n// create Payment object with your account ID and secret salt\nconst e = new Payment('112', 'my_secret');\n\n// set payment details \ne.paymentAmount = 1000;\ne.paymentId = 'FFCD12-30';\ne.paymentCurrency = 'USD';\n\n// set another parameters, like success or fail callback URL, customer details, etc.\n\n// get payment URL\nconst url = e.getUrl();\n```\n\nNow your can render payment `url` somewhere on your checkout page.\n\n#### Receive callback from 1D3\n\nExample with [Express](http://expressjs.com):\n```javascript\nconst { Callback } = require('1d3-sdk');\n\napp.post('/payment/callback', function(req, res) {\n  const callback = new Callback('secret', req.body);\n  if (callback.isPaymentSuccess()) {\n    const paymentId = callback.getPaymentId();\n    // here is your code for success payment\n  }\n});\n```\nNote that `Callback` constructor throws Error if signature isn't valid.\n\n","readmeFilename":"README.md"}