@companix/yookassa 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +191 -0
- package/dist/api/common.d.ts +215 -0
- package/dist/api/common.js +3 -0
- package/dist/api/common.js.map +1 -0
- package/dist/api/enums/common.d.ts +121 -0
- package/dist/api/enums/common.js +145 -0
- package/dist/api/enums/common.js.map +1 -0
- package/dist/api/enums/currency.enum.d.ts +121 -0
- package/dist/api/enums/currency.enum.js +126 -0
- package/dist/api/enums/currency.enum.js.map +1 -0
- package/dist/api/enums/index.d.ts +2 -0
- package/dist/api/enums/index.js +19 -0
- package/dist/api/enums/index.js.map +1 -0
- package/dist/api/index.d.ts +5 -0
- package/dist/api/index.js +22 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/notifications.d.ts +10 -0
- package/dist/api/notifications.js +3 -0
- package/dist/api/notifications.js.map +1 -0
- package/dist/api/requests/deal.d.ts +21 -0
- package/dist/api/requests/deal.js +3 -0
- package/dist/api/requests/deal.js.map +1 -0
- package/dist/api/requests/index.d.ts +10 -0
- package/dist/api/requests/index.js +27 -0
- package/dist/api/requests/index.js.map +1 -0
- package/dist/api/requests/invoice.d.ts +33 -0
- package/dist/api/requests/invoice.js +3 -0
- package/dist/api/requests/invoice.js.map +1 -0
- package/dist/api/requests/me.d.ts +3 -0
- package/dist/api/requests/me.js +3 -0
- package/dist/api/requests/me.js.map +1 -0
- package/dist/api/requests/payment-method.d.ts +9 -0
- package/dist/api/requests/payment-method.js +3 -0
- package/dist/api/requests/payment-method.js.map +1 -0
- package/dist/api/requests/payment.d.ts +199 -0
- package/dist/api/requests/payment.js +3 -0
- package/dist/api/requests/payment.js.map +1 -0
- package/dist/api/requests/payout.d.ts +54 -0
- package/dist/api/requests/payout.js +3 -0
- package/dist/api/requests/payout.js.map +1 -0
- package/dist/api/requests/personal-data.d.ts +16 -0
- package/dist/api/requests/personal-data.js +3 -0
- package/dist/api/requests/personal-data.js.map +1 -0
- package/dist/api/requests/receipt.d.ts +59 -0
- package/dist/api/requests/receipt.js +3 -0
- package/dist/api/requests/receipt.js.map +1 -0
- package/dist/api/requests/refund.d.ts +35 -0
- package/dist/api/requests/refund.js +3 -0
- package/dist/api/requests/refund.js.map +1 -0
- package/dist/api/requests/webhook.d.ts +5 -0
- package/dist/api/requests/webhook.js +3 -0
- package/dist/api/requests/webhook.js.map +1 -0
- package/dist/api/responses/deal.d.ts +23 -0
- package/dist/api/responses/deal.js +3 -0
- package/dist/api/responses/deal.js.map +1 -0
- package/dist/api/responses/index.d.ts +11 -0
- package/dist/api/responses/index.js +28 -0
- package/dist/api/responses/index.js.map +1 -0
- package/dist/api/responses/invoice.d.ts +35 -0
- package/dist/api/responses/invoice.js +3 -0
- package/dist/api/responses/invoice.js.map +1 -0
- package/dist/api/responses/me.d.ts +19 -0
- package/dist/api/responses/me.js +3 -0
- package/dist/api/responses/me.js.map +1 -0
- package/dist/api/responses/payment-method.d.ts +15 -0
- package/dist/api/responses/payment-method.js +3 -0
- package/dist/api/responses/payment-method.js.map +1 -0
- package/dist/api/responses/payment.d.ts +268 -0
- package/dist/api/responses/payment.js +3 -0
- package/dist/api/responses/payment.js.map +1 -0
- package/dist/api/responses/payout.d.ts +65 -0
- package/dist/api/responses/payout.js +3 -0
- package/dist/api/responses/payout.js.map +1 -0
- package/dist/api/responses/personal-data.d.ts +16 -0
- package/dist/api/responses/personal-data.js +3 -0
- package/dist/api/responses/personal-data.js.map +1 -0
- package/dist/api/responses/receipt.d.ts +54 -0
- package/dist/api/responses/receipt.js +3 -0
- package/dist/api/responses/receipt.js.map +1 -0
- package/dist/api/responses/refund.d.ts +49 -0
- package/dist/api/responses/refund.js +3 -0
- package/dist/api/responses/refund.js.map +1 -0
- package/dist/api/responses/sbp-banks.d.ts +9 -0
- package/dist/api/responses/sbp-banks.js +3 -0
- package/dist/api/responses/sbp-banks.js.map +1 -0
- package/dist/api/responses/webhook.d.ts +11 -0
- package/dist/api/responses/webhook.js +3 -0
- package/dist/api/responses/webhook.js.map +1 -0
- package/dist/http/yookassa.constants.d.ts +1 -0
- package/dist/http/yookassa.constants.js +5 -0
- package/dist/http/yookassa.constants.js.map +1 -0
- package/dist/http/yookassa.error.d.ts +6 -0
- package/dist/http/yookassa.error.js +14 -0
- package/dist/http/yookassa.error.js.map +1 -0
- package/dist/http/yookassa.http-client.d.ts +17 -0
- package/dist/http/yookassa.http-client.js +87 -0
- package/dist/http/yookassa.http-client.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/deal/deal.module.d.ts +2 -0
- package/dist/modules/deal/deal.module.js +21 -0
- package/dist/modules/deal/deal.module.js.map +1 -0
- package/dist/modules/deal/deal.service.d.ts +9 -0
- package/dist/modules/deal/deal.service.js +34 -0
- package/dist/modules/deal/deal.service.js.map +1 -0
- package/dist/modules/invoice/invoice.module.d.ts +2 -0
- package/dist/modules/invoice/invoice.module.js +21 -0
- package/dist/modules/invoice/invoice.module.js.map +1 -0
- package/dist/modules/invoice/invoice.service.d.ts +8 -0
- package/dist/modules/invoice/invoice.service.js +31 -0
- package/dist/modules/invoice/invoice.service.js.map +1 -0
- package/dist/modules/me/me.module.d.ts +2 -0
- package/dist/modules/me/me.module.js +21 -0
- package/dist/modules/me/me.module.js.map +1 -0
- package/dist/modules/me/me.service.d.ts +7 -0
- package/dist/modules/me/me.service.js +28 -0
- package/dist/modules/me/me.service.js.map +1 -0
- package/dist/modules/payment/payment.module.d.ts +2 -0
- package/dist/modules/payment/payment.module.js +21 -0
- package/dist/modules/payment/payment.module.js.map +1 -0
- package/dist/modules/payment/payment.service.d.ts +11 -0
- package/dist/modules/payment/payment.service.js +40 -0
- package/dist/modules/payment/payment.service.js.map +1 -0
- package/dist/modules/payment-method/payment-method.module.d.ts +2 -0
- package/dist/modules/payment-method/payment-method.module.js +21 -0
- package/dist/modules/payment-method/payment-method.module.js.map +1 -0
- package/dist/modules/payment-method/payment-method.service.d.ts +8 -0
- package/dist/modules/payment-method/payment-method.service.js +31 -0
- package/dist/modules/payment-method/payment-method.service.js.map +1 -0
- package/dist/modules/payout/payout.module.d.ts +2 -0
- package/dist/modules/payout/payout.module.js +21 -0
- package/dist/modules/payout/payout.module.js.map +1 -0
- package/dist/modules/payout/payout.service.d.ts +10 -0
- package/dist/modules/payout/payout.service.js +37 -0
- package/dist/modules/payout/payout.service.js.map +1 -0
- package/dist/modules/personal-data/personal-data.module.d.ts +2 -0
- package/dist/modules/personal-data/personal-data.module.js +21 -0
- package/dist/modules/personal-data/personal-data.module.js.map +1 -0
- package/dist/modules/personal-data/personal-data.service.d.ts +8 -0
- package/dist/modules/personal-data/personal-data.service.js +31 -0
- package/dist/modules/personal-data/personal-data.service.js.map +1 -0
- package/dist/modules/receipt/receipt.module.d.ts +2 -0
- package/dist/modules/receipt/receipt.module.js +21 -0
- package/dist/modules/receipt/receipt.module.js.map +1 -0
- package/dist/modules/receipt/receipt.service.d.ts +9 -0
- package/dist/modules/receipt/receipt.service.js +34 -0
- package/dist/modules/receipt/receipt.service.js.map +1 -0
- package/dist/modules/refund/refund.module.d.ts +2 -0
- package/dist/modules/refund/refund.module.js +21 -0
- package/dist/modules/refund/refund.module.js.map +1 -0
- package/dist/modules/refund/refund.service.d.ts +9 -0
- package/dist/modules/refund/refund.service.js +34 -0
- package/dist/modules/refund/refund.service.js.map +1 -0
- package/dist/modules/sbp-banks/sbp-banks.module.d.ts +2 -0
- package/dist/modules/sbp-banks/sbp-banks.module.js +21 -0
- package/dist/modules/sbp-banks/sbp-banks.module.js.map +1 -0
- package/dist/modules/sbp-banks/sbp-banks.service.d.ts +7 -0
- package/dist/modules/sbp-banks/sbp-banks.service.js +28 -0
- package/dist/modules/sbp-banks/sbp-banks.service.js.map +1 -0
- package/dist/modules/webhook/constants/yookassa-ip-whitelist.d.ts +1 -0
- package/dist/modules/webhook/constants/yookassa-ip-whitelist.js +13 -0
- package/dist/modules/webhook/constants/yookassa-ip-whitelist.js.map +1 -0
- package/dist/modules/webhook/decorators/index.d.ts +1 -0
- package/dist/modules/webhook/decorators/index.js +18 -0
- package/dist/modules/webhook/decorators/index.js.map +1 -0
- package/dist/modules/webhook/decorators/yookassa-webhook.decorator.d.ts +1 -0
- package/dist/modules/webhook/decorators/yookassa-webhook.decorator.js +9 -0
- package/dist/modules/webhook/decorators/yookassa-webhook.decorator.js.map +1 -0
- package/dist/modules/webhook/guards/yookassa-webhook.guard.d.ts +6 -0
- package/dist/modules/webhook/guards/yookassa-webhook.guard.js +38 -0
- package/dist/modules/webhook/guards/yookassa-webhook.guard.js.map +1 -0
- package/dist/modules/webhook/index.d.ts +4 -0
- package/dist/modules/webhook/index.js +21 -0
- package/dist/modules/webhook/index.js.map +1 -0
- package/dist/modules/webhook/utils/ip-matcher.util.d.ts +1 -0
- package/dist/modules/webhook/utils/ip-matcher.util.js +55 -0
- package/dist/modules/webhook/utils/ip-matcher.util.js.map +1 -0
- package/dist/modules/webhook/webhook.module.d.ts +2 -0
- package/dist/modules/webhook/webhook.module.js +21 -0
- package/dist/modules/webhook/webhook.module.js.map +1 -0
- package/dist/modules/webhook/webhook.service.d.ts +9 -0
- package/dist/modules/webhook/webhook.service.js +34 -0
- package/dist/modules/webhook/webhook.service.js.map +1 -0
- package/dist/yookassa.interface.d.ts +9 -0
- package/dist/yookassa.interface.js +5 -0
- package/dist/yookassa.interface.js.map +1 -0
- package/dist/yookassa.module.d.ts +6 -0
- package/dist/yookassa.module.js +85 -0
- package/dist/yookassa.module.js.map +1 -0
- package/dist/yookassa.service.d.ts +25 -0
- package/dist/yookassa.service.js +55 -0
- package/dist/yookassa.service.js.map +1 -0
- package/package.json +34 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.YookassaHttpClient = void 0;
|
|
16
|
+
const yookassa_error_1 = require("./yookassa.error");
|
|
17
|
+
const yookassa_constants_1 = require("./yookassa.constants");
|
|
18
|
+
const crypto_1 = require("crypto");
|
|
19
|
+
const common_1 = require("@nestjs/common");
|
|
20
|
+
const undici_1 = require("undici");
|
|
21
|
+
const yookassa_interface_1 = require("../yookassa.interface");
|
|
22
|
+
let YookassaHttpClient = class YookassaHttpClient {
|
|
23
|
+
constructor(config) {
|
|
24
|
+
this.config = config;
|
|
25
|
+
if (this.config.proxyUrl) {
|
|
26
|
+
this.dispatcher = new undici_1.ProxyAgent(this.config.proxyUrl);
|
|
27
|
+
console.log('[YooKassa] ProxyAgent enabled:', this.config.proxyUrl);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.dispatcher = undefined;
|
|
31
|
+
console.log('[YooKassa] Proxy not configured, direct connection');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async request(options) {
|
|
35
|
+
const url = this.buildUrl(options.url, options.params);
|
|
36
|
+
try {
|
|
37
|
+
const res = await (0, undici_1.request)(url, {
|
|
38
|
+
method: options.method,
|
|
39
|
+
dispatcher: this.dispatcher,
|
|
40
|
+
headersTimeout: 15000,
|
|
41
|
+
bodyTimeout: 15000,
|
|
42
|
+
headers: {
|
|
43
|
+
'Content-Type': 'application/json',
|
|
44
|
+
'Idempotence-Key': (0, crypto_1.randomUUID)(),
|
|
45
|
+
Authorization: this.buildAuthHeader()
|
|
46
|
+
},
|
|
47
|
+
body: options.data ? JSON.stringify(options.data) : undefined
|
|
48
|
+
});
|
|
49
|
+
if (res.statusCode >= 400) {
|
|
50
|
+
const text = await res.body.text();
|
|
51
|
+
throw new yookassa_error_1.YookassaError('yookassa_error', text, text);
|
|
52
|
+
}
|
|
53
|
+
return (await res.body.json());
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
throw new yookassa_error_1.YookassaError(error?.type || 'yookassa_error', error?.message || 'Unknown Yookassa error', error);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
get(url, params) {
|
|
60
|
+
return this.request({ method: 'GET', url, params });
|
|
61
|
+
}
|
|
62
|
+
post(url, data) {
|
|
63
|
+
return this.request({ method: 'POST', url, data });
|
|
64
|
+
}
|
|
65
|
+
delete(url) {
|
|
66
|
+
return this.request({ method: 'DELETE', url });
|
|
67
|
+
}
|
|
68
|
+
buildAuthHeader() {
|
|
69
|
+
const creds = Buffer.from(`${this.config.shopId}:${this.config.apiKey}`).toString('base64');
|
|
70
|
+
return `Basic ${creds}`;
|
|
71
|
+
}
|
|
72
|
+
buildUrl(url, params) {
|
|
73
|
+
let full = `${yookassa_constants_1.YOOKASSA_API_URL}${url}`;
|
|
74
|
+
if (params && typeof params === 'object') {
|
|
75
|
+
const qp = new URLSearchParams(params);
|
|
76
|
+
full += `?${qp.toString()}`;
|
|
77
|
+
}
|
|
78
|
+
return full;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
exports.YookassaHttpClient = YookassaHttpClient;
|
|
82
|
+
exports.YookassaHttpClient = YookassaHttpClient = __decorate([
|
|
83
|
+
(0, common_1.Injectable)(),
|
|
84
|
+
__param(0, (0, common_1.Inject)(yookassa_interface_1.YookassaOptionsSymbol)),
|
|
85
|
+
__metadata("design:paramtypes", [Object])
|
|
86
|
+
], YookassaHttpClient);
|
|
87
|
+
//# sourceMappingURL=yookassa.http-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yookassa.http-client.js","sourceRoot":"","sources":["../../src/http/yookassa.http-client.ts"],"names":[],"mappings":"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"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from './api';
|
|
2
|
+
export * from './yookassa.module';
|
|
3
|
+
export * from './yookassa.service';
|
|
4
|
+
export * from './http/yookassa.error';
|
|
5
|
+
export * from './yookassa.interface';
|
|
6
|
+
export * from './modules/deal/deal.module';
|
|
7
|
+
export * from './modules/deal/deal.service';
|
|
8
|
+
export * from './modules/invoice/invoice.module';
|
|
9
|
+
export * from './modules/invoice/invoice.service';
|
|
10
|
+
export * from './modules/me/me.module';
|
|
11
|
+
export * from './modules/me/me.service';
|
|
12
|
+
export * from './modules/payment/payment.module';
|
|
13
|
+
export * from './modules/payment/payment.service';
|
|
14
|
+
export * from './modules/payment-method/payment-method.module';
|
|
15
|
+
export * from './modules/payment-method/payment-method.service';
|
|
16
|
+
export * from './modules/payout/payout.module';
|
|
17
|
+
export * from './modules/payout/payout.service';
|
|
18
|
+
export * from './modules/personal-data/personal-data.module';
|
|
19
|
+
export * from './modules/personal-data/personal-data.service';
|
|
20
|
+
export * from './modules/receipt/receipt.module';
|
|
21
|
+
export * from './modules/receipt/receipt.service';
|
|
22
|
+
export * from './modules/refund/refund.module';
|
|
23
|
+
export * from './modules/refund/refund.service';
|
|
24
|
+
export * from './modules/sbp-banks/sbp-banks.module';
|
|
25
|
+
export * from './modules/sbp-banks/sbp-banks.service';
|
|
26
|
+
export * from './modules/webhook/webhook.module';
|
|
27
|
+
export * from './modules/webhook/webhook.service';
|
|
28
|
+
export * from './modules/webhook/decorators';
|
|
29
|
+
export * from './modules/webhook/guards/yookassa-webhook.guard';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./api"), exports);
|
|
18
|
+
__exportStar(require("./yookassa.module"), exports);
|
|
19
|
+
__exportStar(require("./yookassa.service"), exports);
|
|
20
|
+
__exportStar(require("./http/yookassa.error"), exports);
|
|
21
|
+
__exportStar(require("./yookassa.interface"), exports);
|
|
22
|
+
__exportStar(require("./modules/deal/deal.module"), exports);
|
|
23
|
+
__exportStar(require("./modules/deal/deal.service"), exports);
|
|
24
|
+
__exportStar(require("./modules/invoice/invoice.module"), exports);
|
|
25
|
+
__exportStar(require("./modules/invoice/invoice.service"), exports);
|
|
26
|
+
__exportStar(require("./modules/me/me.module"), exports);
|
|
27
|
+
__exportStar(require("./modules/me/me.service"), exports);
|
|
28
|
+
__exportStar(require("./modules/payment/payment.module"), exports);
|
|
29
|
+
__exportStar(require("./modules/payment/payment.service"), exports);
|
|
30
|
+
__exportStar(require("./modules/payment-method/payment-method.module"), exports);
|
|
31
|
+
__exportStar(require("./modules/payment-method/payment-method.service"), exports);
|
|
32
|
+
__exportStar(require("./modules/payout/payout.module"), exports);
|
|
33
|
+
__exportStar(require("./modules/payout/payout.service"), exports);
|
|
34
|
+
__exportStar(require("./modules/personal-data/personal-data.module"), exports);
|
|
35
|
+
__exportStar(require("./modules/personal-data/personal-data.service"), exports);
|
|
36
|
+
__exportStar(require("./modules/receipt/receipt.module"), exports);
|
|
37
|
+
__exportStar(require("./modules/receipt/receipt.service"), exports);
|
|
38
|
+
__exportStar(require("./modules/refund/refund.module"), exports);
|
|
39
|
+
__exportStar(require("./modules/refund/refund.service"), exports);
|
|
40
|
+
__exportStar(require("./modules/sbp-banks/sbp-banks.module"), exports);
|
|
41
|
+
__exportStar(require("./modules/sbp-banks/sbp-banks.service"), exports);
|
|
42
|
+
__exportStar(require("./modules/webhook/webhook.module"), exports);
|
|
43
|
+
__exportStar(require("./modules/webhook/webhook.service"), exports);
|
|
44
|
+
__exportStar(require("./modules/webhook/decorators"), exports);
|
|
45
|
+
__exportStar(require("./modules/webhook/guards/yookassa-webhook.guard"), exports);
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,wCAAqB;AACrB,oDAAiC;AACjC,qDAAkC;AAClC,wDAAqC;AAGrC,uDAAoC;AAGpC,6DAA0C;AAC1C,8DAA2C;AAC3C,mEAAgD;AAChD,oEAAiD;AACjD,yDAAsC;AACtC,0DAAuC;AACvC,mEAAgD;AAChD,oEAAiD;AACjD,iFAA8D;AAC9D,kFAA+D;AAC/D,iEAA8C;AAC9C,kEAA+C;AAC/C,+EAA4D;AAC5D,gFAA6D;AAC7D,mEAAgD;AAChD,oEAAiD;AACjD,iEAA8C;AAC9C,kEAA+C;AAC/C,uEAAoD;AACpD,wEAAqD;AACrD,mEAAgD;AAChD,oEAAiD;AACjD,+DAA4C;AAC5C,kFAA+D"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.DealModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const deal_service_1 = require("./deal.service");
|
|
12
|
+
let DealModule = class DealModule {
|
|
13
|
+
};
|
|
14
|
+
exports.DealModule = DealModule;
|
|
15
|
+
exports.DealModule = DealModule = __decorate([
|
|
16
|
+
(0, common_1.Module)({
|
|
17
|
+
providers: [deal_service_1.DealService],
|
|
18
|
+
exports: [deal_service_1.DealService]
|
|
19
|
+
})
|
|
20
|
+
], DealModule);
|
|
21
|
+
//# sourceMappingURL=deal.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deal.module.js","sourceRoot":"","sources":["../../../src/modules/deal/deal.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAuC;AAEvC,iDAA4C;AAMrC,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IAJtB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,0BAAW,CAAC;QACxB,OAAO,EAAE,CAAC,0BAAW,CAAC;KACvB,CAAC;GACW,UAAU,CAAG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { YookassaHttpClient } from '../../http/yookassa.http-client';
|
|
2
|
+
import type { CreateDealRequest, CreateDealResponse, GetDealResponse, GetDealsListRequest, GetDealsListResponse } from '../../api';
|
|
3
|
+
export declare class DealService {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: YookassaHttpClient);
|
|
6
|
+
create(data: CreateDealRequest): Promise<CreateDealResponse>;
|
|
7
|
+
getAll(params?: GetDealsListRequest): Promise<GetDealsListResponse>;
|
|
8
|
+
getById(id: string): Promise<GetDealResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DealService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const yookassa_http_client_1 = require("../../http/yookassa.http-client");
|
|
15
|
+
let DealService = class DealService {
|
|
16
|
+
constructor(http) {
|
|
17
|
+
this.http = http;
|
|
18
|
+
}
|
|
19
|
+
async create(data) {
|
|
20
|
+
return this.http.post('/deals', data);
|
|
21
|
+
}
|
|
22
|
+
async getAll(params = {}) {
|
|
23
|
+
return this.http.get('/deals', params);
|
|
24
|
+
}
|
|
25
|
+
async getById(id) {
|
|
26
|
+
return this.http.get(`/deals/${id}`);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.DealService = DealService;
|
|
30
|
+
exports.DealService = DealService = __decorate([
|
|
31
|
+
(0, common_1.Injectable)(),
|
|
32
|
+
__metadata("design:paramtypes", [yookassa_http_client_1.YookassaHttpClient])
|
|
33
|
+
], DealService);
|
|
34
|
+
//# sourceMappingURL=deal.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deal.service.js","sourceRoot":"","sources":["../../../src/modules/deal/deal.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2C;AAE3C,0EAAoE;AAU7D,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,YAAoC,IAAwB;QAAxB,SAAI,GAAJ,IAAI,CAAoB;IAAG,CAAC;IAOzD,KAAK,CAAC,MAAM,CAAC,IAAuB;QACzC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;IACvC,CAAC;IAQM,KAAK,CAAC,MAAM,CAAC,SAA8B,EAAE;QAClD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;IACxC,CAAC;IAOM,KAAK,CAAC,OAAO,CAAC,EAAU;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;IACtC,CAAC;CACF,CAAA;AA9BY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAE+B,yCAAkB;GADjD,WAAW,CA8BvB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.InvoiceModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const invoice_service_1 = require("./invoice.service");
|
|
12
|
+
let InvoiceModule = class InvoiceModule {
|
|
13
|
+
};
|
|
14
|
+
exports.InvoiceModule = InvoiceModule;
|
|
15
|
+
exports.InvoiceModule = InvoiceModule = __decorate([
|
|
16
|
+
(0, common_1.Module)({
|
|
17
|
+
providers: [invoice_service_1.InvoiceService],
|
|
18
|
+
exports: [invoice_service_1.InvoiceService]
|
|
19
|
+
})
|
|
20
|
+
], InvoiceModule);
|
|
21
|
+
//# sourceMappingURL=invoice.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice.module.js","sourceRoot":"","sources":["../../../src/modules/invoice/invoice.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAuC;AACvC,uDAAkD;AAM3C,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IAJzB,IAAA,eAAM,EAAC;QACP,SAAS,EAAE,CAAC,gCAAc,CAAC;QAC3B,OAAO,EAAE,CAAC,gCAAc,CAAC;KACzB,CAAC;GACW,aAAa,CAAG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { YookassaHttpClient } from '../../http/yookassa.http-client';
|
|
2
|
+
import type { CreateInvoiceRequest, CreateInvoiceResponse, GetInvoiceResponse } from '../../api';
|
|
3
|
+
export declare class InvoiceService {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: YookassaHttpClient);
|
|
6
|
+
create(data: CreateInvoiceRequest): Promise<CreateInvoiceResponse>;
|
|
7
|
+
getById(id: string): Promise<GetInvoiceResponse>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.InvoiceService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const yookassa_http_client_1 = require("../../http/yookassa.http-client");
|
|
15
|
+
let InvoiceService = class InvoiceService {
|
|
16
|
+
constructor(http) {
|
|
17
|
+
this.http = http;
|
|
18
|
+
}
|
|
19
|
+
async create(data) {
|
|
20
|
+
return this.http.post('/invoices', data);
|
|
21
|
+
}
|
|
22
|
+
async getById(id) {
|
|
23
|
+
return this.http.get(`/invoices/${id}`);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.InvoiceService = InvoiceService;
|
|
27
|
+
exports.InvoiceService = InvoiceService = __decorate([
|
|
28
|
+
(0, common_1.Injectable)(),
|
|
29
|
+
__metadata("design:paramtypes", [yookassa_http_client_1.YookassaHttpClient])
|
|
30
|
+
], InvoiceService);
|
|
31
|
+
//# sourceMappingURL=invoice.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice.service.js","sourceRoot":"","sources":["../../../src/modules/invoice/invoice.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2C;AAE3C,0EAAoE;AAI7D,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAAoC,IAAwB;QAAxB,SAAI,GAAJ,IAAI,CAAoB;IAAG,CAAC;IASzD,KAAK,CAAC,MAAM,CAAC,IAA0B;QAC5C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IAC1C,CAAC;IAOM,KAAK,CAAC,OAAO,CAAC,EAAU;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,CAAC,CAAA;IACzC,CAAC;CACF,CAAA;AAtBY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAE+B,yCAAkB;GADjD,cAAc,CAsB1B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.MeModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const me_service_1 = require("./me.service");
|
|
12
|
+
let MeModule = class MeModule {
|
|
13
|
+
};
|
|
14
|
+
exports.MeModule = MeModule;
|
|
15
|
+
exports.MeModule = MeModule = __decorate([
|
|
16
|
+
(0, common_1.Module)({
|
|
17
|
+
providers: [me_service_1.MeService],
|
|
18
|
+
exports: [me_service_1.MeService]
|
|
19
|
+
})
|
|
20
|
+
], MeModule);
|
|
21
|
+
//# sourceMappingURL=me.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"me.module.js","sourceRoot":"","sources":["../../../src/modules/me/me.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAuC;AAEvC,6CAAwC;AAMjC,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAAG,CAAA;AAAX,4BAAQ;mBAAR,QAAQ;IAJpB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,sBAAS,CAAC;QACtB,OAAO,EAAE,CAAC,sBAAS,CAAC;KACrB,CAAC;GACW,QAAQ,CAAG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { YookassaHttpClient } from '../../http/yookassa.http-client';
|
|
2
|
+
import type { GetMeRequest, GetMeResponse } from '../../api';
|
|
3
|
+
export declare class MeService {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: YookassaHttpClient);
|
|
6
|
+
get(params?: GetMeRequest): Promise<GetMeResponse>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MeService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const yookassa_http_client_1 = require("../../http/yookassa.http-client");
|
|
15
|
+
let MeService = class MeService {
|
|
16
|
+
constructor(http) {
|
|
17
|
+
this.http = http;
|
|
18
|
+
}
|
|
19
|
+
async get(params = {}) {
|
|
20
|
+
return this.http.get('/me', params);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.MeService = MeService;
|
|
24
|
+
exports.MeService = MeService = __decorate([
|
|
25
|
+
(0, common_1.Injectable)(),
|
|
26
|
+
__metadata("design:paramtypes", [yookassa_http_client_1.YookassaHttpClient])
|
|
27
|
+
], MeService);
|
|
28
|
+
//# sourceMappingURL=me.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"me.service.js","sourceRoot":"","sources":["../../../src/modules/me/me.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2C;AAE3C,0EAAoE;AAI7D,IAAM,SAAS,GAAf,MAAM,SAAS;IACpB,YAAoC,IAAwB;QAAxB,SAAI,GAAJ,IAAI,CAAoB;IAAG,CAAC;IASzD,KAAK,CAAC,GAAG,CAAC,SAAuB,EAAE;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;IACrC,CAAC;CACF,CAAA;AAbY,8BAAS;oBAAT,SAAS;IADrB,IAAA,mBAAU,GAAE;qCAE+B,yCAAkB;GADjD,SAAS,CAarB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PaymentModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const payment_service_1 = require("./payment.service");
|
|
12
|
+
let PaymentModule = class PaymentModule {
|
|
13
|
+
};
|
|
14
|
+
exports.PaymentModule = PaymentModule;
|
|
15
|
+
exports.PaymentModule = PaymentModule = __decorate([
|
|
16
|
+
(0, common_1.Module)({
|
|
17
|
+
providers: [payment_service_1.PaymentService],
|
|
18
|
+
exports: [payment_service_1.PaymentService]
|
|
19
|
+
})
|
|
20
|
+
], PaymentModule);
|
|
21
|
+
//# sourceMappingURL=payment.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment.module.js","sourceRoot":"","sources":["../../../src/modules/payment/payment.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAuC;AACvC,uDAAkD;AAM3C,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IAJzB,IAAA,eAAM,EAAC;QACP,SAAS,EAAE,CAAC,gCAAc,CAAC;QAC3B,OAAO,EAAE,CAAC,gCAAc,CAAC;KACzB,CAAC;GACW,aAAa,CAAG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { YookassaHttpClient } from '../../http/yookassa.http-client';
|
|
2
|
+
import type { CancelPaymentResponse, CapturePaymentRequest, CapturePaymentResponse, CreatePaymentRequest, CreatePaymentResponse, GetPaymentResponse, GetPaymentsListRequest, GetPaymentsListResponse } from '../../api';
|
|
3
|
+
export declare class PaymentService {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: YookassaHttpClient);
|
|
6
|
+
create(data: CreatePaymentRequest): Promise<CreatePaymentResponse>;
|
|
7
|
+
getAll(params?: GetPaymentsListRequest): Promise<GetPaymentsListResponse>;
|
|
8
|
+
getById(id: string): Promise<GetPaymentResponse>;
|
|
9
|
+
capture(id: string, data?: CapturePaymentRequest): Promise<CapturePaymentResponse>;
|
|
10
|
+
cancel(id: string): Promise<CancelPaymentResponse>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PaymentService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const yookassa_http_client_1 = require("../../http/yookassa.http-client");
|
|
15
|
+
let PaymentService = class PaymentService {
|
|
16
|
+
constructor(http) {
|
|
17
|
+
this.http = http;
|
|
18
|
+
}
|
|
19
|
+
async create(data) {
|
|
20
|
+
return this.http.post('/payments', data);
|
|
21
|
+
}
|
|
22
|
+
async getAll(params = {}) {
|
|
23
|
+
return this.http.get('/payments', params);
|
|
24
|
+
}
|
|
25
|
+
async getById(id) {
|
|
26
|
+
return this.http.get(`/payments/${id}`);
|
|
27
|
+
}
|
|
28
|
+
async capture(id, data) {
|
|
29
|
+
return this.http.post(`/payments/${id}/capture`, data);
|
|
30
|
+
}
|
|
31
|
+
async cancel(id) {
|
|
32
|
+
return this.http.post(`/payments/${id}/cancel`);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.PaymentService = PaymentService;
|
|
36
|
+
exports.PaymentService = PaymentService = __decorate([
|
|
37
|
+
(0, common_1.Injectable)(),
|
|
38
|
+
__metadata("design:paramtypes", [yookassa_http_client_1.YookassaHttpClient])
|
|
39
|
+
], PaymentService);
|
|
40
|
+
//# sourceMappingURL=payment.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment.service.js","sourceRoot":"","sources":["../../../src/modules/payment/payment.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2C;AAE3C,0EAAoE;AAa7D,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAAoC,IAAwB;QAAxB,SAAI,GAAJ,IAAI,CAAoB;IAAG,CAAC;IASzD,KAAK,CAAC,MAAM,CAAC,IAA0B;QAC5C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IAC1C,CAAC;IAUM,KAAK,CAAC,MAAM,CAAC,SAAiC,EAAE;QACrD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;IAC3C,CAAC;IAOM,KAAK,CAAC,OAAO,CAAC,EAAU;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,CAAC,CAAA;IACzC,CAAC;IAUM,KAAK,CAAC,OAAO,CAAC,EAAU,EAAE,IAA4B;QAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU,EAAE,IAAI,CAAC,CAAA;IACxD,CAAC;IASM,KAAK,CAAC,MAAM,CAAC,EAAU;QAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,CAAA;IACjD,CAAC;CACF,CAAA;AAzDY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAE+B,yCAAkB;GADjD,cAAc,CAyD1B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PaymentMethodModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const payment_method_service_1 = require("./payment-method.service");
|
|
12
|
+
let PaymentMethodModule = class PaymentMethodModule {
|
|
13
|
+
};
|
|
14
|
+
exports.PaymentMethodModule = PaymentMethodModule;
|
|
15
|
+
exports.PaymentMethodModule = PaymentMethodModule = __decorate([
|
|
16
|
+
(0, common_1.Module)({
|
|
17
|
+
providers: [payment_method_service_1.PaymentMethodService],
|
|
18
|
+
exports: [payment_method_service_1.PaymentMethodService]
|
|
19
|
+
})
|
|
20
|
+
], PaymentMethodModule);
|
|
21
|
+
//# sourceMappingURL=payment-method.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-method.module.js","sourceRoot":"","sources":["../../../src/modules/payment-method/payment-method.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAuC;AACvC,qEAA+D;AAMxD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAAG,CAAA;AAAtB,kDAAmB;8BAAnB,mBAAmB;IAJ/B,IAAA,eAAM,EAAC;QACP,SAAS,EAAE,CAAC,6CAAoB,CAAC;QACjC,OAAO,EAAE,CAAC,6CAAoB,CAAC;KAC/B,CAAC;GACW,mBAAmB,CAAG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CreatePaymentMethodRequest, CreatePaymentMethodResponse, GetPaymentMethodResponse } from '../../api';
|
|
2
|
+
import { YookassaHttpClient } from '../../http/yookassa.http-client';
|
|
3
|
+
export declare class PaymentMethodService {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: YookassaHttpClient);
|
|
6
|
+
create(data: CreatePaymentMethodRequest): Promise<CreatePaymentMethodResponse>;
|
|
7
|
+
getById(id: string): Promise<GetPaymentMethodResponse>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PaymentMethodService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const yookassa_http_client_1 = require("../../http/yookassa.http-client");
|
|
15
|
+
let PaymentMethodService = class PaymentMethodService {
|
|
16
|
+
constructor(http) {
|
|
17
|
+
this.http = http;
|
|
18
|
+
}
|
|
19
|
+
async create(data) {
|
|
20
|
+
return this.http.post('/payment_methods', data);
|
|
21
|
+
}
|
|
22
|
+
async getById(id) {
|
|
23
|
+
return this.http.get(`/payment_methods/${id}`);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.PaymentMethodService = PaymentMethodService;
|
|
27
|
+
exports.PaymentMethodService = PaymentMethodService = __decorate([
|
|
28
|
+
(0, common_1.Injectable)(),
|
|
29
|
+
__metadata("design:paramtypes", [yookassa_http_client_1.YookassaHttpClient])
|
|
30
|
+
], PaymentMethodService);
|
|
31
|
+
//# sourceMappingURL=payment-method.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-method.service.js","sourceRoot":"","sources":["../../../src/modules/payment-method/payment-method.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2C;AAM3C,0EAAoE;AAG7D,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YAAoC,IAAwB;QAAxB,SAAI,GAAJ,IAAI,CAAoB;IAAG,CAAC;IASzD,KAAK,CAAC,MAAM,CAAC,IAAgC;QAClD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAA;IACjD,CAAC;IAOM,KAAK,CAAC,OAAO,CAAC,EAAU;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAA;IAChD,CAAC;CACF,CAAA;AAtBY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAE+B,yCAAkB;GADjD,oBAAoB,CAsBhC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PayoutModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const payout_service_1 = require("./payout.service");
|
|
12
|
+
let PayoutModule = class PayoutModule {
|
|
13
|
+
};
|
|
14
|
+
exports.PayoutModule = PayoutModule;
|
|
15
|
+
exports.PayoutModule = PayoutModule = __decorate([
|
|
16
|
+
(0, common_1.Module)({
|
|
17
|
+
providers: [payout_service_1.PayoutService],
|
|
18
|
+
exports: [payout_service_1.PayoutService]
|
|
19
|
+
})
|
|
20
|
+
], PayoutModule);
|
|
21
|
+
//# sourceMappingURL=payout.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payout.module.js","sourceRoot":"","sources":["../../../src/modules/payout/payout.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAuC;AAEvC,qDAAgD;AAMzC,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IAJxB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,8BAAa,CAAC;QAC1B,OAAO,EAAE,CAAC,8BAAa,CAAC;KACzB,CAAC;GACW,YAAY,CAAG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { YookassaHttpClient } from '../../http/yookassa.http-client';
|
|
2
|
+
import type { CreatePayoutRequest, CreatePayoutResponse, GetPayoutResponse, GetPayoutsListRequest, GetPayoutsListResponse, GetPayoutsSearchRequest, GetPayoutsSearchResponse } from '../../api';
|
|
3
|
+
export declare class PayoutService {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: YookassaHttpClient);
|
|
6
|
+
create(data: CreatePayoutRequest): Promise<CreatePayoutResponse>;
|
|
7
|
+
getAll(params?: GetPayoutsListRequest): Promise<GetPayoutsListResponse>;
|
|
8
|
+
search(params?: GetPayoutsSearchRequest): Promise<GetPayoutsSearchResponse>;
|
|
9
|
+
getById(id: string): Promise<GetPayoutResponse>;
|
|
10
|
+
}
|