{"_id":"@dieugene/tochka-bot-get-payment-link","_rev":"5-c195af9e6ad8bbcd59f95b0e7d56799b","name":"@dieugene/tochka-bot-get-payment-link","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@dieugene/tochka-bot-get-payment-link","version":"0.1.0","keywords":["tochka","bank","payments","payment-links","acquiring","api","bot"],"author":{"name":"Eugene Ditkovsky"},"license":"MIT","_id":"@dieugene/tochka-bot-get-payment-link@0.1.0","maintainers":[{"name":"di.eugene","email":"ditkovsky.eugene@gmail.com"}],"dist":{"shasum":"61dfb230bc4578d1e7d2c659f6c0e897cdcaa0c7","tarball":"https://registry.npmjs.org/@dieugene/tochka-bot-get-payment-link/-/tochka-bot-get-payment-link-0.1.0.tgz","fileCount":3,"integrity":"sha512-Xro8nO8jx0ut/jIgkI/mpMDByHK4Nwy9ZJmwVmopZVcoSYezAjlgUOFFL4PeG64faQuWvMG9/T9UlCRCdTjTbg==","signatures":[{"sig":"MEQCICVd6r25ExwTtIT7JMWmeM6Zk8q/y158pH25j1xg5ogSAiBLqqqvVuiUlniKGJSgfXnxE/SPs0OUbVQUk2zJhP4n4w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4728},"main":"index.js","type":"commonjs","engines":{"node":">=18"},"exports":{".":"./index.js"},"_npmUser":{"name":"di.eugene","email":"ditkovsky.eugene@gmail.com"},"_npmVersion":"10.8.1","description":"Lightweight module to create Tochka payment link with receipt and persist invoice (bot)","directories":{},"_nodeVersion":"20.16.0","dependencies":{"@dieugene/payments-db":"^0.1.0","@dieugene/tochka-api-public":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tochka-bot-get-payment-link_0.1.0_1757605683794_0.5187017694600231","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@dieugene/tochka-bot-get-payment-link","version":"0.1.1","keywords":["tochka","bank","payments","payment-links","acquiring","api","bot"],"author":{"name":"Eugene Ditkovsky"},"license":"MIT","_id":"@dieugene/tochka-bot-get-payment-link@0.1.1","maintainers":[{"name":"di.eugene","email":"ditkovsky.eugene@gmail.com"}],"dist":{"shasum":"63f7c0c6ab4d8d003dd2fd9ad71520934ca4d202","tarball":"https://registry.npmjs.org/@dieugene/tochka-bot-get-payment-link/-/tochka-bot-get-payment-link-0.1.1.tgz","fileCount":3,"integrity":"sha512-9e5R+4P4ENB7TjN4HIQF6+PCXpp34pFbfHjcZWUKSE3TAW08FBoh4XviNMH85VmzchHfuw17jEeLGZyvKuW++A==","signatures":[{"sig":"MEQCIERAlIQoGE61Me4E1d4v4Z2AoAY5yvRjbvabr76Sy/LiAiAlVQKkDYLOCi22MRxh0CyeEBBCJD/eVzXzev1TZWQIRA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6056},"main":"index.js","type":"commonjs","engines":{"node":">=18"},"exports":{".":"./index.js"},"_npmUser":{"name":"di.eugene","email":"ditkovsky.eugene@gmail.com"},"_npmVersion":"10.8.1","description":"Lightweight module to create Tochka payment link with receipt and persist invoice (bot)","directories":{},"_nodeVersion":"20.16.0","dependencies":{"@dieugene/payments-db":"^0.1.0","@dieugene/tochka-api-public":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tochka-bot-get-payment-link_0.1.1_1757623627360_0.057830743570432164","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@dieugene/tochka-bot-get-payment-link","version":"0.1.2","keywords":["tochka","bank","payments","payment-links","acquiring","api","bot"],"author":{"name":"Eugene Ditkovsky"},"license":"MIT","_id":"@dieugene/tochka-bot-get-payment-link@0.1.2","maintainers":[{"name":"di.eugene","email":"ditkovsky.eugene@gmail.com"}],"dist":{"shasum":"5b210e804ee096c31a01f4e9ae96e9548cf73c76","tarball":"https://registry.npmjs.org/@dieugene/tochka-bot-get-payment-link/-/tochka-bot-get-payment-link-0.1.2.tgz","fileCount":3,"integrity":"sha512-sUJWuHpVbo0q0Jh+KaCepxjL8aKSsQgw8dmkFpsDfCm/pgL2kJS0bK4S57kJ6Mwm5/eWSrghq9BSjgNR2iA+7A==","signatures":[{"sig":"MEUCIQCWrRLPz2U/pThg/WQxjs3AUffW+rIzHpZfdiNx86T7kgIgfdp95XuUeS1tISQUPdVxvADdD6rrjCUfhdJyz7j68cQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6068},"main":"index.js","type":"commonjs","engines":{"node":">=18"},"exports":{".":"./index.js"},"_npmUser":{"name":"di.eugene","email":"ditkovsky.eugene@gmail.com"},"_npmVersion":"10.8.1","description":"Lightweight module to create Tochka payment link with receipt and persist invoice (bot)","directories":{},"_nodeVersion":"20.16.0","dependencies":{"@dieugene/payments-db":"^0.1.0","@dieugene/tochka-api-public":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tochka-bot-get-payment-link_0.1.2_1757669967250_0.2760067476460002","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@dieugene/tochka-bot-get-payment-link","version":"0.1.3","keywords":["tochka","bank","payments","payment-links","acquiring","api","bot"],"author":{"name":"Eugene Ditkovsky"},"license":"MIT","_id":"@dieugene/tochka-bot-get-payment-link@0.1.3","maintainers":[{"name":"di.eugene","email":"ditkovsky.eugene@gmail.com"}],"dist":{"shasum":"1489d4b9d99250ae75e2cfd5a0bd5ea9dcc16d6d","tarball":"https://registry.npmjs.org/@dieugene/tochka-bot-get-payment-link/-/tochka-bot-get-payment-link-0.1.3.tgz","fileCount":3,"integrity":"sha512-TtJ2WuR4gTm4Ma6pTdfQvCtMO76dKKk6tVtfSPqrsi6CjuUhp+l3VeHo+uWpO2bTJSdNjWDcJf9dpq12Wi5V4g==","signatures":[{"sig":"MEUCIFylv4I9jXTO0kLnhzqLr5Ray3wBwUyvscOFup4kPvFwAiEA0PRxDx6VwFGKpruPpGEQNbT+9A7Er4S1CprERbhODC0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6068},"main":"index.js","type":"commonjs","engines":{"node":">=18"},"exports":{".":"./index.js"},"_npmUser":{"name":"di.eugene","email":"ditkovsky.eugene@gmail.com"},"_npmVersion":"10.8.1","description":"Lightweight module to create Tochka payment link with receipt and persist invoice (bot)","directories":{},"_nodeVersion":"20.16.0","dependencies":{"@dieugene/payments-db":"^0.1.0","@dieugene/tochka-api-public":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tochka-bot-get-payment-link_0.1.3_1757680156631_0.061736122446092834","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@dieugene/tochka-bot-get-payment-link","version":"0.1.4","description":"Lightweight module to create Tochka payment link with receipt and persist invoice (bot)","main":"index.js","type":"commonjs","publishConfig":{"access":"public"},"engines":{"node":">=18"},"keywords":["tochka","bank","payments","payment-links","acquiring","api","bot"],"author":{"name":"Eugene Ditkovsky"},"license":"MIT","exports":{".":"./index.js"},"dependencies":{"@dieugene/tochka-api-public":"^1.0.0","@dieugene/payments-db":"^0.1.0"},"_id":"@dieugene/tochka-bot-get-payment-link@0.1.4","_nodeVersion":"20.16.0","_npmVersion":"10.8.1","dist":{"integrity":"sha512-nrcAk6aZwDOH02ark8SiuXStPdoRG0wUxdSdWA26Yp5ju2GMqKRlm61ypQt2PQFHM74VkkyfwU3oMEYay0SFVg==","shasum":"7508fad6f670229f66c05403adca2abb5f4625ca","tarball":"https://registry.npmjs.org/@dieugene/tochka-bot-get-payment-link/-/tochka-bot-get-payment-link-0.1.4.tgz","fileCount":3,"unpackedSize":6441,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIClCtIa1kPzC+2RLy0bkk+Da1iwi+WKolj1zLqG9YCl1AiB6/xm8HUvkxfKZwFgdGDewTKJw7zYlo+WuhvaD7zLXsw=="}]},"_npmUser":{"name":"di.eugene","email":"ditkovsky.eugene@gmail.com"},"directories":{},"maintainers":[{"name":"di.eugene","email":"ditkovsky.eugene@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tochka-bot-get-payment-link_0.1.4_1757758332826_0.4562063853145639"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-11T15:48:03.685Z","modified":"2025-09-13T10:12:13.188Z","0.1.0":"2025-09-11T15:48:03.951Z","0.1.1":"2025-09-11T20:47:07.542Z","0.1.2":"2025-09-12T09:39:27.465Z","0.1.3":"2025-09-12T12:29:16.827Z","0.1.4":"2025-09-13T10:12:12.993Z"},"author":{"name":"Eugene Ditkovsky"},"license":"MIT","keywords":["tochka","bank","payments","payment-links","acquiring","api","bot"],"description":"Lightweight module to create Tochka payment link with receipt and persist invoice (bot)","maintainers":[{"name":"di.eugene","email":"ditkovsky.eugene@gmail.com"}],"readme":"Create Tochka payment link with receipt and persist invoice (bot)\r\n\r\nUsage\r\n\r\n```javascript\r\nconst { create_link_and_invoice } = require('@dieugene/tochka-bot-get-payment-link');\r\n\r\nconst { invoice, payment_url, invoice_id, response } = await create_link_and_invoice({\r\n  client_options: {\r\n    base_url: process.env.TOCHKA_BASE_URL,\r\n    access_token: process.env.TOCHKA_ACCESS_TOKEN,\r\n    default_customer_code: process.env.TOCHKA_CUSTOMER_CODE\r\n  },\r\n  domain: 'prod',\r\n  amount: 1000,\r\n  email: 'customer@example.com',\r\n  service_name: 'Услуга Х',\r\n  product_code: 'search_arc',\r\n  purpose: 'Оплата услуги Х',\r\n  redirect_url: 'https://example.com/success',\r\n  fail_redirect_url: 'https://example.com/fail',\r\n  payment_mode: ['sbp', 'card'],\r\n  pre_authorization: false,\r\n  ttl: 10080,\r\n  callback_url: 'https://functions.yandexcloud.net/xxxx',\r\n  callback_payload: { some: 'data' }\r\n});\r\n```\r\n\r\nParameters\r\n\r\n- client_options: { base_url, access_token, default_customer_code }\r\n- domain: string (default: 'career-bot-tochka')\r\n- amount: number (> 0, required)\r\n- email: string\r\n- service_name: string\r\n- product_code: string (required)\r\n- purpose: string (default: 'Оплата услуг')\r\n- redirect_url: string\r\n- fail_redirect_url: string\r\n- payment_mode: array of strings (default: ['sbp', 'card'])\r\n- pre_authorization: boolean\r\n- ttl: number (default: 10080)\r\n- callback_url: string. Fallbacks: process.env.PAYMENT_CALLBACK_URL → process.env.THIS_FUNCTION_URL\r\n- callback_payload: object. Will be augmented automatically.\r\n\r\nBehavior\r\n\r\n- Persists an invoice via `@dieugene/payments-db` with `uuid = invoice_id`, `domain`, `amount` and `data` containing:\r\n  - `callback_data`: { url, payload }\r\n  - `product_code`: value of `service_name` (if provided)\r\n- Automatically augments `callback_payload` with:\r\n  - `invoice_id`: operation identifier from Tochka\r\n  - `is_webhook: true`\r\n\r\nReturn value\r\n\r\n```javascript\r\n{\r\n  invoice,        // persisted invoice record\r\n  payment_url,    // Tochka payment link\r\n  invoice_id,     // operation identifier\r\n  response        // raw API response\r\n}\r\n```\r\n\r\n","readmeFilename":"README.md"}