Files
2026-10-07 09:28:12 +08:00

79 lines
1.4 KiB
Protocol Buffer

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 Notify(NotifyReq) returns (Response) {
option (google.api.http) = {
post: "/api/v3/payment/notify"
body: "*"
};
}
rpc Refund(RefundReq) returns (Response) {
option (google.api.http) = {
post: "/admin/v3/payment/refund"
body: "*"
};
}
}
message Response {
int32 code = 1;
string msg = 2;
string data = 3;
}
message PayReq {
string order_sn = 1;
string client = 2;
string channel = 3;
string openid = 4;
}
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;
}