BEILOFF Toolkit / v1.0.1

How to connect YooKassa to a website with a test checkout

Follow an order from checkout to confirmation. Try success and cancellation locally, then connect your own test store to use the hosted YooKassa payment page.

How the kit works

Order

The sample postcard costs RUB 100. The server stores a separate order and sets the amount and currency.

Hosted checkout

Simulate either outcome locally. In test-store mode, the server creates a payment and returns a link to the provider’s hosted checkout.

Customer return

The server retrieves the payment by ID and matches it to the order. Confirmation requires the expected amount, currency and final payment status. A pending order can be refreshed.

Retry after interruption

SQLite retains the order and operation key across restarts. Retries reuse this key within the allowed window. Older uncertain orders need dashboard reconciliation.

Inside the ZIP

  • README.md
  • checkout.mjs
  • payment.test.mjs
  • provider.mjs
  • server.mjs
  • RELEASE.txt

An independent BEILOFF example for test transactions. The order page refreshes its status when opened. A commercial store needs its own notifications, fulfilment and applicable receipt handling.

Getting started

  1. Unzip and run node server.mjs on Node.js 24. Open the printed address and try both outcomes using separate orders.
  2. Create a provider test store. Set the test shop ID, secret and return origin as described in README.md.
  3. Run node server.mjs --test-store, open hosted checkout and compare the result with the test dashboard.

Change the colours and logo

Change the background, text and button in the style constant in server.mjs, then replace BEILOFF Toolkit in the header with the shop name. Restart the demo and test success and cancellation. These styles apply to the sample store. YooKassa controls its hosted payment page.

Verify the result

Run node --test payment.test.mjs for request parameters, return handling, restarts and error cases using a simulated API. Verify the hosted payment separately in your own test store.

ЮKassa / YooKassa · Test payments

Release notes

v1.0.1

Added colour and logo customisation instructions to the README.

v1.0.0

First release with a local checkout, test-store adapter and server-side status checks.

Download free in my account