//1.wy_wx_pay生成payModel private Dictionary <string, object> ToWeChatPayModel(wy_wx_pay wxpay) { //<sign> 0CB01533B8C1EF103065174F50BCA001 </sign> Dictionary <string, object> Paramters = new Dictionary <string, object>(); Paramters.Add("appid", CommonFiled.appID); Paramters.Add("body", wxpay.REMARK); Paramters.Add("mch_id", CommonFiled.MchId(wxpay.FEE_TYPES)); Paramters.Add("nonce_str", wxpay.ID); Paramters.Add("notify_url", CommonFiled.payCallBack); Paramters.Add("openid", wxpay.OPEN_ID); Paramters.Add("out_trade_no", wxpay.ORDER_ID); Paramters.Add("spbill_create_ip", wxpay.USER_IP); Paramters.Add("total_fee", wxpay.TOTAL_FEE); Paramters.Add("trade_type", "JSAPI"); var MchSec = CommonFiled.MchSecret(wxpay.FEE_TYPES); Paramters.Add("sign", this._Sign.WePaySign(Paramters, MchSec)); return(Paramters); }
public wy_wx_pay GetWxPay(OrderDto oder) { v_pay_record record = oder.Record; var pay = new wy_wx_pay(); pay.ID = CommonFiled.guid; pay.APP_ID = CommonFiled.appID; pay.ORDER_ID = CommonFiled.ABC + CommonFiled.orderId; pay.RECORD_ID = record.RECORD_ID; pay.HOUSE_ID = oder.Houseinfo.FWID; pay.USER_ID = oder.Shopinfo.CZ_SHID; //用户ID pay.OPEN_ID = record.OPEN_ID; pay.FEE_TYPES = Convert.ToInt32(record.JFLX); pay.TOTAL_FEE = record.JFJE.HasValue ? Convert.ToInt32(record.JFJE.Value * 100) : 0; pay.REMARK = $"自助缴费_{Fee.Types.SingleOrDefault(c => c.Value == Convert.ToInt32(record.JFLX)).Key}"; pay.STATUS = 0; pay.CREATE_TIME = DateTime.Now; pay.MECH_ID = CommonFiled.MchId(record.JFLX); pay.NONCE_STR = CommonFiled.guid; pay.PREPAY_TIME = DateTime.Now; pay.PREPAY_ENDTIME = DateTime.Now.AddHours(2); pay.TRADE_TYPE = CommonFiled.JSAPI; pay.HOUSE_NAME = oder.Houseinfo.FWMC; pay.HOUSE_ADDRESS = oder.Houseinfo.ZLWZ; pay.HOUSE_AREA = oder.Houseinfo.JZMJ; pay.HOUSE_SERVICEEFFCTIVE = pay.FEE_TYPES != 0 ? "" : $"{toDate(oder.Record.YXQS,"yyyy/MM/dd")}-{toDate(oder.Record.YXQZ,"yyyy/MM/dd")}"; //物业费单价 pay.HOUSE_SERVICE_UNITPRICE = Convert.ToDecimal(oder.Costs.WYDJ); pay.USER_NAME = oder.Shopinfo.ZHXM; pay.SHOP_NAME = oder.Shopinfo.SHOP_NAME; pay.TOTAL_FEE_CH = CommonFiled.CmycurD(Convert.ToDecimal((pay.TOTAL_FEE / 100.00))); pay.MECH_NAME = CommonFiled.MchName(pay.FEE_TYPES); pay.TYPES_ID = pay.FEE_TYPES == 0 ? "" : (pay.FEE_TYPES == 1 ? oder.Houseinfo.WATER_NUMBER : oder.Houseinfo.ELE_NUMBER); pay.TYPES_ID_ELE_COLL = oder.Houseinfo.CID; return(pay); }