{"_id":"2co-client","_rev":"59-63022eb5832e4c95872f787c5af2133d","name":"2co-client","description":"A low-level HTTP client for the 2checkout API","dist-tags":{"latest":"0.0.15"},"versions":{"0.0.11":{"name":"2co-client","version":"0.0.11","description":"A low-level HTTP client for the 2checkout API","main":"index.js","repository":{"type":"git","url":"https://github.com/errorception/2co-client.git"},"author":{"name":"Rakesh Pai","email":"rakeshpai@errorception.com"},"license":"MIT","keywords":["2checkout","2co","payment","payment gateway"],"dependencies":{"request":"~2.21.0","node_hash":"~0.2.0"},"bugs":{"url":"https://github.com/errorception/2co-client/issues"},"_id":"2co-client@0.0.11","dist":{"shasum":"f17c6d2c0ace5e4f747683d0b647b521239f1882","tarball":"https://registry.npmjs.org/2co-client/-/2co-client-0.0.11.tgz","integrity":"sha512-Q4MvuAT4zWCLokx0H4A1TozC2myoWkPflhTpiZCYwgNFltvAOGu5/e2p8eQyvac5BTGLy4rv6KVYWqWxlWPMUQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFDnBzpPCCQNczGj5/voYvYALxraup1vuNc4YHboKImMAiEAmOabqlNvXTA3ijhqcbLrUzPWS9HJsV1I1pMs/mQXMVs="}]},"_from":".","_npmVersion":"1.3.0","_npmUser":{"name":"rakeshpai","email":"rakeshpai@errorception.com"},"maintainers":[{"name":"rakeshpai","email":"rakeshpai@errorception.com"}],"directories":{}},"0.0.12":{"name":"2co-client","version":"0.0.12","description":"A low-level HTTP client for the 2checkout API","main":"index.js","repository":{"type":"git","url":"https://github.com/errorception/2co-client.git"},"author":{"name":"Rakesh Pai","email":"rakeshpai@errorception.com"},"license":"MIT","keywords":["2checkout","2co","payment","payment gateway"],"dependencies":{"request":"~2.21.0","node_hash":"~0.2.0"},"bugs":{"url":"https://github.com/errorception/2co-client/issues"},"_id":"2co-client@0.0.12","dist":{"shasum":"c8ee2b9d6fc47b095e25b8e74c0836a6d1c6913b","tarball":"https://registry.npmjs.org/2co-client/-/2co-client-0.0.12.tgz","integrity":"sha512-6+Gp6QzcDcBkn/VATQM619MMZ9eFe5I9t8gH6v7bNh4cCYh1doLyNUT/vH73ORCmpblt8ner5Qgio0UD10ob3A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtXlnAlVrbV6nMf0W2lIg3Ivr1zqhsxX1j4dOOpJe6XgIhAMuh56hNjuzDOerffyhl2D+58dhA3r5z1R2e6OQovvlq"}]},"_from":".","_npmVersion":"1.3.0","_npmUser":{"name":"rakeshpai","email":"rakeshpai@errorception.com"},"maintainers":[{"name":"rakeshpai","email":"rakeshpai@errorception.com"}],"directories":{}},"0.0.13":{"name":"2co-client","version":"0.0.13","description":"A low-level HTTP client for the 2checkout API","main":"index.js","repository":{"type":"git","url":"git+https://github.com/errorception/2co-client.git"},"author":{"name":"Rakesh Pai","email":"rakeshpai@errorception.com"},"license":"MIT","keywords":["2checkout","2co","payment","payment gateway"],"dependencies":{"node_hash":"~0.2.0","request":"^2.75.0"},"gitHead":"47054d5ee540642ff61b1a58a25c9c037b3bf9a2","bugs":{"url":"https://github.com/errorception/2co-client/issues"},"homepage":"https://github.com/errorception/2co-client#readme","_id":"2co-client@0.0.13","scripts":{},"_shasum":"03bf010d4275d32f4b2a79b7e441f312bf54e07e","_from":".","_npmVersion":"3.10.7","_nodeVersion":"6.4.0","_npmUser":{"name":"rakeshpai","email":"rakeshpai@errorception.com"},"maintainers":[{"name":"rakeshpai","email":"rakeshpai@errorception.com"}],"dist":{"shasum":"03bf010d4275d32f4b2a79b7e441f312bf54e07e","tarball":"https://registry.npmjs.org/2co-client/-/2co-client-0.0.13.tgz","integrity":"sha512-q0twuYeWyEYN4F6ZHl02Iq/fXoAWefEQVsHrQzKXAkCqfBgVNfba89iYRqdELY/Iovf3s2a5c2hUgQ5iJKAKuA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTBg4w4SzLXDPG9jVVgYH25sr7ocDhGCkb0EE5jZv4ZAIhAIJHdKpltnlC01C1fh5ginnw2WiI9MEdrk4j9RG3ek2M"}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/2co-client-0.0.13.tgz_1474271233983_0.08863374497741461"},"directories":{}},"0.0.14":{"name":"2co-client","version":"0.0.14","description":"A low-level HTTP client for the 2checkout API","main":"index.js","repository":{"type":"git","url":"git+https://github.com/errorception/2co-client.git"},"author":{"name":"Rakesh Pai","email":"rakeshpai@errorception.com"},"license":"MIT","keywords":["2checkout","2co","payment","payment gateway"],"dependencies":{"node_hash":"~0.2.0","request":"^2.75.0"},"gitHead":"420250751419b0063aec5616f608599c55ec65e1","bugs":{"url":"https://github.com/errorception/2co-client/issues"},"homepage":"https://github.com/errorception/2co-client#readme","_id":"2co-client@0.0.14","_npmVersion":"5.5.1","_nodeVersion":"8.8.1","_npmUser":{"name":"rakeshpai","email":"rakeshpai@gmail.com"},"dist":{"integrity":"sha512-aJ16O3ikukMl9OY4Gtvt3eb21aDf1M3/Xpj5WtfKDaa0yrxqpk4XtFkqCz/L25B8kn0pQlU97KGuzhL2BHmS4A==","shasum":"42c54404b122885932afbd106101bca42c833f7b","tarball":"https://registry.npmjs.org/2co-client/-/2co-client-0.0.14.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHOZycu04oPOswtowAk9xyLqnyrzBEXFVw5hD0bJFQxLAiEA8Rr4UnQBIpPdZ6xqYeBQcpicD6YVy5V+hy0h12sVoCo="}]},"maintainers":[{"name":"rakeshpai","email":"rakeshpai@errorception.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/2co-client-0.0.14.tgz_1510559047700_0.38453929778188467"},"directories":{}},"0.0.15":{"name":"2co-client","version":"0.0.15","description":"A low-level HTTP client for the 2checkout API","main":"index.js","repository":{"type":"git","url":"git+https://github.com/errorception/2co-client.git"},"author":{"name":"Rakesh Pai","email":"rakeshpai@errorception.com"},"license":"MIT","keywords":["2checkout","2co","payment","payment gateway"],"dependencies":{"node_hash":"~0.2.0","request":"^2.88.0"},"gitHead":"32b4001120b68786bceeb781a278ea279144204d","bugs":{"url":"https://github.com/errorception/2co-client/issues"},"homepage":"https://github.com/errorception/2co-client#readme","_id":"2co-client@0.0.15","_nodeVersion":"8.8.1","_npmVersion":"6.7.0","dist":{"integrity":"sha512-6IWlkzBZGAsHZPfeXbvfUJURdCzkf43fqvcbXEyeiH7LugAty8YalDwZqD8g+ef3W9M7vzb/y7i5QXJpoX9Qhw==","shasum":"ec57aebdd0c21eb806e2ab27cfecb5696e6c2420","tarball":"https://registry.npmjs.org/2co-client/-/2co-client-0.0.15.tgz","fileCount":3,"unpackedSize":11703,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcYClKCRA9TVsSAnZWagAApFQQAJviPKurHBka/8DFJe6r\n5D7lWFlhBThTmrgMz+Iw9LBfcY24hBQLB9x23XHMD/k8ugYNdf6XXuikWioP\naAJmEjSIja2e9mj/PZr4gMjgCYQariaIdMCz6n+IbAYWXgWnnjcJS/xeXVJP\nYotzfB+IsXrtYgP16nedExLtr9K4b/7rywbmQmWgcBzEmut9CcTXqoratMGj\n1DHPe4ArXh5htkA4rLIDc6A64iBX9MQD+tgfFdBMtF+MynW06URmpMLPompH\ntILwbeTKl/RXtI3BFSDqdG2JatT1NKgMUbQW3MWg155f3coV6yRlM5dcjfLP\n2iRzmcLEvJKVD5ZfsYyx8D4Mq/6bvJ3XfkuX9wj7+kUoIb24Xmof3XonmK8d\npkdRy9PxhixJ6+3wiIeo098vxHjl7EOUn6Wag3UGZt46VBh97eexeOcARYiI\nFo5ZaOrM7Z8+Owum2od0aWriBoL+eWzWOm3IgxBidizK+4JjWOGxfy/AdA7a\nvSoGPPLJyQ1rq2+xuVh5bjjUMhFZS47baCYq6LTQWGLf6IqAqyhJ1twD0h2q\nj9hdyYsUOTAiOfsnhMHXr2tsel2tu1sbfcFL9jmcYn5/eevus+i/CNagyOsq\n792jnOeQDS5rY9qM/S1g7//OaHdVo1BOrbkBjL7SLS4nE7o2WR2Hu75jXRlY\nesOV\r\n=BANU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGmkClG9hq0FMhe/Ji4Gyd189qlsbtotSRVakxmX0PmAIgZ3w0644Roa4hEBw+poXNiYB62xInG1jZGok0Zd/j4fw="}]},"maintainers":[{"name":"rakeshpai","email":"rakeshpai@errorception.com"}],"_npmUser":{"name":"rakeshpai","email":"rakeshpai@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/2co-client_0.0.15_1549805898291_0.36635165613940446"},"_hasShrinkwrap":false}},"readme":"**Unmaintained**: (2018-11-22) 2co has recently changed their API, and the new API is very different and vast. I don't need most of the things in the API, so it doesn't make sense for me to maintain a SDK for their API. While the code here works as of today, the API itself only works partially, and expect the API to be EOL'd soon.\n\n\n2co-client\n===\n\nA thin node.js client for the 2checkout API.\n\nIn production use, running the payment system at [Errorception](http://errorception.com/).\n\n## Installation\n\n```\n$ npm install 2co-client\n```\n\n## Usage\n\n```javascript\nvar client = require(\"2co-client\")(options);\n\nclient.sales.list(function(err, salesInformation) {\n\t// As you'd expect\t\n});\n```\n\n## Initialization\n\n```\nvar client = require(\"2co-client\")(options);\n```\n\n`options` is an object that can contain the following properties:\n* `username` Your 2checkout API user's username\n* `password` Your 2checkout API user's password\n* `secret` Your 2checkout secret\n* `logFile` (optional) The path to a file that this module should output logs to. Requests and responses are logged here.\n* `test` Enables demo mode. Bypasses INS and return data checks, and makes them always return true.\n\n## Methods\n\nThe methods provided by the client mirror the API endpoints as specified in the [2co Advanced User Guide [PDF]](https://www.2checkout.com/documentation/Advanced_User_Guide.pdf). It will be helpful to keep a copy of the user guide handy when using this module.\n\nAll methods take a callback as the last argument, in the typical node.js style. Some methods might take an optional first argument, which is expected to be an object. This object is used as the payload to be sent to the API.\n\nErrors will either be a JS Exception object if there was a problem with the network layer, or will be an array of objects if the API returned a 400/500 series error.\n\nA listing of API methods follows.\n\n### `client.account`\n\n* `client.account.companyInfo`: Retrieves your account's company information details. GETs `/acct/detail_company_info`.\n* `client.account.contactInfo`: Retrieve your account's contact information details. GETs `/acct/detail_contact_info`.\n* `client.account.pendingPayment`: Get a detailed estimate of the current pending payment. GETs `/acct/detail_pending_payment`.\n* `client.account.listPayments`: Get a list of past payments. GETs `/acct/list_payments`.\n\n### `client.sales`\n\n* `client.sales.details`: Retrieve information about a specific sale or invoice. GETs `/sales/detail_sale`.\n\n* `client.sales.list`: Retrieve a summary of all sales or only those matching a variety of sale attributes. GETs `/sales/list_sales`.\n\n* `client.sales.refundInvoice`: Attempts to issue a full or partial refund on an invoice. POSTs to `/sales/refund_invoice`.\n\n* `client.sales.refundLineitem`: Attempt to issue a full or partial refund on an invoice. POSTs to `/sales/refund_lineitem`.\n\n* `client.sales.stopLineitemRecurring`: Attempt to stop a recurring line item for a specified sale. POSTs to `/sales/refund_lineitem_recurring`.\n\n* `client.sales.markShipped`: Attempt to mark an order as shipped and will attempt to reauthorize sale if specified in call. POSTs to `/sales/mark_shipped`.\n\n* `client.sales.createComment`: Add a comment to a specified sale. POSTs to `/sales/create_comment`.\n\n### `client.products`\n\n* `client.products.details`: Retrieve the details for a single product. GETs `/products/detail_product`.\n\n* `client.products.list`: Retrieve list of all products in account. GETs `/products/list_products`.\n\n* `client.products.create`: Create a new product. POSTs to `/products/create_product`.\n\n* `client.products.update`: Update a product. POSTs to `/products/update_product`.\n\n* `client.products.del`: Deletes a product. POSTs to `/products/delete_product`.\n\n* `client.products.options.details`: Retrieve the details for a single option. GETs `/products/detail_options`.\n\n* `client.products.options.list`: Retrieve list of all options in account. GETs `/products/list_products`.\n\n* `client.products.options.create`: Create a new product option. POSTs to `/products/create_option`.\n\n* `client.products.options.update`: Updates a product option. POSTs to `/products/update_option`.\n\n* `client.products.options.del`: Deletes a product option. POSTs to `/products/delete_option`.\n\n* `client.products.coupons.details`: Retrieve the details for a single coupon. GETs `/products/detail_coupon`.\n\n* `client.products.coupons.list`: Retrieve list of all coupons in the account. GETs `/products/list_coupons`.\n\n* `client.products.coupons.create`: Creates a new coupon. POSTs to `/products/create_coupon`.\n\n* `client.products.coupons.update`: Updates a coupon. POSTs to `/products/update_coupon`.\n\n* `client.products.coupons.del`: Deletes a coupon. POSTs to `/products/delete_coupon`.\n\n## Additional methods\n\nThe following methods simplify some of the chores of working with the API.\n\n### `client.canTrustINS`\n\nChecks if the INS data returned by 2checkout is valid and not tampered with. You must pass `options.secret` when creating the client for this to work correctly. Will always return true if `options.test` is true. You must pass it the body of the HTTP POST you received, as a JSON object of key-value pairs. If you are using Express along with the `bodyParser`, the `req.body` already contains object as expected.\n\n### `client.canTrustReturnData`\n\nChecks if the return data from the purchase process by 2checkout is valid. You must pass `options.secret` when creating the client for this to work correctly. Will always return true if `options.test` is true. You must pass it the query string as a JSON object of key-value pairs. If you are using Express, the `req.query` already contains the object as expected.\n\n\n## License\n\nMIT\n","maintainers":[{"name":"rakeshpai","email":"rakeshpai@errorception.com"}],"time":{"modified":"2022-06-12T14:06:49.054Z","created":"2013-05-15T12:00:53.242Z","0.0.1":"2013-05-15T12:00:59.230Z","0.0.2":"2013-05-15T15:40:43.029Z","0.0.3":"2013-05-26T21:13:53.317Z","0.0.4":"2013-05-31T04:40:10.509Z","0.0.5":"2013-05-31T05:08:49.719Z","0.0.6":"2013-05-31T05:17:33.823Z","0.0.7":"2013-06-07T13:47:24.064Z","0.0.8":"2013-06-08T04:09:59.958Z","0.0.9":"2013-06-08T09:12:27.992Z","0.0.10":"2013-06-08T09:40:19.308Z","0.0.11":"2013-11-06T08:07:21.955Z","0.0.12":"2013-11-06T09:19:51.789Z","0.0.13":"2016-09-19T07:47:14.246Z","0.0.14":"2017-11-13T07:44:08.559Z","0.0.15":"2019-02-10T13:38:18.414Z"},"author":{"name":"Rakesh Pai","email":"rakeshpai@errorception.com"},"repository":{"type":"git","url":"git+https://github.com/errorception/2co-client.git"},"homepage":"https://github.com/errorception/2co-client#readme","keywords":["2checkout","2co","payment","payment gateway"],"bugs":{"url":"https://github.com/errorception/2co-client/issues"},"license":"MIT","readmeFilename":"README.md"}