feat: payment pay
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user