private void UpdateWrapper(AuthorizerJsApiTicketWrapper wrapper) { RequestApiResult <WeixinGetJsApiTicketResult> result = TokenApiWrapper.GetJsApiTicket(wrapper.AppId); if (result.Success) { wrapper.JsApiTicket = result.ApiResult.Ticket; wrapper.JsApiTicketExpiryTime = DateTime.Now.AddSeconds(result.ApiResult.ExpiresIn); } }
private AuthorizerJsApiTicketWrapper CreateWrapper(string appId) { RequestApiResult <WeixinGetJsApiTicketResult> result = TokenApiWrapper.GetJsApiTicket(appId); if (result.Success) { AuthorizerJsApiTicketWrapper wrapper = new AuthorizerJsApiTicketWrapper(); wrapper.AppId = appId; wrapper.JsApiTicket = result.ApiResult.Ticket; wrapper.JsApiTicketExpiryTime = DateTime.Now.AddSeconds(result.ApiResult.ExpiresIn); return(wrapper); } return(null); }