UNPKG

@lexriver/yandex-pay

Version:

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

38 lines (37 loc) 1.6 kB
import { CreateSubscriptionRequest, CreateSubscriptionResponse, RecurringPaymentRequest, Subscription } from '../types/index.js'; import { RecurSubscriptionResponse } from '../types/responses/RecurSubscriptionResponse.js'; import { BaseService } from './BaseService.js'; /** * Service for working with subscriptions */ export declare class SubscriptionService extends BaseService { /** * Request for subscription creation. * * The request is used to create a subscription and and obtain a link to start it. * * @param data Subscription data * @returns Created subscription data */ createSubscription(data: CreateSubscriptionRequest): Promise<CreateSubscriptionResponse>; /** * Request to debit a regular subscription fee. * * The request is used to perform a direct debit from the account or card linked to the subscription. * To debit funds, pass the order ID, cart, debit amount, and ID of the initial order that was used at subscription creation. * * @param data Recurring payment data * @returns Operation details */ makeRecurringPayment(data: RecurringPaymentRequest): Promise<RecurSubscriptionResponse>; /** * Request to obtain subscription details. * * Returns the subscription ID and status and the linked payment method. * * @param subscriptionId Subscription ID * @param checkCardActive Whether to check if the card is active * @returns Subscription details */ getSubscription(subscriptionId: string, checkCardActive?: boolean): Promise<Subscription>; }