syntax = "proto3";
package wallet;
option go_package = "bsm/full/module/finance/wallet/pb;wallet";
service Wechat {
    //微信JSAPI下单
    rpc JsapiPreOrder(WxpayJSAPIPreOrderRequest) returns (WxpayJSAPIPreOrderReply) {}
    //微信APP支付下单
    rpc AppPreOrder(WxpayAppPreOrderRequest) returns (WxpayAppPreOrderReply) {}
    //微信native二维码支付下单
    rpc NativePreOrder(WxpayNativePreOrderRequest) returns (WxpayNativePreOrderReply) {}
    //微信转账到零钱
    rpc Transfer(WxpayTransferRequest) returns (WxpayTransferReply) {}
    //微信支付回调
    rpc WxCallback(WxCallBackRequest)  returns(CallBackReply){}
}

message WxpayJSAPIPreOrderRequest {
    string user_identification = 1; //用户唯一标识
    int64 amount = 2; //充值金额，单位：分
    string auth_code = 3; //微信授权码
    string description = 4; //商品描述
    string notify_url = 5; //支付回调URL，公网域名须为HTTPS
    string orderNo = 6; // 订单唯一码
}

message WxpayJSAPIPreOrderReply {
    string prepay_id = 1; //预支付ID，两小时有效
    string app_id = 2; //微信app_id
    string timestamp = 3; //时间戳
    string nonce_str = 4; //随机字符串
    string sign_type = 5; //签名方式
    string sign = 6; //签名串
}
message WxpayAppPreOrderRequest {
    string user_identification = 1; //用户唯一标识
    int64 amount = 2; //充值金额，单位：分
    string description = 3; //商品描述
    string notify_url = 4; //支付回调URL，公网域名须为HTTPS
}
message WxpayAppPreOrderReply {
    string prepay_id = 1; //预支付ID，两小时有效
    string app_id = 2; //微信app_id
    string mch_id = 3; //商户号，用以调起支付
}
message WxpayNativePreOrderRequest {
    string user_identification = 1; //用户唯一标识
    int64 amount = 2; //充值金额，单位：分
    string description = 3; //商品描述
    string notify_url = 4; //支付回调URL，公网域名须为HTTPS
}
message WxpayNativePreOrderReply {
    string code_url = 1; //二维码URL
}
message WxpayTransferRequest {
    string user_identification = 1; //用户唯一标识
    int64 amount = 2; //提现金额，单位：分
    int64 fee = 3; //提现手续费，单位：分
    string description = 4; //商品描述
    string transfer_name = 5; //提现人真实姓名
}
message WxpayTransferReply {}

message WxCallBackResource{
    string original_type = 1;
    string algorithm = 2;
    string ciphertext = 3;
    string associated_data = 4;
    string nonce = 5;
}
message WxCallBackSignInfo{
    string transaction_id = 1;
    string act_code = 2;
    string hall_code = 3;
    int64 hall_belong_mch_id = 4;
    string card_id = 5;
    string code = 6;
    string activity_id = 7;
}
message  WxCallBackRequest{
    string id = 1;
    string create_time = 2;
    string resource_type = 3;
    string event_type = 4;
    string summary = 5;
    WxCallBackResource resource = 6;
    WxCallBackSignInfo SignInfo = 7;
}
message CallBackReply{
    string code = 1; // 错误码，SUCCESS为清算机构接收成功，FAIL错误码为失败。
    string message = 2; // 返回信息
}