@readytomog/contracts 1.5.0 → 1.5.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/gen/payment.ts +32 -5
- package/package.json +1 -1
- package/proto/payment.proto +40 -10
package/gen/payment.ts
CHANGED
|
@@ -11,31 +11,60 @@ import { Empty } from "./google/protobuf/empty";
|
|
|
11
11
|
|
|
12
12
|
export const protobufPackage = "payment.v3";
|
|
13
13
|
|
|
14
|
-
export interface
|
|
14
|
+
export interface Transaction {
|
|
15
|
+
id: string;
|
|
16
|
+
status: string;
|
|
17
|
+
paymentProvider: string;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
updatedAt: string;
|
|
20
|
+
billingPeriod: string;
|
|
21
|
+
amount: number;
|
|
22
|
+
userId: string;
|
|
23
|
+
planId: string;
|
|
15
24
|
}
|
|
16
25
|
|
|
17
26
|
export interface GetHistoryResponse {
|
|
27
|
+
transactions: Transaction[];
|
|
18
28
|
}
|
|
19
29
|
|
|
20
30
|
export interface InitTransactionRequest {
|
|
31
|
+
planId: string;
|
|
32
|
+
billingPeriod: string;
|
|
33
|
+
provider: string;
|
|
21
34
|
}
|
|
22
35
|
|
|
23
36
|
export interface InitTransactionResponse {
|
|
37
|
+
cancelUrl: string;
|
|
38
|
+
successUrl: string;
|
|
39
|
+
url: string;
|
|
24
40
|
}
|
|
25
41
|
|
|
26
42
|
export interface UpdateAutoRenewalStatusRequest {
|
|
43
|
+
isAutoRenewal: boolean;
|
|
27
44
|
}
|
|
28
45
|
|
|
29
46
|
export interface UpdateAutoRenewalStatusResponse {
|
|
47
|
+
isAutoRenewal: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface Plan {
|
|
51
|
+
id: string;
|
|
52
|
+
title: string;
|
|
53
|
+
description: string;
|
|
54
|
+
monthlyPrice: number;
|
|
55
|
+
annualyPrice: number;
|
|
30
56
|
}
|
|
31
57
|
|
|
32
58
|
export interface GetPlansResponse {
|
|
59
|
+
plans: Plan[];
|
|
33
60
|
}
|
|
34
61
|
|
|
35
62
|
export interface GetPlanByIdRequest {
|
|
63
|
+
planId: string;
|
|
36
64
|
}
|
|
37
65
|
|
|
38
66
|
export interface GetPlanByIdResponse {
|
|
67
|
+
plan: Plan | undefined;
|
|
39
68
|
}
|
|
40
69
|
|
|
41
70
|
export interface RefundRequest {
|
|
@@ -47,7 +76,7 @@ export interface RefundResponse {
|
|
|
47
76
|
export const PAYMENT_V3_PACKAGE_NAME = "payment.v3";
|
|
48
77
|
|
|
49
78
|
export interface PaymentServiceClient {
|
|
50
|
-
getHistory(request:
|
|
79
|
+
getHistory(request: Empty): Observable<GetHistoryResponse>;
|
|
51
80
|
|
|
52
81
|
initTransaction(request: InitTransactionRequest): Observable<InitTransactionResponse>;
|
|
53
82
|
|
|
@@ -61,9 +90,7 @@ export interface PaymentServiceClient {
|
|
|
61
90
|
}
|
|
62
91
|
|
|
63
92
|
export interface PaymentServiceController {
|
|
64
|
-
getHistory(
|
|
65
|
-
request: GetHistoryRequest,
|
|
66
|
-
): Promise<GetHistoryResponse> | Observable<GetHistoryResponse> | GetHistoryResponse;
|
|
93
|
+
getHistory(request: Empty): Promise<GetHistoryResponse> | Observable<GetHistoryResponse> | GetHistoryResponse;
|
|
67
94
|
|
|
68
95
|
initTransaction(
|
|
69
96
|
request: InitTransactionRequest,
|
package/package.json
CHANGED
package/proto/payment.proto
CHANGED
|
@@ -5,7 +5,7 @@ package payment.v3;
|
|
|
5
5
|
import "google/protobuf/empty.proto";
|
|
6
6
|
|
|
7
7
|
service PaymentService {
|
|
8
|
-
rpc GetHistory(
|
|
8
|
+
rpc GetHistory(google.protobuf.Empty) returns (GetHistoryResponse);
|
|
9
9
|
rpc InitTransaction(InitTransactionRequest) returns (InitTransactionResponse);
|
|
10
10
|
rpc UpdateAutoRenewalStatus(UpdateAutoRenewalStatusRequest) returns (UpdateAutoRenewalStatusResponse);
|
|
11
11
|
rpc GetPlans(google.protobuf.Empty) returns (GetPlansResponse);
|
|
@@ -13,33 +13,63 @@ service PaymentService {
|
|
|
13
13
|
rpc Refund(RefundRequest) returns (RefundResponse);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
message Transaction {
|
|
19
|
+
string id = 1;
|
|
20
|
+
string status =2 ;
|
|
21
|
+
string paymentProvider = 3;
|
|
22
|
+
string createdAt = 4;
|
|
23
|
+
string updatedAt = 5;
|
|
24
|
+
string billingPeriod = 6;
|
|
25
|
+
int32 amount = 7;
|
|
26
|
+
string userId = 8;
|
|
27
|
+
string planId = 9;
|
|
28
|
+
}
|
|
17
29
|
|
|
18
30
|
message GetHistoryResponse {
|
|
19
|
-
|
|
31
|
+
repeated Transaction transactions = 1;
|
|
20
32
|
}
|
|
21
33
|
|
|
22
34
|
message InitTransactionRequest {
|
|
23
|
-
|
|
35
|
+
string planId = 1;
|
|
36
|
+
string billingPeriod = 2;
|
|
37
|
+
string provider = 3;
|
|
24
38
|
}
|
|
25
39
|
|
|
26
40
|
message InitTransactionResponse {
|
|
27
|
-
|
|
41
|
+
string cancel_url = 1;
|
|
42
|
+
string success_url = 2;
|
|
43
|
+
string url = 3;
|
|
28
44
|
}
|
|
29
45
|
|
|
30
46
|
message UpdateAutoRenewalStatusRequest {
|
|
31
|
-
|
|
47
|
+
bool isAutoRenewal = 1;
|
|
32
48
|
}
|
|
33
49
|
|
|
34
50
|
message UpdateAutoRenewalStatusResponse {
|
|
35
|
-
|
|
51
|
+
bool isAutoRenewal = 1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
message Plan {
|
|
55
|
+
string id = 1;
|
|
56
|
+
string title = 2;
|
|
57
|
+
string description = 3;
|
|
58
|
+
int32 monthlyPrice = 4;
|
|
59
|
+
int32 annualyPrice = 5;
|
|
36
60
|
}
|
|
37
61
|
|
|
38
62
|
|
|
39
|
-
message GetPlansResponse {
|
|
63
|
+
message GetPlansResponse {
|
|
64
|
+
repeated Plan plans =1;
|
|
65
|
+
}
|
|
40
66
|
|
|
41
|
-
message GetPlanByIdRequest {
|
|
42
|
-
|
|
67
|
+
message GetPlanByIdRequest {
|
|
68
|
+
string planId = 1;
|
|
69
|
+
}
|
|
70
|
+
message GetPlanByIdResponse{
|
|
71
|
+
Plan plan = 1;
|
|
72
|
+
}
|
|
43
73
|
|
|
44
74
|
message RefundRequest {}
|
|
45
75
|
|