/// <summary> /// 服务人员注册接口 /// <para>用于商户开发者为商户注册服务人员使用。</para> /// <para>注意:调用接口前商家需完成支付即服务产品的开通和设置。若服务商为特约商户调用接口,需在特约商户开通并完成产品设置后,与特约商户建立产品授权关系。</para> /// <para>更多详细请参考 https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter8_4_1.shtml </para> /// </summary> /// <param name="data">微信支付需要POST的Data数据</param> /// <param name="timeOut">超时时间,单位为ms</param> /// <returns></returns> public async Task <RegisterGuideReturnJson> RegisterGuideAsync(RegisterGuideRequestData data, int timeOut = Config.TIME_OUT) { var url = ReurnPayApiUrl(Senparc.Weixin.Config.TenPayV3Host + "/{0}v3/smartguide/guides"); TenPayApiRequest tenPayApiRequest = new(_tenpayV3Setting); return(await tenPayApiRequest.RequestAsync <RegisterGuideReturnJson>(url, data, timeOut)); }
/// <summary> /// 服务人员注册接口 /// <para>用于商户开发者为商户注册服务人员使用。</para> /// <para>注意:调用接口前商家需完成支付即服务产品的开通和设置。若服务商为特约商户调用接口,需在特约商户开通并完成产品设置后,与特约商户建立产品授权关系。</para> /// <para>更多详细请参考 https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter8_4_1.shtml </para> /// </summary> /// <param name="data">微信支付需要POST的Data数据</param> /// <param name="timeOut">超时时间,单位为ms</param> /// <returns></returns> public async Task <RegisterGuideReturnJson> RegisterGuideAsync(RegisterGuideRequestData data, int timeOut = Config.TIME_OUT) { var url = ReurnPayApiUrl("https://api.mch.weixin.qq.com/{0}v3/smartguide/guides"); TenPayApiRequest tenPayApiRequest = new(_tenpayV3Setting); return(await tenPayApiRequest.RequestAsync <RegisterGuideReturnJson>(url, data, timeOut)); }
//TODO: 测试前参考 https://pay.weixin.qq.com/index.php/public/product/detail?pid=109 /// <summary> /// 服务人员注册测试 /// https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter8_4_1.shtml /// </summary> public void RegisterGuideAsyncTest() { //TODO: 完善信息 //企业ID var corpid = "{corpid}"; //门店ID var store_id = 123; //企业微信的员工ID var userid = "{userid}"; //企业微信的员工姓名 var name = "{name}"; //手机号码 var mobile = "{mobile}"; //员工个人二维码 var qr_code = "{qr_code}"; //头像URL var avatar = "{avatar}"; //群二维码URL var group_qrcode = "{ group_qrcode}"; var requestData = new RegisterGuideRequestData(corpid, store_id, userid, name, mobile, qr_code, avatar, group_qrcode); PayScoreApis payScoreApis = new PayScoreApis(); var createServiceOrderResult = payScoreApis.RegisterGuideAsync(requestData).GetAwaiter().GetResult(); Console.WriteLine("微信支付 V3 创建支付分订单测试:" + createServiceOrderResult.ToJson(true)); Assert.IsNotNull(createServiceOrderResult); Assert.IsTrue(createServiceOrderResult.ResultCode.Success); Assert.IsTrue(createServiceOrderResult.VerifySignSuccess == true);//通过验证 }