feat: payment pay

This commit is contained in:
zzw
2026-09-11 16:08:17 +08:00
parent f8c7419964
commit d9529a219d
33 changed files with 3108 additions and 89 deletions
+77
View File
@@ -0,0 +1,77 @@
syntax = "proto3";
package payment;
option go_package = "lone-services/rpc/payment";
import "google/api/annotations.proto";
service Payment {
rpc Pay(PayReq) returns (Response) {
option (google.api.http) = {
post: "/api/v3/payment/pay"
body: "*"
};
}
rpc Query(QueryReq) returns (Response) {
option (google.api.http) = {
post: "/api/v3/payment/query"
body: "*"
};
}
rpc Close(CloseReq) returns (Response) {
option (google.api.http) = {
post: "/api/v3/payment/close"
body: "*"
};
}
rpc Refund(RefundReq) returns (Response) {
option (google.api.http) = {
post: "/api/v3/payment/refund"
body: "*"
};
}
rpc Notify(NotifyReq) returns (Response) {
option (google.api.http) = {
post: "/api/v3/payment/notify/{channel}"
body: "*"
};
}
}
message Response {
int32 code = 1;
string msg = 2;
string data = 3;
}
message PayReq {
string order_sn = 1;
string client = 2;
string channel = 3;
}
message QueryReq {
string order_sn = 1;
string channel = 2;
}
message CloseReq {
string order_sn = 1;
string channel = 2;
}
message RefundReq {
string order_sn = 1;
string channel = 2;
string amount = 3; // 元,字符串避免浮点误差
string reason = 4;
}
message NotifyReq {
string channel = 1;
map<string, string> headers = 2;
bytes body = 3;
}