@just-education-org/rpc-contracts 1.17.1 → 1.18.0
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/dist/generated/ts/payment.d.ts +5 -3
- package/dist/generated/ts/payment_method.d.ts +58 -0
- package/dist/generated/ts/payment_method.js +33 -0
- package/dist/generated/ts/refund.d.ts +28 -0
- package/dist/generated/ts/refund.js +28 -0
- package/dist/proto/paths.d.ts +2 -0
- package/dist/proto/paths.js +2 -0
- package/package.json +1 -1
- package/proto/payment.proto +7 -3
- package/proto/payment_method.proto +58 -0
- package/proto/refund.proto +27 -0
|
@@ -19,10 +19,12 @@ export interface ProcessPaymentEventRequest {
|
|
|
19
19
|
bookingId: string;
|
|
20
20
|
userId: string;
|
|
21
21
|
savePaymentMethod: boolean;
|
|
22
|
-
|
|
22
|
+
providerMethodId?: string | undefined;
|
|
23
23
|
/** bin */
|
|
24
|
-
cardFirst6
|
|
25
|
-
cardLast4
|
|
24
|
+
cardFirst6?: string | undefined;
|
|
25
|
+
cardLast4?: string | undefined;
|
|
26
|
+
bank?: string | undefined;
|
|
27
|
+
brand?: string | undefined;
|
|
26
28
|
}
|
|
27
29
|
export interface ProcessPaymentEventResponse {
|
|
28
30
|
ok: boolean;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "payment_method.v1";
|
|
3
|
+
export interface GetUserPaymentMethodsRequest {
|
|
4
|
+
userId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface GetUserPaymentMethodsResponse {
|
|
7
|
+
methods: PaymentMethodItem[];
|
|
8
|
+
}
|
|
9
|
+
export interface CreatePaymentMethodRequest {
|
|
10
|
+
userId: string;
|
|
11
|
+
}
|
|
12
|
+
export interface CreatePaymentMethodResponse {
|
|
13
|
+
id: string;
|
|
14
|
+
url: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* - Що таке verify?
|
|
18
|
+
* - youkassa не присилає вебхук, коли в нас прив"язаний paymeth method.
|
|
19
|
+
* / і нам треба це самим в ручну перевіряти, і тому коли в нас буде відбуватесь стврення, ми буде створювать paymetnMethod в насшій БД(без даних карти) та привязка до юзера
|
|
20
|
+
* / і коли юзер це все прив"язує його на фронті перекидує на сторінку де в квері параметрі прикинутий ід пеймент метода в нашій системі і там ми як раз викликаємо verify payment method
|
|
21
|
+
* Відбувається пошук платіжного способу, в нашій системі і далі вже його прив"язка
|
|
22
|
+
*/
|
|
23
|
+
export interface VerifyPaymentMethodRequest {
|
|
24
|
+
userId: string;
|
|
25
|
+
methodId: string;
|
|
26
|
+
}
|
|
27
|
+
export interface VerifyPaymentMethodResponse {
|
|
28
|
+
ok: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface DeletePaymentMethodRequest {
|
|
31
|
+
userId: string;
|
|
32
|
+
methodId: string;
|
|
33
|
+
}
|
|
34
|
+
export interface DeletePaymentMethodResponse {
|
|
35
|
+
ok: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface PaymentMethodItem {
|
|
38
|
+
id: string;
|
|
39
|
+
bank?: string | undefined;
|
|
40
|
+
brand?: string | undefined;
|
|
41
|
+
first6?: string | undefined;
|
|
42
|
+
last4?: string | undefined;
|
|
43
|
+
}
|
|
44
|
+
export declare const PAYMENT_METHOD_V1_PACKAGE_NAME = "payment_method.v1";
|
|
45
|
+
export interface PaymentMethodServiceClient {
|
|
46
|
+
getUserPaymentMethods(request: GetUserPaymentMethodsRequest): Observable<GetUserPaymentMethodsResponse>;
|
|
47
|
+
createPaymentMethod(request: CreatePaymentMethodRequest): Observable<CreatePaymentMethodResponse>;
|
|
48
|
+
verifyPaymentMethod(request: VerifyPaymentMethodRequest): Observable<VerifyPaymentMethodResponse>;
|
|
49
|
+
deletePaymentMethod(request: DeletePaymentMethodRequest): Observable<DeletePaymentMethodResponse>;
|
|
50
|
+
}
|
|
51
|
+
export interface PaymentMethodServiceController {
|
|
52
|
+
getUserPaymentMethods(request: GetUserPaymentMethodsRequest): Promise<GetUserPaymentMethodsResponse> | Observable<GetUserPaymentMethodsResponse> | GetUserPaymentMethodsResponse;
|
|
53
|
+
createPaymentMethod(request: CreatePaymentMethodRequest): Promise<CreatePaymentMethodResponse> | Observable<CreatePaymentMethodResponse> | CreatePaymentMethodResponse;
|
|
54
|
+
verifyPaymentMethod(request: VerifyPaymentMethodRequest): Promise<VerifyPaymentMethodResponse> | Observable<VerifyPaymentMethodResponse> | VerifyPaymentMethodResponse;
|
|
55
|
+
deletePaymentMethod(request: DeletePaymentMethodRequest): Promise<DeletePaymentMethodResponse> | Observable<DeletePaymentMethodResponse> | DeletePaymentMethodResponse;
|
|
56
|
+
}
|
|
57
|
+
export declare function PaymentMethodServiceControllerMethods(): (constructor: Function) => void;
|
|
58
|
+
export declare const PAYMENT_METHOD_SERVICE_NAME = "PaymentMethodService";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
|
+
// protoc v3.21.12
|
|
6
|
+
// source: payment_method.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.PAYMENT_METHOD_SERVICE_NAME = exports.PAYMENT_METHOD_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.PaymentMethodServiceControllerMethods = PaymentMethodServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "payment_method.v1";
|
|
13
|
+
exports.PAYMENT_METHOD_V1_PACKAGE_NAME = "payment_method.v1";
|
|
14
|
+
function PaymentMethodServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = [
|
|
17
|
+
"getUserPaymentMethods",
|
|
18
|
+
"createPaymentMethod",
|
|
19
|
+
"verifyPaymentMethod",
|
|
20
|
+
"deletePaymentMethod",
|
|
21
|
+
];
|
|
22
|
+
for (const method of grpcMethods) {
|
|
23
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
24
|
+
(0, microservices_1.GrpcMethod)("PaymentMethodService", method)(constructor.prototype[method], method, descriptor);
|
|
25
|
+
}
|
|
26
|
+
const grpcStreamMethods = [];
|
|
27
|
+
for (const method of grpcStreamMethods) {
|
|
28
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
29
|
+
(0, microservices_1.GrpcStreamMethod)("PaymentMethodService", method)(constructor.prototype[method], method, descriptor);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
exports.PAYMENT_METHOD_SERVICE_NAME = "PaymentMethodService";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "refund.v1";
|
|
3
|
+
export interface CreateRefundRequest {
|
|
4
|
+
bookingId: string;
|
|
5
|
+
userId: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CreateRefundResponse {
|
|
8
|
+
ok: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ProcessRefundEventRequest {
|
|
11
|
+
event: string;
|
|
12
|
+
providerRefundId: string;
|
|
13
|
+
status: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ProcessRefundEventResponse {
|
|
16
|
+
ok: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const REFUND_V1_PACKAGE_NAME = "refund.v1";
|
|
19
|
+
export interface RefundServiceClient {
|
|
20
|
+
createRefund(request: CreateRefundRequest): Observable<CreateRefundResponse>;
|
|
21
|
+
processRefundEvent(request: ProcessRefundEventRequest): Observable<ProcessRefundEventResponse>;
|
|
22
|
+
}
|
|
23
|
+
export interface RefundServiceController {
|
|
24
|
+
createRefund(request: CreateRefundRequest): Promise<CreateRefundResponse> | Observable<CreateRefundResponse> | CreateRefundResponse;
|
|
25
|
+
processRefundEvent(request: ProcessRefundEventRequest): Promise<ProcessRefundEventResponse> | Observable<ProcessRefundEventResponse> | ProcessRefundEventResponse;
|
|
26
|
+
}
|
|
27
|
+
export declare function RefundServiceControllerMethods(): (constructor: Function) => void;
|
|
28
|
+
export declare const REFUND_SERVICE_NAME = "RefundService";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
|
+
// protoc v3.21.12
|
|
6
|
+
// source: refund.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.REFUND_SERVICE_NAME = exports.REFUND_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.RefundServiceControllerMethods = RefundServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "refund.v1";
|
|
13
|
+
exports.REFUND_V1_PACKAGE_NAME = "refund.v1";
|
|
14
|
+
function RefundServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = ["createRefund", "processRefundEvent"];
|
|
17
|
+
for (const method of grpcMethods) {
|
|
18
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
|
+
(0, microservices_1.GrpcMethod)("RefundService", method)(constructor.prototype[method], method, descriptor);
|
|
20
|
+
}
|
|
21
|
+
const grpcStreamMethods = [];
|
|
22
|
+
for (const method of grpcStreamMethods) {
|
|
23
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
24
|
+
(0, microservices_1.GrpcStreamMethod)("RefundService", method)(constructor.prototype[method], method, descriptor);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.REFUND_SERVICE_NAME = "RefundService";
|
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
|
@@ -14,4 +14,6 @@ exports.PROTO_PATHS = {
|
|
|
14
14
|
SEAT: (0, path_1.join)(__dirname, "../../proto/seat.proto"),
|
|
15
15
|
SCREENING: (0, path_1.join)(__dirname, "../../proto/screening.proto"),
|
|
16
16
|
PAYMENT: (0, path_1.join)(__dirname, "../../proto/payment.proto"),
|
|
17
|
+
PAYMENT_METHOD: (0, path_1.join)(__dirname, "../../proto/payment_method.proto"),
|
|
18
|
+
REFUND: (0, path_1.join)(__dirname, "../../proto/refund.proto"),
|
|
17
19
|
};
|
package/package.json
CHANGED
package/proto/payment.proto
CHANGED
|
@@ -26,9 +26,13 @@ message ProcessPaymentEventRequest {
|
|
|
26
26
|
string booking_id = 3;
|
|
27
27
|
string user_id = 4;
|
|
28
28
|
bool save_payment_method = 5;
|
|
29
|
-
string
|
|
30
|
-
|
|
31
|
-
string
|
|
29
|
+
optional string provider_method_id = 6;
|
|
30
|
+
|
|
31
|
+
optional string card_first6 = 7; // bin
|
|
32
|
+
optional string card_last4 = 8;
|
|
33
|
+
|
|
34
|
+
optional string bank = 9;
|
|
35
|
+
optional string brand = 10;
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
message ProcessPaymentEventResponse {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package payment_method.v1;
|
|
4
|
+
|
|
5
|
+
service PaymentMethodService {
|
|
6
|
+
rpc GetUserPaymentMethods(GetUserPaymentMethodsRequest) returns(GetUserPaymentMethodsResponse);
|
|
7
|
+
rpc CreatePaymentMethod(CreatePaymentMethodRequest) returns(CreatePaymentMethodResponse);
|
|
8
|
+
rpc VerifyPaymentMethod(VerifyPaymentMethodRequest) returns(VerifyPaymentMethodResponse);
|
|
9
|
+
rpc DeletePaymentMethod(DeletePaymentMethodRequest) returns(DeletePaymentMethodResponse);
|
|
10
|
+
}
|
|
11
|
+
message GetUserPaymentMethodsRequest {
|
|
12
|
+
string user_id = 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message GetUserPaymentMethodsResponse {
|
|
16
|
+
repeated PaymentMethodItem methods = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message CreatePaymentMethodRequest {
|
|
20
|
+
string user_id = 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message CreatePaymentMethodResponse {
|
|
24
|
+
string id = 1;
|
|
25
|
+
string url = 2;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message VerifyPaymentMethodRequest {
|
|
29
|
+
// - Що таке verify?
|
|
30
|
+
// - youkassa не присилає вебхук, коли в нас прив"язаний paymeth method.
|
|
31
|
+
/// і нам треба це самим в ручну перевіряти, і тому коли в нас буде відбуватесь стврення, ми буде створювать paymetnMethod в насшій БД(без даних карти) та привязка до юзера
|
|
32
|
+
/// і коли юзер це все прив"язує його на фронті перекидує на сторінку де в квері параметрі прикинутий ід пеймент метода в нашій системі і там ми як раз викликаємо verify payment method
|
|
33
|
+
// Відбувається пошук платіжного способу, в нашій системі і далі вже його прив"язка
|
|
34
|
+
|
|
35
|
+
string user_id = 1;
|
|
36
|
+
string method_id = 2;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
message VerifyPaymentMethodResponse {
|
|
40
|
+
bool ok = 1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
message DeletePaymentMethodRequest {
|
|
44
|
+
string user_id = 1;
|
|
45
|
+
string method_id = 2;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
message DeletePaymentMethodResponse {
|
|
49
|
+
bool ok = 1;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
message PaymentMethodItem {
|
|
53
|
+
string id = 1;
|
|
54
|
+
optional string bank = 2;
|
|
55
|
+
optional string brand = 3;
|
|
56
|
+
optional string first6 = 4;
|
|
57
|
+
optional string last4 = 5;
|
|
58
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package refund.v1;
|
|
4
|
+
|
|
5
|
+
service RefundService {
|
|
6
|
+
rpc CreateRefund(CreateRefundRequest) returns(CreateRefundResponse);
|
|
7
|
+
rpc ProcessRefundEvent(ProcessRefundEventRequest) returns(ProcessRefundEventResponse);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
message CreateRefundRequest {
|
|
11
|
+
string booking_id = 1;
|
|
12
|
+
string user_id = 2;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message CreateRefundResponse {
|
|
16
|
+
bool ok = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message ProcessRefundEventRequest {
|
|
20
|
+
string event = 1;
|
|
21
|
+
string provider_refund_id = 2;
|
|
22
|
+
string status = 3;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message ProcessRefundEventResponse {
|
|
26
|
+
bool ok = 1;
|
|
27
|
+
}
|