Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • mitesh 1 post 71 karma points
    Oct 25, 2018 @ 17:56
    mitesh
    0

    Paypal IPN not calling my controller method

    Hi,

    I have created one controller(class) name as RegisterUserController.cs in App_Code folder and in that I have created the method name as IPN

     [HttpPost]
        public void IPN()
        {
            string email = "[email protected]";
            string recipeId = "12345";
            SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["umbracoDbDSN"].ConnectionString);
            myConnection.Open();
            SqlCommand add = new SqlCommand("INSERT INTO Bookmarks (Email, RecipeId) VALUES ('" + email + "', '" + recipeId + "')", myConnection);
            add.ExecuteNonQuery();
            myConnection.Close();
        }
    

    I have also created the page at path views->IPN.cshtml

    Now when I am clicking at paypal button as shown in below screenshot enter image description here

    I am passing URL as below on click of subscribe button

     <add key="ReturnProfileURL" value="http://stage.com/umbraco/api/RegisterUser/PayPalProfileSuccess?UserID="/>
     <add key="CancelProfileURL" value="http://stage.com/umbraco/api/RegisterUser/PayPalProfileCancel?UserID="/>
     <add key="NotifyURL" value="http://stage.com/IPN"/>
    

    but after doing payment paypal is not calling my IPN method or might be some because of my code issue it is not calling my method. Any idea for how should I called it.

Please Sign in or register to post replies

Write your reply to:

Draft