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.
66 lines
4.5 KiB
66 lines
4.5 KiB
syntax = "proto3";
|
|
option go_package = ".;pb";
|
|
|
|
|
|
//支付订单状态
|
|
enum PayOrderStatus {
|
|
PAY_ORDER_PENDING = 0; //待支付
|
|
PAY_ORDER_PAID = 1; //已支付
|
|
PAY_ORDER_CANCELLED = 2; //已取消
|
|
PAY_ORDER_EXPIRED = 3; //已过期
|
|
PAY_ORDER_REFUNDED = 4; //已退款
|
|
PAY_ORDER_FAILED = 5; //支付失败
|
|
}
|
|
|
|
//支付方式
|
|
enum PaymentMethod {
|
|
UnknownPaymentMethod = 0;
|
|
WxJSAPI = 1; // 微信内网页支付
|
|
WxNative = 2; // 微信扫码支付
|
|
Alipay = 3; // 支付宝
|
|
WxAPP = 4; // 微信APP支付
|
|
PayPal = 5; // PayPal 支付
|
|
AppleIAP = 6; // 苹果内购
|
|
GoogleIAP = 7; // 谷歌内购
|
|
}
|
|
|
|
//支付订单数据
|
|
message DBPayOrder {
|
|
string order_id = 1; //@go_tags(`gorm:"order_id:50;primaryKey" json:"order_id"`) 订单ID
|
|
string uid = 2; //@go_tags(`gorm:"uid:50;index" json:"uid"`) 用户ID
|
|
string product_id = 3; //@go_tags(`gorm:"product_id:50;index" json:"product_id"`) 商品ID
|
|
string product_name = 4; //@go_tags(`gorm:"product_name:100" json:"product_name"`) 商品名称
|
|
string product_desc = 5; //@go_tags(`gorm:"product_desc:500" json:"product_desc"`) 商品描述
|
|
int64 amount = 6; //@go_tags(`gorm:"amount" json:"amount"`) 订单金额(分)
|
|
PaymentMethod payment_method = 7; //@go_tags(`gorm:"payment_method" json:"payment_method"`) 支付方式
|
|
PayOrderStatus status = 8; //@go_tags(`gorm:"status;index" json:"status"`) 订单状态
|
|
string transaction_id = 9; //@go_tags(`gorm:"transaction_id:100;index" json:"transaction_id"`) 第三方交易号
|
|
string prepay_id = 10; //@go_tags(`gorm:"prepay_id:100" json:"prepay_id"`) 预支付ID
|
|
string code_url = 11; //@go_tags(`gorm:"code_url:500" json:"code_url"`) 支付二维码URL
|
|
int64 create_time = 12; //@go_tags(`gorm:"create_time;index" json:"create_time"`) 创建时间
|
|
int64 pay_time = 13; //@go_tags(`gorm:"pay_time" json:"pay_time"`) 支付时间
|
|
int64 expire_time = 14; //@go_tags(`gorm:"expire_time" json:"expire_time"`) 过期时间
|
|
string client_ip = 15; //@go_tags(`gorm:"client_ip:50" json:"client_ip"`) 客户端IP
|
|
string notify_url = 16; //@go_tags(`gorm:"notify_url:200" json:"notify_url"`) 回调地址
|
|
string extra_data = 17; //@go_tags(`gorm:"extra_data:1000" json:"extra_data"`) 扩展数据
|
|
string remark = 18; //@go_tags(`gorm:"remark:500" json:"remark"`) 备注
|
|
// ---- 来源设备快照(下单时冻结,用于渠道分成月结算)----
|
|
// 取值优先级:客户端上报的「当前使用设备」→ 用户「最后绑定设备」→ 空。
|
|
// 下单即固化,用户之后换设备/换绑不影响历史订单的归属。
|
|
string src_license = 20; //@go_tags(`gorm:"src_license;size:32;index" json:"src_license"`) 来源设备的授权码
|
|
string src_mac = 21; //@go_tags(`gorm:"src_mac;size:50" json:"src_mac"`) 来源设备MAC
|
|
uint32 src_productid = 22; //@go_tags(`gorm:"src_productid;index" json:"src_productid"`) 来源设备的产品id
|
|
uint32 src_brandid = 23; //@go_tags(`gorm:"src_brandid;index" json:"src_brandid"`) 来源设备的品牌商id
|
|
string src_channelid = 24; //@go_tags(`gorm:"src_channelid;size:16;index" json:"src_channelid"`) 来源设备的渠道商id(短码)
|
|
}
|
|
|
|
//微信APP支付参数
|
|
message AppPayParams{
|
|
string appid = 1; //@go_tags(`json:"appid"`) 应用ID
|
|
string partnerid = 2; //@go_tags(`json:"partnerid"`) 商户号
|
|
string prepayid = 3; //@go_tags(`json:"prepayid"`) 预支付ID
|
|
string package = 4; //@go_tags(`json:"package
|
|
string noncestr = 5; //@go_tags(`json:"noncestr"`) 随机字符串
|
|
string timestamp = 6; //@go_tags(`json:"timestamp"`) 时间戳(秒)
|
|
string sign = 7; //@go_tags(`json:"sign"`) 支付签名
|
|
}
|