npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@lexriver/yandex-pay

v1.1.7

Published

A TypeScript client for Yandex Pay API to integrate payment processing in your Node.js applications

Readme

Yandex Pay API

A TypeScript/JavaScript client for the Yandex Pay API that helps you easily integrate Yandex Pay into your Node.js applications.

Documentation

This package is based on the official Yandex Pay API documentation.

Installation

pnpm add @lexriver/yandex-pay

Usage

Initialize the client

import { YandexPayAPI } from '@lexriver/yandex-pay';

const yandexPay = new YandexPayAPI({
    apiKey: 'your-api-key',
    sandbox: true // set to false for production
});

Create an order

const order = await yandexPay.orders.createOrder({
    cart: {
        items: [
            {
                productId: 'product-1',
                title: 'Product Name',
                quantity: {
                    count: '1'
                },
                total: '100.00'
            }
        ],
        total: {
            amount: '100.00'
        }
    },
    orderId: 'order-123',
    currencyCode: 'RUB',
    redirectUrls: {
        onSuccess: 'https://your-site.com/success',
        onError: 'https://your-site.com/error'
    },
    availablePaymentMethods: ['CARD']
});

// Redirect user to the payment URL
console.log(order.paymentUrl);

Get order details

const orderDetails = await yandexPay.orders.getOrder('order-123');

Cancel an order

const cancelResult = await yandexPay.orders.cancelOrder('order-123', {
    reason: 'Customer canceled'
});

Refund an order

const refundResult = await yandexPay.orders.refundOrder('order-123', {
    amount: '100.00'
});

Capture (confirm) an order payment

const captureResult = await yandexPay.orders.captureOrder('order-123', {
    cart: {
        // Final cart after possible modifications
        items: [
            {
                productId: 'product-1',
                title: 'Product Name',
                quantity: {
                    count: '1'
                },
                total: '100.00'
            }
        ],
        total: {
            amount: '100.00'
        }
    }
});

Get operations for an order

const operations = await yandexPay.operations.getOperations('order-123');

Create a subscription

const subscription = await yandexPay.subscriptions.createSubscription({
    subscriptionPlanId: 'plan-123',
    returnUrls: {
        onSuccess: 'https://your-site.com/success',
        onError: 'https://your-site.com/error'
    }
});

// Redirect user to confirmation URL
console.log(subscription.confirmationUrl);

Make a recurring payment

const recurringPayment = await yandexPay.subscriptions.makeRecurringPayment({
    customerSubscriptionId: 'subscription-123',
    amount: '100.00',
    purpose: 'Monthly payment'
});

Get subscription details

const subscriptionDetails = await yandexPay.subscriptions.getSubscription(
    'subscription-123', 
    true // Check if the card is active
);

API Reference

The package provides a type-safe interface to the Yandex Pay API organized into the following services:

OrderService

  • createOrder(data) - Create a new order
  • getOrder(orderId) - Get order details
  • cancelOrder(orderId, data) - Cancel an order
  • refundOrder(orderId, data) - Refund an order
  • refundOrderV2(orderId, data) - Refund an order (V2 API)
  • captureOrder(orderId, data) - Capture (confirm) an order payment
  • rollbackOrder(orderId) - Rollback (void) an order payment
  • submitOrder(orderId, data) - Submit an order for processing

OperationService

  • getOperation(externalOperationId) - Get details about a specific operation

SubscriptionService

  • createSubscription(data) - Create a new subscription
  • makeRecurringPayment(data) - Make a recurring payment for a subscription
  • getSubscription(subscriptionId, checkCardActive) - Get subscription details

License

ISC