You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

257 lines
6.2 KiB

6 months ago
syntax = "proto3";
package api;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
option go_package = "bkb-payment/api";
// The greeting service definition.
service Greeter {
// Sends a greeting
rpc Ping (google.protobuf.Empty) returns (PingReply) {
option (google.api.http) = {
get: "/ping"
};
}
rpc CountryList (google.protobuf.Empty) returns (CountryReply) {
option (google.api.http) = {
get: "/country/list"
};
}
rpc DistrictCascade (DistrictRequest) returns (DistrictReply) {
option (google.api.http) = {
get: "/district/cascade"
};
}
rpc PayConsult (PayConsultRequest) returns (PayConsultReply) {}
rpc PayTransactionWebUrl (PayTransRequest) returns (WebPayResponse) {}
rpc PaypalPayback (PaypalWebhook) returns (PaypalPaybackResp) {
option (google.api.http) = {
post: "/paypal/callback"
body: "*"
};
}
rpc AlipayGPayback (AlipayGWebhook) returns (AlipayGPaybackResp) {
option (google.api.http) = {
post: "/alipay-g/callback"
body: "*"
};
}
rpc AlipayGCapture (AlipayGWebhook) returns (AlipayGPaybackResp) {
option (google.api.http) = {
post: "/alipay-g/capture"
body: "*"
};
}
rpc PayoutsWebUrl (PayoutRequest) returns (WebPayResponse) {
option (google.api.http) = {
post: "/pay/payouts"
body: "*"
};
}
rpc GetPayTransaction (google.protobuf.Empty) returns (GetPayTransactionResp) {
option (google.api.http) = {
get: "/pay/transaction/outTradeNo"
};
}
rpc CancelBill (CancelBillRequest) returns (PingReply) {}
rpc RefundBill (RefundRequest) returns (RefundResponse) {}
}
// The response message containing the greetings
message PingReply {
string message = 1;
}
message Country {
int32 id = 1;
string name = 2;
}
message CountryReply {
repeated Country list = 1;
}
message DistrictRequest {
int32 country = 1;
}
message District {
string label = 1;
string adcode = 2;
int32 parent_id = 3;
repeated District children = 4;
}
message DistrictReply {
repeated District list = 1;
}
message PayConsultRequest {
string appid = 1;
double amount = 2;
string currency = 3;
string pay_channel = 4;
string user_region = 5;
string os_type = 6;
string terminal_type = 7;
}
message PaymentMethod {
string logo_name = 1;
string logo_url = 2;
string type_value = 3;
string category = 4;
bool enabled = 5;
}
message PayConsultReply {
repeated PaymentMethod list = 1;
}
message PayTransRequest {
string appid = 1;
string mchid = 2;
string out_trade_no = 3;
string attach = 4;
string notify_url = 5;
double amount = 6;
string currency = 7;
string pay_channel = 8;
string return_url = 9;
string cancel_url = 10;
string description = 11;
string os_type = 12;
string terminal_type = 13;
string payment_method = 14;
}
message WebPayResponse {
string pay_channel = 1;
string pay_id = 2;
string pay_return = 3;
string pay_status = 4;
}
message PaybackRequest {
string mchid = 1;
string pay_channel = 2;
string pay_id = 3;
string event_type = 4;
}
message PaypalPaybackResp {
string out_trade_no = 1;
string trade_state = 2;
string message = 3;
}
message PayoutRequest {
string appid = 1;
string mchid = 2;
string out_trade_no = 3;
string attach = 4;
string notify_url = 5;
double amount = 6;
string currency = 7;
string pay_channel = 8;
string paypal_name = 9;
}
message GetPayTransOutTradeNoRequest {
string appid = 1;
string mchid = 2;
string out_trade_no = 3;
}
message GetPayTransactionResp {
GetPayTransaction data = 1;
}
message GetPayTransaction {
string appid = 1;
string mchid = 2;
}
message CancelBillRequest {
string appid = 1;
string mchid = 2;
string transaction_id = 3;
}
message RefundRequest {
string appid = 1;
string mchid = 2;
string out_trade_no = 3;
string pay_id = 4;
string attach = 5;
string notify_url = 6;
double amount = 7;
string description = 8;
}
message RefundResponse {
string refund_status = 1;
string refund_id = 2;
}
message PaypalWebhook {
string id = 1;
string create_time = 2;
string resource_type = 3;
string event_type = 4;
string summary = 5;
PaybackResource resource = 6;
}
message PaybackResource {
string id = 1;
string create_time = 2;
string update_time = 3;
string state = 4;
string status = 5;
repeated PurchaseUnit purchase_units = 6;
BatchHeader batch_header = 7;
}
message PurchaseUnit {
Payment payments = 1;
}
message Payment {
repeated Capture captures = 1;
}
message BatchHeader {
string batch_status = 1;
string payout_batch_id = 2;
SenderBatchHeader sender_batch_header = 3;
}
message SenderBatchHeader {
string sender_batch_id = 1;
}
message Capture {
string id = 1;
string status = 2;
string create_time = 3;
string update_time = 4;
}
message AlipayGResult {
string result_code = 1;
string result_status = 2;
string result_message = 3;
}
message AlipayGAmount {
string value = 1;
string currency = 2;
}
message AlipayQuote {
bool guaranteed = 1;
string quote_currency_pair = 2;
string quote_expiry_time = 3;
string quote_id = 4;
double quote_price = 5;
string quote_start_time = 6;
}
message AlipayGWebhook {
string notify_type = 1;
AlipayGResult result = 2;
string payment_request_id = 3;
string payment_id = 4;
AlipayGAmount payment_amount = 5;
string payment_create_time = 6;
string payment_time = 7;
string capture_request_id = 8;
string capture_id = 9;
AlipayGAmount capture_amount = 10;
string capture_time = 11;
string refund_status = 12;
string refund_request_id = 13;
string refund_id = 14;
AlipayGAmount refund_amount = 15;
string refund_time = 16;
AlipayGAmount gross_settlement_amount = 17;
AlipayQuote settlement_quote = 18;
}
message AlipayGPaybackResp {
AlipayGResult result = 1;
}