{"_id":"2checkout-nodejs","_rev":"2-1684eea1319c88f27eb5106c063a1f66","name":"2checkout-nodejs","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"2checkout-nodejs","version":"0.0.1","description":"A node.js wrapper for the 2Checkout Payment API.","author":{"name":"Simon Achkar","email":"alachkarsimon@gmail.com"},"main":"lib/2checkout.js","repository":{"type":"git","url":"git+ssh://git@github.com/2Checkout/2checkout-node.git"},"engines":{"node":">= v0.8.0"},"devDependencies":{"mocha":"~1.13.0"},"dependencies":{"request":"2.x.x"},"gitHead":"4a3da87ed876733c3af6162c8df4f2062a1b8960","bugs":{"url":"https://github.com/2Checkout/2checkout-node/issues"},"homepage":"https://github.com/2Checkout/2checkout-node#readme","_id":"2checkout-nodejs@0.0.1","_npmVersion":"6.3.0","_nodeVersion":"8.11.3","_npmUser":{"name":"simonachkar","email":"alachkarsimon@gmail.com"},"dist":{"integrity":"sha512-8XpVWEFgMbLNmyCZSWzf3BUx9fFQBByQ2xsm/2S31RbOz/EK+AzXo9gbdpnRyMP/FGUp1YDQpkCtrg6QHI/ZHA==","shasum":"487118c82352ed20c30c280d3b754500e2859e1c","tarball":"https://registry.npmjs.org/2checkout-nodejs/-/2checkout-nodejs-0.0.1.tgz","fileCount":24,"unpackedSize":34639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDoJwCRA9TVsSAnZWagAAsKIQAJreva/80hiyaWDfV6yw\n380tjZwYRAY9XzegITgkTXncS1nVGa57iyMv6uqCYeXRGIOTC4wAjNFNmuRq\ngg2WeTwGyPtLRi3mU1ODgYnqJHWQ4hLpDGW9MZ7udCyXb/6zS2JsmbHT+y2T\nyojQEtt4Iykt7FKhuyf5xGglvVnjRWENP30WHQlOhnOQNf9QiWrcKBi4Vjsc\n/63EM0l6U5aD/QQPaucvHM3z7Jez6C3r2i5p748wqYN9zRIJj18/m+BZtm9Y\n4+kW2zJnXKwhlg9lhi2jupfQ4a515PmAkoI3CDZFbFP2u21x8ny+icnFJdcL\nhlPyVpt7zeZqlCVf3X0dSy4UKy//2LhbpGLHoH7PYy6Mqre31wjvxlp5zVkN\nXOjzzmtGw87bfg2LfKHOoeRJSUSufVp2qI8pIvdH9pXx/5NrebDszdJHrBpZ\niwpzGZbmFwSBwZy6PdNj0HTbyIuRpLrQi6UXqzEQ5oTilpzJMs94O0KRcVlo\nX52btJaFpOxIjpkYVptKBvNPiXKdJmm1ZSgaRvIqQUjqtrLAT0cLWCNi5K7K\nAy8bhMK/5kFEuinjT9duKoKY2kCjdex2trP76S2FE8TzmOdhmoEZUl544enZ\ni0d2cGRxohP+Ntfm1dA0BR0xWb4tB05yqT6qSgfIL0K4wMIHyvT2HsxnGBhq\nwzDs\r\n=Xef3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF6k2Nk8A3E0X5B/RSuxmUE9YHEUNTbZ5YWrXoMh0P07AiB+isDwBUt0wd9jvvGCoL8CmvdkUFcZlKAm1jApzl2svg=="}]},"maintainers":[{"name":"simonachkar","email":"alachkarsimon@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/2checkout-nodejs_0.0.1_1544454767820_0.9627255703533464"},"_hasShrinkwrap":false},"0.0.2":{"name":"2checkout-nodejs","version":"0.0.2","description":"A node.js wrapper for the 2Checkout Payment API.","author":{"name":"Simon Achkar","email":"alachkarsimon@gmail.com"},"main":"lib/2checkout.js","repository":{"type":"git","url":"git+ssh://git@github.com/2Checkout/2checkout-node.git"},"engines":{"node":">= v0.8.0"},"devDependencies":{"mocha":"~1.13.0"},"dependencies":{"request":"2.x.x"},"gitHead":"f945bbd9f2757a9e06151ab98362edbca1c292f7","bugs":{"url":"https://github.com/2Checkout/2checkout-node/issues"},"homepage":"https://github.com/2Checkout/2checkout-node#readme","_id":"2checkout-nodejs@0.0.2","_npmVersion":"6.3.0","_nodeVersion":"8.11.3","_npmUser":{"name":"simonachkar","email":"alachkarsimon@gmail.com"},"dist":{"integrity":"sha512-jq0ixfZJOxDJe3FQo8LiFBrpU5MxjhlqAxYSEvK8WfM0xNlw12WCnpUzxnoku7MiabLR+PhXPp2vShSGcp4fqg==","shasum":"3bacdd29b87122fabcf68cb2d1319944b875b2c6","tarball":"https://registry.npmjs.org/2checkout-nodejs/-/2checkout-nodejs-0.0.2.tgz","fileCount":24,"unpackedSize":34612,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDpUvCRA9TVsSAnZWagAAlokP/2xDIkZqGc0hBPiwXJuY\nmldQAcnFH7VyFdaWTGXOOj+J3SzuN+PHgvbwjVB5DQPT9m1nCLKLkoS7XgKb\nnlUWE9xySoQhdfvMtjF1G/WYUV7+Gy6jmJk+oiiFLI6xndi4N1aiOZ0Lr9AT\nvWUCaAtHcPFt8FGBxZPh9NJf7BwT136OWGuzcs4V2ubstFzrJnjkW7+Fw3Ao\nFYg+dsCspVnQVGedTPFKrkSL2UwHOxrWY1EgEqUV5cYWx12oyQx0tyxEns5X\nXv7HzDgQeDmqGDnV+JpV+UMVkUEz4rDivuwHU2+17kzB5wFQdR1d7ZrtrZvJ\no7TkKahnS4qYP6hRdBCs5cADcVSnFdWUKS/qsUPvmn/BN1WJo0Wp20J4M5XY\numBph1kEhPAK0f1cZP/g+KMh6fBUu4mUWgGNeAC+PfJmK3ZGfblCvFjFP5H/\nCpDq5mYr17aXl6Nl5ZKB3SL2Ko/ZDfAEqbDUrEgv+1E85S4Ewny9gcF7jJWz\ncX+txSPL+T7pp320fas6r55onV7BX9oT3tJOqjBsSFS8RcRiFT3bVOCFSTi4\nRqKvvHLIk836j04sIDrZvmPQWTh6+BkJuJWrL3MnRDSDqJuG1vQxY0cu3/z2\nrQ93bYFuBn8W8/ntDUX8cfOO5/ep2eMXKqyq1amNrnCUB2+QKooBOnv+ulmf\nrXe0\r\n=0JXX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCf2CVneGTufUy5BTaYQWicWRHjSXiU2HEFL9lurRcczgIgV5jTr1kzwDKg7O8aLJW0albnUN5d4kBDigKrpXHMe5o="}]},"maintainers":[{"name":"simonachkar","email":"alachkarsimon@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/2checkout-nodejs_0.0.2_1544459566391_0.6279498499256362"},"_hasShrinkwrap":false}},"time":{"created":"2018-12-10T15:12:47.820Z","0.0.1":"2018-12-10T15:12:47.942Z","modified":"2022-04-04T10:18:50.005Z","0.0.2":"2018-12-10T16:32:46.567Z"},"maintainers":[{"name":"simonachkar","email":"alachkarsimon@gmail.com"}],"description":"A node.js wrapper for the 2Checkout Payment API.","homepage":"https://github.com/2Checkout/2checkout-node#readme","repository":{"type":"git","url":"git+ssh://git@github.com/2Checkout/2checkout-node.git"},"author":{"name":"Simon Achkar","email":"alachkarsimon@gmail.com"},"bugs":{"url":"https://github.com/2Checkout/2checkout-node/issues"},"readme":"2Checkout Node.js Library\n=====================\n\nFull documentation for each binding is provided in the **[wiki](https://github.com/2Checkout/2checkout-node/wiki)**.\n\nThis library is forked from the [original 2Checkout Node.js Library](https://github.com/2Checkout/2checkout-node). The difference is that you don't need to clone and then install (which will install to local file)\n\n\n\nTo use just install with npm.\n\n```shell\nnpm install 2checkout-nodejs --save\n```\n\nThen you can require the module and setup the 2Checkout object with a number of options shown below.\n\n```javascript\n// Require the module\nvar Twocheckout = require('2checkout-node');\n\n// Pass in your private key and seller ID\nvar tco = new Twocheckout({\n    apiUser: \"APIuser1817037\",                              // Admin API Username, required for Admin API bindings\n    apiPass: \"APIpass1817037\",                              // Admin API Password, required for Admin API bindings\n    sellerId: \"1817037\",                                    // Seller ID, required for all non Admin API bindings \n    privateKey: \"3508079E-5383-44D4-BF69-DC619C0D9811\",     // Payment API private key, required for checkout.authorize binding\n    secretWord: \"tango\",                                    // Secret Word, required for response and notification checks\n    demo: true,                                             // Set to true if testing response with demo sales\n    sandbox: false                                          // Uses 2Checkout sandbox URL for all bindings\n});\n```\n\nExample Payment API Usage\n-----------------\n\n*Example Request:*\n\n```javascript\n// Setup the authorization object\nvar params = {\n    \"merchantOrderId\": \"123\",\n    \"token\": \"MWQyYTI0ZmUtNjhiOS00NTIxLTgwY2MtODc3MWRlNmZjY2Jh\",\n    \"currency\": \"USD\",\n    \"total\": \"10.00\",\n    \"billingAddr\": {\n        \"name\": \"Testing Tester\",\n        \"addrLine1\": \"123 Test St\",\n        \"city\": \"Columbus\",\n        \"state\": \"Ohio\",\n        \"zipCode\": \"43123\",\n        \"country\": \"USA\",\n        \"email\": \"example@2co.com\",\n        \"phoneNumber\": \"5555555555\"\n    }\n};\n\n// Make the call using the authorization object and your callback function\ntco.checkout.authorize(params, function (error, data) {\n    if (error) {\n        console.log(error.message);\n    } else {\n        console.log(JSON.stringify(data));\n    }\n});\n```\n\n*Example Response:*\n\n```json\n{\n    \"validationErrors\": null,\n    \"response\": {\n        \"type\": \"AuthResponse\",\n        \"currencyCode\": \"USD\",\n        \"lineItems\": [\n            {\n                \"description\": \"\",\n                \"duration\": \"1 Year\",\n                \"options\": [],\n                \"price\": \"6.99\",\n                \"quantity\": \"2\",\n                \"recurrence\": \"1 Month\",\n                \"startupFee\": null,\n                \"productId\": \"123\",\n                \"tangible\": \"N\",\n                \"name\": \"Demo Item 1\",\n                \"type\": \"product\"\n            },\n            {\n                \"description\": \"\",\n                \"duration\": null,\n                \"options\": [\n                    {\n                        \"optName\": \"Size\",\n                        \"optValue\": \"Large\",\n                        \"optSurcharge\": \"1.00\"\n                    }\n                ],\n                \"price\": \"1.99\",\n                \"quantity\": \"1\",\n                \"recurrence\": null,\n                \"startupFee\": null,\n                \"productId\": \"\",\n                \"tangible\": \"N\",\n                \"name\": \"Demo Item 2\",\n                \"type\": \"product\"\n            },\n            {\n                \"description\": \"\",\n                \"duration\": null,\n                \"options\": [],\n                \"price\": \"3.00\",\n                \"quantity\": \"1\",\n                \"recurrence\": null,\n                \"startupFee\": null,\n                \"productId\": \"\",\n                \"tangible\": \"Y\",\n                \"name\": \"Shipping Fee\",\n                \"type\": \"shipping\"\n            }\n        ],\n        \"transactionId\": \"205203115673\",\n        \"billingAddr\": {\n            \"addrLine1\": \"123 Test St\",\n            \"addrLine2\": null,\n            \"city\": \"Columbus\",\n            \"zipCode\": \"43123\",\n            \"phoneNumber\": \"5555555555\",\n            \"phoneExtension\": null,\n            \"email\": \"example@2co.com\",\n            \"name\": \"Testing Tester\",\n            \"state\": \"Ohio\",\n            \"country\": \"USA\"\n        },\n        \"shippingAddr\": {\n            \"addrLine1\": \"123 Test St\",\n            \"addrLine2\": \"\",\n            \"city\": \"Columbus\",\n            \"zipCode\": \"43123\",\n            \"phoneNumber\": null,\n            \"phoneExtension\": null,\n            \"email\": null,\n            \"name\": \"Testing Tester\",\n            \"state\": \"OH\",\n            \"country\": \"USA\"\n        },\n        \"merchantOrderId\": \"123\",\n        \"orderNumber\": \"205203115664\",\n        \"recurrentInstallmentId\": null,\n        \"responseMsg\": \"Successfully authorized the provided credit card\",\n        \"responseCode\": \"APPROVED\",\n        \"total\": \"19.97\",\n        \"errors\": null\n    },\n    \"exception\": null\n}\n```\n\nExample Admin API Usage\n-----------------\n\n*Example Request:*\n\n```javascript\ntco.sales.retrieve({sale_id: 205203115664}, function (error, data) {\n    if (error) {\n        console.log(error);\n    } else {\n        console.log(data);\n    }\n});\n```\n\nExample Checkout Usage:\n-----------------------\n\n*Example Request:*\n\n```javascript\n// Setup checkout params\nvar params = {\n    mode: '2CO',\n    li_0_name: 'Test Product',\n    li_0_price: '0.01'\n};\n\n// Get a URL encoded payment link\nvar link = tco.checkout.link(params);\n```\n\n*Example Response:*\n```javascript\nhttps://www.2checkout.com/checkout/purchase?mode=2CO&li_0_name=Test%20Product&li_0_price=0.01&sid=1817037\n```\n\nExample Return Usage:\n---------------------\n\n*Example Request (Using Express):*\n\n```javascript\nif (tco.response.valid(request.body), 0.01) {\n    response.send(\"Valid\");\n} else {\n    response.send(\"Invalid\");\n}\n```\n\nExample INS Notifications Usage:\n------------------\n\n*Example Usage (Using Express):*\n\n```javascript\nif (tco.notification.valid(request.body)) {\n    response.send(\"Valid\");\n} else {\n    response.send(\"Invalid\");\n}\n```\n\nExceptions:\n-----------\nErrors are returned as the first argument to your callback if they occur. It is best to always check for these before attempting to work with the response.\n\n*Example*\n\n```javascript\ntco.checkout.authorize(params, function (error, data) {\n    if (error) {\n        console.log(error.message);\n    } else {\n        console.log(JSON.stringify(data));\n    }\n});\n```\n\nFull documentation for each binding is provided in the **[wiki](https://github.com/2Checkout/2checkout-node/wiki)**.\n","readmeFilename":"README.md"}