Интеграция Paypal Ipn с asp.net MVC
Страница HomeControler / Index.cshtml, как показано ниже
<p class="inline-small-label" style="padding-top: 7px;">
<span>User ID</span></p>
Pay with PayPal
HomeControler / Ipn Действие метод, как показано ниже
public ActionResult Ipn()
{
// Receive IPN request from PayPal and parse all the variables returned
var formVals = new Dictionary();
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();
}
Мой вопрос, даже после того, как оплата была сделана, выше Ipn метод действия не срабатывает. Не могу отладить. Как я могу это сделать?