@lexriver/yandex-pay
Version:
A TypeScript client for Yandex Pay API to integrate payment processing in your Node.js applications
29 lines (28 loc) • 1.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.YandexPayAPI = void 0;
const OperationService_js_1 = require("./services/OperationService.js");
const OrderService_js_1 = require("./services/OrderService.js");
const SubscriptionService_js_1 = require("./services/SubscriptionService.js");
/**
* YandexPayAPI client for making requests to the Yandex Pay API
*/
class YandexPayAPI {
/**
* Creates a new YandexPayAPI instance
*
* @param config Configuration for the API client
*/
constructor(config) {
this.apiKey = config.apiKey;
this.isSandbox = config.isSandbox || false;
this.baseUrl = this.isSandbox
? 'https://sandbox.pay.yandex.ru/api/merchant'
: 'https://pay.yandex.ru/api/merchant';
// Initialize services
this.orders = new OrderService_js_1.OrderService(this.baseUrl, this.apiKey);
this.operations = new OperationService_js_1.OperationService(this.baseUrl, this.apiKey);
this.subscriptions = new SubscriptionService_js_1.SubscriptionService(this.baseUrl, this.apiKey);
}
}
exports.YandexPayAPI = YandexPayAPI;