import { AxiosRequestConfig, AxiosResponse } from 'axios'; import { AttemptOptions } from '@lifeomic/attempt'; import { Deal, Me, Payment, Receipt, Refund, WebHook } from '../models'; import { ICapturePayment, ICreateDeal, ICreatePayment, ICreateReceipt, ICreateRefund, ICreateWebHook, IGetPaymentList, IGetReceiptList, IGetRefundList, IPaymentList, IReceiptList, IRefundList, IWebHookList, IYooCheckoutOptions } from '../types'; import { Payout } from '../models/payout'; import { ICreatePayout } from '../types/ICreatePayout'; export declare class YooCheckout { private readonly options; readonly shopId: string; readonly secretKey: string; readonly root: string; readonly debug: boolean; readonly attemptOptions: Partial>>; constructor(options: IYooCheckoutOptions, attemptOptions?: Partial>>); private authData; private buildQuery; private normalizeFilter; /** * Create payment * @see 'https://yookassa.ru/developers/api#create_payment' * @param {Object} payload * @paramExample * { * "amount": { "value": '2.00', "currency": 'RUB' }, * "payment_method_data": { "type": 'bank_card' }, * "confirmation": { "type": 'redirect', "return_url": 'https://www.merchant-website.com/return_url' } * } * @param {string} idempotenceKey * @paramExample '6daac9fa-342d-4264-91c5-b5eafd1a0010' * @returns {Promise} */ createPayment(payload: ICreatePayment, idempotenceKey?: string): Promise; /** * Get payment by id * @see 'https://yookassa.ru/developers/api#get_payment' * @param {string} paymentId * @paramExample '215d8da0-000f-50be-b000-0003308c89be' * @returns {Promise} */ getPayment(paymentId: string): Promise; /** * Capture payment * @see 'https://yookassa.ru/developers/api#capture_payment' * @param {string} paymentId * @paramExample '215d8da0-000f-50be-b000-0003308c89be' * @param {Object} payload * @paramExample * { * "amount": { "value": '2.00', "currency": 'RUB' } * } * @param {string} idempotenceKey * @paramExample '6daac9fa-342d-4264-91c5-b5eafd1a0010' * @returns {Promise} */ capturePayment(paymentId: string, payload: ICapturePayment, idempotenceKey?: string): Promise; /** * Cancel paymnet * @see 'https://yookassa.ru/developers/api#cancel_payment' * @param {string} paymentId * @paramExample '215d8da0-000f-50be-b000-0003308c89be' * @param {string} idempotenceKey * @paramExample '6daac9fa-342d-4264-91c5-b5eafd1a0010' * @returns {Promise} */ cancelPayment(paymentId: string, idempotenceKey?: string): Promise; /** * Get payment list * @see 'https://yookassa.ru/developers/api#get_payments_list' * @param {Object} filters * @paramExample * { * "created_at": { "value": '2021-01-27T13:58:02.977Z', "mode": 'gte' }, * "limit": 20 * } * @returns {Promise} */ getPaymentList(filters?: IGetPaymentList): Promise; /** * Create refund * @see 'https://yookassa.ru/developers/api#create_refund' * @param {Object} payload * @paramExample * { * "payment_id": '6daac9fa-342d-4264-91c5-b5eafd1a0010' * "amount": { "value": '2.00', "currency": 'RUB' } * } * @param {string} idempotenceKey * @paramExample '6daac9fa-342d-4264-91c5-b5eafd1a0010' * @returns {Promise} */ createRefund(payload: ICreateRefund, idempotenceKey?: string): Promise; /** * Get refund by id * @see 'https://yookassa.ru/developers/api#get_refund' * @param {string} refundId * @paramExample '216749f7-0016-50be-b000-078d43a63ae4' * @returns {Promise} */ getRefund(refundId: string): Promise; /** * Get refund list * @see 'https://yookassa.ru/developers/api#get_refunds_list' * @param {Object} filters * @paramExample * { * "created_at": { "value": '2021-01-27T13:58:02.977Z', "mode": 'gte' }, * "limit": 20 * } * @returns {Promise} */ getRefundList(filters?: IGetRefundList): Promise; /** * Create deal * @see 'https://yookassa.ru/developers/api#create_deal' * @param {Object} payload * @paramExample * { * "amount": { "value": '2.00', "currency": 'RUB' }, * "payment_method_data": { "type": 'bank_card' }, * "confirmation": { "type": 'redirect', "return_url": 'https://www.merchant-website.com/return_url' } * } * @param {string} idempotenceKey * @paramExample '6daac9fa-342d-4264-91c5-b5eafd1a0010' * @returns {Promise} */ createDeal(payload: ICreateDeal, idempotenceKey?: string): Promise; /** * Create payout * @see 'https://yookassa.ru/developers/api#create_payout' * @param {Object} payload * @paramExample * { * "amount": { "value": '2.00', "currency": 'RUB' }, * "payment_method_data": { "type": 'bank_card' }, * "confirmation": { "type": 'redirect', "return_url": 'https://www.merchant-website.com/return_url' } * } * @param {string} idempotenceKey * @paramExample '6daac9fa-342d-4264-91c5-b5eafd1a0010' * @returns {Promise} */ createPayout(payload: ICreatePayout, idempotenceKey?: string): Promise; /** * Get payout by id * @see 'https://yookassa.ru/developers/api#get_payout' * @param {string} payoutId * @paramExample '216749f7-0016-50be-b000-078d43a63ae4' * @returns {Promise} */ getPayout(payoutId: string): Promise; /** * Create receipt * @see 'https://yookassa.ru/developers/api#create_receipt' * @param {Object} payload * @paramExample * { * "send": true, * "customer": { "email": 'test@gmail.com' }, * "settlements": [{"type": 'cashless', "amount": { "value": '2.00', "currency": 'RUB' }}], * "refund_id": '27a387af-0015-5000-8000-137da144ce29', * "type": 'refund', * "items": [{ "description": 'test', "quantity": '2', "amount": { "value": '1.00', "currency": 'RUB' }, "vat_code": 1 }] * } * @param {string} idempotenceKey * @paramExample '6daac9fa-342d-4264-91c5-b5eafd1a0010' * @returns {Promise} */ createReceipt(payload: ICreateReceipt, idempotenceKey?: string): Promise; /** * Get receipt by id * @see 'https://yookassa.ru/developers/api#get_receipt' * @param {string} receiptId * @paramExample '216749f7-0016-50be-b000-078d43a63ae4' * @returns {Promise} */ getReceipt(receiptId: string): Promise; /** * Get receipt list * @see 'https://yookassa.ru/developers/api#get_receipts_list' * @param {Object} filters * @paramExample * { * "created_at": { "value": '2021-01-27T13:58:02.977Z', "mode": 'gte' }, * "limit": 20 * } * @returns {Promise} */ getReceiptList(filters?: IGetReceiptList): Promise; /** * Create webhook * @see 'https://yookassa.ru/developers/api#create_webhook * @param {Object} payload * @paramExample * { * "event": "payment.canceled", * "url": "https://test.com/hook" * } * @param {string} idempotenceKey * @paramExample '6daac9fa-342d-4264-91c5-b5eafd1a0010' * @returns {Promise} */ createWebHook(payload: ICreateWebHook, idempotenceKey?: string): Promise; /** * Get webhook list * @see 'https://yookassa.ru/developers/api#get_webhook_list' * @returns {Promise} */ getWebHookList(): Promise; /** * Delete webhook * @see 'https://yookassa.ru/developers/api#delete_webhook * @param {string} id * @paramExample * wh-edba6d49-ce3e-4d99-991b-4bb164859dc3 * @returns {Promise} */ deleteWebHook(id: string): Promise; /** * Get shop info * @see 'https://yookassa.ru/developers/api#get_me' * @returns {Promise} */ getShop(): Promise; protected get(endpoint: string, options: AxiosRequestConfig): Promise>; protected post(endpoint: string, payload: unknown, options: AxiosRequestConfig): Promise>; protected put(endpoint: string, payload: unknown, options: AxiosRequestConfig): Promise>; protected delete(endpoint: string, payload: unknown, options: AxiosRequestConfig): Promise>; protected faultTolerantRequest(method: 'get' | 'post' | 'put' | 'delete', endpoint: string, options: AxiosRequestConfig): Promise>; }