Exemple #1
0
        private object Service_RestApiPost(object sender, RestApiEventArgs args)
        {
            if (!string.IsNullOrEmpty(args.RouteResource))
            {
                if (Utils.EqualsIgnoreCase(args.RouteResource, nameof(StlMagazineArticles.ApiArticles)))
                {
                    return(StlMagazineArticles.ApiArticles(args.Request));
                }
                if (Utils.EqualsIgnoreCase(args.RouteResource, WeiXinPayController.RouteResource))
                {
                    //var amount = args.Request.GetPostDecimal("amount");
                    //var detail = args.Request.GetPostString("detail");
                    //var guid = args.Request.GetPostString("guid");

                    return(WeiXinPayController.Pay(args.Request));


                    //return Utils.ChargeByWeixin(detail, amount, string.Empty, WeiXinNotifyController.GetNotifyUrl(guid));
                }

                if (Utils.EqualsIgnoreCase(args.RouteResource, WeiXinNotifyController.RouteResource) && !string.IsNullOrEmpty(args.RouteId))
                {
                    return(WeiXinNotifyController.Notify(args.RouteId));
                }
            }

            return(null);
        }
Exemple #2
0
        private object Service_RestApiPost(object sender, RestApiEventArgs args)
        {
            var request = args.Request;

            if (Utils.EqualsIgnoreCase(args.RouteResource, nameof(StlPayment.ApiGet)))
            {
                return(StlPayment.ApiGet(request));
            }
            if (Utils.EqualsIgnoreCase(args.RouteResource, nameof(StlPayment.ApiPay)))
            {
                return(StlPayment.ApiPay(request));
            }
            if (Utils.EqualsIgnoreCase(args.RouteResource, nameof(StlPayment.ApiPaySuccess)))
            {
                return(StlPayment.ApiPaySuccess(request));
            }
            if (Utils.EqualsIgnoreCase(args.RouteResource, nameof(StlPayment.ApiWeixinInterval)))
            {
                return(StlPayment.ApiWeixinInterval(request));
            }
            if (Utils.EqualsIgnoreCase(args.RouteResource, nameof(StlPayment.ApiWeixinNotify)))
            {
                return(StlPayment.ApiWeixinNotify(request, args.RouteId));
            }
            if (Utils.EqualsIgnoreCase(args.RouteResource, nameof(StlPayment.ApiRedirect)))
            {
                var successUrl = request.GetPostString("successUrl");
                StlPayment.ApiRedirect(successUrl);
            }

            return(new HttpResponseMessage(HttpStatusCode.NotFound));
        }
Exemple #3
0
        private object Service_RestApiGet(object sender, RestApiEventArgs args)
        {
            var request = args.Request;

            if (Utils.EqualsIgnoreCase(args.RouteResource, nameof(StlPayment.ApiQrCode)))
            {
                return(StlPayment.ApiQrCode(request));
            }

            return(new HttpResponseMessage(HttpStatusCode.NotFound));
        }
Exemple #4
0
        private object Service_RestApiGet(object sender, RestApiEventArgs args)
        {
            if (!string.IsNullOrEmpty(args.RouteResource))
            {
                if (Utils.EqualsIgnoreCase(args.RouteResource, WeiXinNotifyController.RouteResource) && !string.IsNullOrEmpty(args.RouteId))
                {
                    return(WeiXinNotifyController.Notify(args.RouteId));
                }
            }

            return(null);
        }
Exemple #5
0
 public object OnRestApiDelete(RestApiEventArgs e)
 {
     return(RestApiDelete?.Invoke(this, e));
 }
Exemple #6
0
 public object OnRestApiPut(RestApiEventArgs e)
 {
     return(RestApiPut?.Invoke(this, e));
 }