@barumetric/contracts 1.3.6 → 1.3.7
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/gen/ts/payment.ts +16 -0
- package/package.json +1 -1
- package/proto/payment.proto +11 -0
package/gen/ts/payment.ts
CHANGED
|
@@ -10,6 +10,15 @@ import { Observable } from "rxjs";
|
|
|
10
10
|
|
|
11
11
|
export const protobufPackage = "payment.v1";
|
|
12
12
|
|
|
13
|
+
export interface CreateUserBalanceRequest {
|
|
14
|
+
userId: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Ответ — ссылка на оплату */
|
|
18
|
+
export interface CreateUserBalanceResponse {
|
|
19
|
+
ok: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
13
22
|
/** Запрос на пополнение баланса */
|
|
14
23
|
export interface TopUpBalanceRequest {
|
|
15
24
|
userId: string;
|
|
@@ -88,6 +97,8 @@ export interface PaymentMethodItem {
|
|
|
88
97
|
export const PAYMENT_V1_PACKAGE_NAME = "payment.v1";
|
|
89
98
|
|
|
90
99
|
export interface PaymentServiceClient {
|
|
100
|
+
createUserBalance(request: CreateUserBalanceRequest): Observable<CreateUserBalanceResponse>;
|
|
101
|
+
|
|
91
102
|
topUpBalance(request: TopUpBalanceRequest): Observable<TopUpBalanceResponse>;
|
|
92
103
|
|
|
93
104
|
processPaymentEvent(request: ProcessPaymentEventRequest): Observable<ProcessPaymentEventResponse>;
|
|
@@ -102,6 +113,10 @@ export interface PaymentServiceClient {
|
|
|
102
113
|
}
|
|
103
114
|
|
|
104
115
|
export interface PaymentServiceController {
|
|
116
|
+
createUserBalance(
|
|
117
|
+
request: CreateUserBalanceRequest,
|
|
118
|
+
): Promise<CreateUserBalanceResponse> | Observable<CreateUserBalanceResponse> | CreateUserBalanceResponse;
|
|
119
|
+
|
|
105
120
|
topUpBalance(
|
|
106
121
|
request: TopUpBalanceRequest,
|
|
107
122
|
): Promise<TopUpBalanceResponse> | Observable<TopUpBalanceResponse> | TopUpBalanceResponse;
|
|
@@ -130,6 +145,7 @@ export interface PaymentServiceController {
|
|
|
130
145
|
export function PaymentServiceControllerMethods() {
|
|
131
146
|
return function (constructor: Function) {
|
|
132
147
|
const grpcMethods: string[] = [
|
|
148
|
+
"createUserBalance",
|
|
133
149
|
"topUpBalance",
|
|
134
150
|
"processPaymentEvent",
|
|
135
151
|
"getUserPaymentMethods",
|
package/package.json
CHANGED
package/proto/payment.proto
CHANGED
|
@@ -3,6 +3,8 @@ syntax = "proto3";
|
|
|
3
3
|
package payment.v1;
|
|
4
4
|
|
|
5
5
|
service PaymentService {
|
|
6
|
+
rpc CreateUserBalance (CreateUserBalanceRequest) returns (CreateUserBalanceResponse);
|
|
7
|
+
|
|
6
8
|
rpc TopUpBalance (TopUpBalanceRequest) returns (TopUpBalanceResponse);
|
|
7
9
|
rpc ProcessPaymentEvent (ProcessPaymentEventRequest) returns (ProcessPaymentEventResponse);
|
|
8
10
|
|
|
@@ -12,6 +14,15 @@ service PaymentService {
|
|
|
12
14
|
rpc DeletePaymentMethod (DeletePaymentMethodRequest) returns (DeletePaymentMethodResponse);
|
|
13
15
|
}
|
|
14
16
|
|
|
17
|
+
message CreateUserBalanceRequest {
|
|
18
|
+
string user_id = 1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Ответ — ссылка на оплату
|
|
22
|
+
message CreateUserBalanceResponse {
|
|
23
|
+
bool ok = 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
15
26
|
// Запрос на пополнение баланса
|
|
16
27
|
message TopUpBalanceRequest {
|
|
17
28
|
string user_id = 1;
|