Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
YooKassa TypeScript API
https://github.com/zolotarev/yookassa-ts
Admin
YooKassa TypeScript API для Node.js
Tokens:
270
Snippets:
2
Trust Score:
7
License:
MIT
Update:
1 year ago
Context
Chat
Benchmark
68.75
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### Installing Yookassa Node.js Client Source: https://github.com/zolotarev/yookassa-ts/blob/master/README.md This command installs the yookassa-ts library from npm, which is required to use the Yookassa API client in your Node.js project. ```sh npm i yookassa-ts ``` -------------------------------- ### Initializing Client and Creating Payment - Node.js Source: https://github.com/zolotarev/yookassa-ts/blob/master/README.md This snippet shows how to import the YooKassa class, initialize it with your shop ID and secret key, and create a new payment object specifying the amount, currency, payment method (bank card), confirmation type (redirect), return URL, and description. ```js import YooKassa from 'yookassa-ts/lib/yookassa' const yooKassa = new Yookassa({ shopId: '<Идентификатор магазина>', secretKey: '<Секретный ключ>' }); const payment = await yooKassa.createPayment({ amount: { value: "2.00", currency: "RUB" }, payment_method_data: { type: "bank_card" }, confirmation: { type: "redirect", return_url: "https://www.merchant-website.com/return_url" }, description: "Заказ №72" }); ```