Exemplo n.º 1
0
        public static void verifyRequestFromAliPay(HttpContext context, string ToUserId, string AppId)
        {
            System.Collections.Generic.Dictionary <string, string> alipayRequstParams = AliOHHelper.getAlipayRequstParams(context);
            string text = alipayRequstParams["biz_content"];

            if (!AliOHHelper.verifySignAlipayRequest(alipayRequstParams))
            {
                AliOHHelper.ReturnXmlResponse(false, RsaKeyHelper.GetRSAKeyContent(AlipayFuwuConfig.merchant_public_key, true), context, ToUserId, AppId);
            }
            else
            {
                AliOHHelper.ReturnXmlResponse(true, RsaKeyHelper.GetRSAKeyContent(AlipayFuwuConfig.merchant_public_key, true), context, ToUserId, AppId);
            }
        }
Exemplo n.º 2
0
        public static void verifygw(HttpContext context)
        {
            System.Collections.Generic.Dictionary <string, string> alipayRequstParams = AliOHHelper.getAlipayRequstParams(context);
            string xml = alipayRequstParams["biz_content"];

            if (!AliOHHelper.verifySignAlipayRequest(alipayRequstParams))
            {
                AliOHHelper.verifygwResponse(false, RsaKeyHelper.GetRSAKeyContent(AlipayFuwuConfig.merchant_public_key, true), context);
            }
            if ("verifygw".Equals(AliOHHelper.getXmlNode(xml, "EventType")))
            {
                AliOHHelper.verifygwResponse(true, RsaKeyHelper.GetRSAKeyContent(AlipayFuwuConfig.merchant_public_key, true), context);
            }
        }