skip to Main Content

Im working on my project Employee Site using asp.net.core , Im facing problem in PayPal Gateway integration with Asp.net.core. I have created a controller called PaymentController taking help from https://www.c-sharpcorner.com/article/paypal-payment-gateway-integration-in-asp-net-mvc/ for ActionResult.

‘HttpRequest’ does not contain a definition for ‘Params’ and
no accessible extension method ‘Params’ accepting a first argument of
type ‘HttpRequest’ could be found (are you missing a using directive or
an assembly reference?

at this line im facing error: string payerId = Request.Params["PayerID"];

at this line too with url: string baseURI = Request.Url.Scheme + "://" + Request.Url.Authority
+ "/Home/PaymentWithPayPal?";

2

Answers


  1. (in .NET CORE) Use:

    var payerID = HttpContext.Request.Query["PayerID"].ToString()
    
    Login or Signup to reply.
  2. Make sure you are calling the necessary class:

    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;
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search