306 lines
6.9 KiB
Protocol Buffer
306 lines
6.9 KiB
Protocol Buffer
syntax = "proto3";
|
|
package tradde.resellerv1;
|
|
option go_package = "./trade/resellerv1;resellerv1";
|
|
|
|
service Recharge {
|
|
// 创建直充订单
|
|
rpc CreateOrder(CreateOrderReq) returns (CreateOrderResp);
|
|
|
|
// 查询订单
|
|
rpc QueryOrder(QueryOrderReq) returns (QueryOrderResp);
|
|
|
|
// 上游回调处理
|
|
rpc Notify(NotifyReq) returns (NotifyResp);
|
|
|
|
// 爱奇艺身份验证
|
|
rpc IQiYiVerifyNewUser(IQiYiVerifyReq) returns (IQiYiVerifyResp);
|
|
|
|
// 爱奇艺高低线校验
|
|
rpc IQiYiVerifyHighLowLine(IQiYiVerifyReq) returns (IQiYiVerifyResp);
|
|
|
|
// 爱奇艺小米产品校验
|
|
rpc IQiYiXiaoMiVerify(IQiYiVerifyXiaoMiReq) returns (IQiYiVerifyResp);
|
|
|
|
// 查询订单v2
|
|
rpc QueryOrderV2(QueryOrderV2Req) returns (QueryOrderV2Resp);
|
|
|
|
// 通知订单失败
|
|
rpc NotifyOrderFail(NotifyOrderFailReq) returns (NotifyOrderFailResp);
|
|
|
|
// 获取外部订单流水号
|
|
rpc GetSerialNo(GetSerialNoReq) returns (GetSerialNoResp);
|
|
|
|
// 获取外部订单流水号
|
|
rpc GetSerialNoByOutTradeNo(GetSerialNoReq) returns (GetSerialNoByOutTradeNoResp);
|
|
|
|
// 上游卡券回调处理
|
|
rpc CouponNotify(CouponNotifyReq) returns (CouponNotifyResp);
|
|
|
|
//根据订单号获取卡券信息
|
|
rpc GetCouponInfo(GetCouponInfoReq) returns (GetCouponInfoResp);
|
|
|
|
//更新卡券订单状态
|
|
rpc UpdateCouponStatus(UpdateCouponStatusReq) returns (UpdateCouponStatusResp);
|
|
}
|
|
|
|
// 更新卡券订单状态请求
|
|
message UpdateCouponStatusReq {
|
|
// 流水号
|
|
string trade_number = 1;
|
|
string coupon_code = 2;
|
|
int32 status = 3;
|
|
}
|
|
|
|
// 更新卡券订单状态响应
|
|
message UpdateCouponStatusResp {
|
|
bool is_ok = 1;
|
|
}
|
|
|
|
message GetCouponInfoReq {
|
|
string order_number = 1;
|
|
string coupon_code = 2;
|
|
}
|
|
|
|
message GetCouponInfoResp {
|
|
CouponOrderInfo coupon = 1;
|
|
}
|
|
|
|
// 订单信息
|
|
message CouponOrderInfo {
|
|
// 订单编号order_number
|
|
string order_number = 1;
|
|
// 流水号
|
|
string serial_number = 2;
|
|
// 卡券编码
|
|
string coupon_code = 3;
|
|
// 订单状态【0 未核销 1 已核销 2 冲正 3 已过期 4 无效】
|
|
int32 status = 4;
|
|
// 分销商id
|
|
int32 reseller_id = 5;
|
|
// 分销商名称
|
|
string reseller_name = 6;
|
|
// 上游价格
|
|
double platform_price = 7;
|
|
// 下游价格
|
|
double reseller_price = 8;
|
|
// 核销账号
|
|
string use_account = 9;
|
|
// 核销时间
|
|
int32 use_time = 10;
|
|
// 核销门店
|
|
string use_store_no = 11;
|
|
// 商品名称
|
|
string ours_product_title = 12;
|
|
// 商品ID
|
|
int32 ours_product_id = 13;
|
|
// 订单创建时间
|
|
int32 create_time = 14;
|
|
// 开始时间
|
|
int32 start_time = 15;
|
|
// 结束时间
|
|
int32 end_time = 16;
|
|
// 平台ID
|
|
int32 platform_id = 17;
|
|
// 平台名称
|
|
string platform_name = 18;
|
|
// 分销商订单号
|
|
string reseller_order_number = 19;
|
|
}
|
|
|
|
message CouponNotifyReq {
|
|
string platform_tag = 1;
|
|
repeated CouponResult result = 2;
|
|
}
|
|
|
|
message CouponResult {
|
|
string coupon_code = 1; //优惠券码
|
|
string out_trade_number = 2; //外部平台交易号
|
|
string trade_number = 3;
|
|
CouponStatus coupon_status = 4;
|
|
string use_store_no = 5;//上游实际产生的交易价
|
|
string use_account = 6;//上游实际产生的交易账号
|
|
int32 change_time = 7;//上游实际产生的交易时间
|
|
int32 start_time = 8;//优惠券有效期开始时间'
|
|
int32 end_time = 9;//优惠券有效期结束时间
|
|
bytes data = 10; //原始信息 json
|
|
string message = 11;
|
|
}
|
|
|
|
enum CouponStatus{
|
|
COUPON_UNKNOWN = 0; // 未知状态
|
|
COUPON_REDEMPTION = 1; // 核销
|
|
COUPON_REVERSAL = 2; // 冲正
|
|
COUPON_EXPIRED = 3; // 过期
|
|
COUPON_INVALID = 4; // 无效
|
|
}
|
|
|
|
message CouponNotifyResp {
|
|
bool is_ok = 1;
|
|
}
|
|
|
|
message NotifyOrderFailReq {
|
|
int32 merchant_id = 1;
|
|
string out_trade_no = 2;
|
|
string recharge_account = 3;
|
|
string notify_url = 4;
|
|
int32 number = 5;
|
|
string extend_parameter = 6;
|
|
int32 mode = 7;
|
|
double trade_price = 8;
|
|
}
|
|
|
|
message NotifyOrderFailResp {
|
|
|
|
}
|
|
message QueryOrderV2Req {
|
|
int32 merchant_id = 1;
|
|
string out_trade_no = 2;
|
|
}
|
|
|
|
message QueryOrderV2Resp {
|
|
string trade_status = 1;
|
|
string order_no = 2;
|
|
string trade_state_desc = 3;
|
|
int32 mch_id = 4;
|
|
string out_trade_no = 5;
|
|
double unit_price = 6;
|
|
string attach = 7;
|
|
string extra = 8;
|
|
string recharge_account = 9;
|
|
}
|
|
|
|
// 爱奇艺身份验证请求
|
|
message IQiYiVerifyReq {
|
|
string item = 1;
|
|
string mobile = 2;
|
|
}
|
|
|
|
message IQiYiVerifyXiaoMiReq {
|
|
string item = 1;
|
|
string mobile = 2;
|
|
string tag = 3;
|
|
}
|
|
|
|
// 爱奇艺身份验证响应
|
|
message IQiYiVerifyResp {
|
|
string code = 1;
|
|
string message = 2;
|
|
int32 maxAmount = 3;
|
|
}
|
|
|
|
enum ResultStatus{
|
|
INVALID = 0; //无效的状态
|
|
FAIL = 1; //错误,失败
|
|
SUCCESS = 2;
|
|
Ing = 3;
|
|
}
|
|
|
|
// 上游回调处理请求
|
|
message NotifyReq {
|
|
string platform_tag = 1;
|
|
NotifyResult result = 2;
|
|
}
|
|
|
|
message NotifyResult {
|
|
string out_trade_number = 2; //外部平台交易号
|
|
string trade_number = 3;
|
|
ResultStatus status = 4;
|
|
float trade_price = 5;//上游实际产生的交易价
|
|
bytes data = 6; //原始信息 json
|
|
string message = 7;
|
|
}
|
|
|
|
// 上游回调处理响应
|
|
message NotifyResp {
|
|
bool is_ok = 1;
|
|
}
|
|
|
|
message CreateOrderReq{
|
|
int32 merchant_id = 1;
|
|
string out_trade_no = 2;
|
|
int32 product_id = 3;
|
|
string recharge_account = 4;
|
|
string notify_url = 5;
|
|
int32 account_type = 6;
|
|
string sign = 7;
|
|
int32 number = 8;
|
|
string extend_parameter = 9;
|
|
int64 create_ip = 10;
|
|
int32 mode = 11;
|
|
double product_price = 12;
|
|
double trade_price = 13;
|
|
double official_price = 14;
|
|
string product_name = 15;
|
|
int32 aftermarket = 16;
|
|
string attach = 17;
|
|
int32 appid = 18;
|
|
}
|
|
|
|
message CreateOrderResp {
|
|
string code = 1;
|
|
string message = 2;
|
|
string order_number = 3;
|
|
}
|
|
|
|
message QueryOrderReq {
|
|
int32 merchant_id = 1;
|
|
string out_trade_no = 2;
|
|
// 二进制,从右往左使用,判断以下字段是否需要返回
|
|
// 1. extend_parameter
|
|
// 2. order_item
|
|
int32 optional = 3;
|
|
}
|
|
|
|
message QueryOrderResp {
|
|
string code = 1;
|
|
string message = 2;
|
|
optional string status = 3;
|
|
optional string out_trade_no = 4;
|
|
optional string channel_price = 5;
|
|
optional string attach = 6;
|
|
string order_number = 7;
|
|
optional string extend_parameter = 8;
|
|
optional OrderItemInfo order_item_info = 9;
|
|
optional int32 notify_time = 10;
|
|
}
|
|
|
|
message OrderItemInfo {
|
|
// 订单编号
|
|
string id = 1;
|
|
// 商品编号
|
|
int32 ours_product_id = 2;
|
|
string ours_product_title = 3;
|
|
// 商品价格
|
|
double ours_product_price = 4;
|
|
// 成交价格
|
|
double trade_price = 5;
|
|
// 成交数量
|
|
int32 trade_quantity = 6;
|
|
// 给分销商授权产品的授权id
|
|
optional int32 authorize_id = 7;
|
|
// 官方面值
|
|
double official_price = 8;
|
|
}
|
|
|
|
message GetSerialNoReq {
|
|
int32 merchant_id = 1;
|
|
string out_trade_no = 2;
|
|
}
|
|
|
|
message GetSerialNoResp {
|
|
string code = 1;
|
|
string message = 2;
|
|
repeated string serial_list = 3;
|
|
}
|
|
|
|
message GetSerialNoByOutTradeNoResp {
|
|
string code = 1;
|
|
string message = 2;
|
|
message Data {
|
|
string serial_no = 1;
|
|
string recharge_account = 2;
|
|
string finish_time = 3;
|
|
}
|
|
repeated Data data = 3;
|
|
}
|