0.0.5 • Published 4 years ago

@os-utils/yandex-checkout v0.0.5

Weekly downloads
6
License
MIT
Repository
-
Last release
4 years ago

@os-utils/yandex-checkout

Yandex.Checkout API v3.

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

References

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago