Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.HttpMethod == "POST")
     {
         InstantPaymentNotification ipn = new InstantPaymentNotification();
         ipn.setIPNHandler(new SampleIPNHandler());
         ipn.listem(Request.Form);
     }
 }
        public ActionResult PaypalNotify(FormCollection formCollection)
        {
            var paymentVerification = new InstantPaymentNotification(HttpContext.ApplicationInstance.Context.Request,
                                                                     ConfigurationManager.AppSettings["BusinessEmail"], formCollection, new BookingRepository(new UnitOfWork()));

            FileInfo fileInfo  = new FileInfo(Server.MapPath("~/IPN_Notification/IPNMessage.txt"));
            var      ipnWriter = fileInfo.CreateText();

            var isVerified = paymentVerification.ProcessIPNResults(HttpContext.ApplicationInstance.Context, ipnWriter);

            if (isVerified)
            {
                return(Content("IPN Verification Successfull"));
            }
            return(Content("IPN Verification Failed"));
        }