Пример #1
0
        /// <summary>
        /// 校验支付结果参数及签名是否合法(请勿修改本代码)
        /// </summary>
        /// <param name="data">通联支付数据</param>
        /// <returns></returns>
        public static bool VerifyResultSign(AllinpayData data)
        {
            PaymentResult paymentResult = new PaymentResult();

            paymentResult.setMerchantId(data.GetValue("merchantId"));
            paymentResult.setVersion(data.GetValue("version"));
            paymentResult.setLanguage(data.GetValue("language"));
            paymentResult.setSignType(data.GetValue("signType"));
            paymentResult.setPayType(data.GetValue("payType"));
            paymentResult.setIssuerId(data.GetValue("issuerId"));
            paymentResult.setPaymentOrderId(data.GetValue("paymentOrderId"));
            paymentResult.setOrderNo(data.GetValue("orderNo"));
            paymentResult.setOrderDatetime(data.GetValue("orderDatetime"));
            paymentResult.setOrderAmount(data.GetValue("orderAmount"));
            paymentResult.setPayDatetime(data.GetValue("payDatetime"));
            paymentResult.setPayAmount(data.GetValue("payAmount"));
            paymentResult.setExt1(data.GetValue("ext1"));
            paymentResult.setExt2(data.GetValue("ext2"));
            paymentResult.setPayResult(data.GetValue("payResult"));
            paymentResult.setErrorCode(data.GetValue("errorCode"));
            paymentResult.setReturnDatetime(data.GetValue("returnDatetime"));
            paymentResult.setKey(AppConfig.Global.AllinpayKey);
            paymentResult.setSignMsg(data.GetValue("signMsg"));
            string certPath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, AppConfig.Global.AllinpaySSLCertPath);

            paymentResult.setCertPath(certPath);
            bool verifyResult = paymentResult.verify();

            return(verifyResult);
        }