'HttpRequest'不包含'Params'和'url'的定义



我工作在我的项目员工网站使用asp.net.core,我在PayPal网关与asp.net.core集成面临的问题。我已经创建了一个名为PaymentController的控制器,从https://www.c-sharpcorner.com/article/paypal-payment-gateway-integration-in-asp-net-mvc/获取ActionResult的帮助。

'HttpRequest'没有定义'Params'和没有可访问的扩展方法'Params'接受的第一个参数类型'HttpRequest'可以找到(你错过了一个使用指令或程序集引用?

在这行我面对错误:string payerId = Request.Params[" payerId "];

在这行也使用url: string baseURI = Request.Url.Scheme + ";//"+ Request.Url.Authority+"/Home/PaymentWithPayPal ?";

(在。net CORE中)使用:

var payerID = HttpContext.Request.Query["PayerID"].ToString()

确保调用了必要的类:

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using WebApplication7.Models;
using PayPal.Api;
using PayPal.Util;
using PayPal.Api.OpenIdConnect;

最新更新