HomeControler/Index.cshtml page is as below
<div id="paypalDiv">
<form id="paypalForm" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<fieldset>
<p class="inline-small-label" style="padding-top: 7px;">
<label for="device-id"><span>User ID</span></label></p>
<input id="custom" class="full-width" type="text" name="custom" value="">
<input class="full-width" type="hidden" name="business" value="sampath-facilitator@inexisconsulting.com">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="credits">
<input type="hidden" name="item_number" value="40">
<input type="hidden" name="amount" value="2.95">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="http://localhost:13769">
<input type="hidden" name="notify_url" value="https://localhost:13769/Home/Ipn">
<button class="btn btn-primary submit-button" type="submit">Pay with PayPal</button>
</fieldset>
</form>
</div>
HomeControler/Ipn Action method is as below
public ActionResult Ipn()
{
// Receive IPN request from PayPal and parse all the variables returned
var formVals = new Dictionary<string, string>();
formVals.Add("cmd", "_notify-validate");
// if you want to use the PayPal sandbox change this from false to true
string response = GetPayPalResponse(formVals, false);
if (response == "VERIFIED")
{
string transactionID = Request["txn_id"];
string sAmountPaid = Request["mc_gross"];
string deviceID = Request["custom"];
//validate the order
Decimal amountPaid = 0;
Decimal.TryParse(sAmountPaid, out amountPaid);
if (sAmountPaid == "2.95")
{
// take the information returned and store this into a subscription table
// this is where you would update your database with the details of the tran
return View();
}
else
{
// let fail - this is the IPN so there is no viewer
// you may want to log something here
}
}
return View();
}
My question is even after payment has been done, above Ipn action method is not firing.Cannot debug.How could I do that ?