This package has been deprecated

Author message:

Moved to @os-team/yoo-money

@os-team/yandex-checkout
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@os-team/yandex-checkout

Yandex.Checkout API v3. All methods described in the official documentation are implemented (payments, refunds and receipts).

Examples

Create a payment

const yandexCheckout = new YandexCheckout({
  shopId: 'shopId',
  secretKey: 'secretKey',
});

const payment = await yandexCheckout.payments.create(
  {
    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: 'Order No. 1',
  },
  'idempotenceKey'
);

Create a recurring payment

// Create a payment and save a payment method
const firstPayment = await yandexCheckout.payments.create(
  {
    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: 'Order No. 1',
    save_payment_method: true,
    capture: true,
  },
  'idempotenceKey'
);

// Using the saved payment method, create a recurring payment
const secondPayment = await yandexCheckout.payments.create(
  {
    amount: {
      value: '2.00',
      currency: 'RUB',
    },
    payment_method_id: firstPayment.payment_method.id,
    description: 'Order No. 2',
    capture: true,
  },
  'idempotenceKey'
);

Supported methods

  • payments.create
  • payments.list
  • payments.get
  • payments.capture
  • payments.cancel
  • refunds.create
  • refunds.list
  • refunds.get
  • receipts.create
  • receipts.list
  • receipts.get

Readme

Keywords

none

Package Sidebar

Install

npm i @os-team/yandex-checkout

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

60.6 kB

Total Files

95

Last publish

Collaborators

  • oxilor