public ActionResult PayOut(RetrieveCheckoutFormRequest model) { int siparisID = 0; string data = ""; Options options = new Options(); options.ApiKey = ConfigurationManager.AppSettings["iyzico_apikey"]; options.SecretKey = ConfigurationManager.AppSettings["iyzico_secretkey"]; options.BaseUrl = ConfigurationManager.AppSettings["iyzico_baseurl"]; data = model.Token; RetrieveCheckoutFormRequest request = new RetrieveCheckoutFormRequest(); request.Token = data; CheckoutForm checkoutForm = CheckoutForm.Retrieve(request, options); Int32.TryParse(checkoutForm.BasketId, out siparisID); Siparis siparis = new Siparis(); siparis.Load(siparisID); if (checkoutForm.PaymentStatus == "SUCCESS") { siparis.DurumGuncelle((int)siparisDurum.hazirlaniyor, 0); } else { siparis.DurumGuncelle((int)siparisDurum.odemeBasarisiz, 0); } return(RedirectToAction("Pay", new { id = siparisID })); }
public ActionResult siparisDurumGuncelle(int siparisID, int siparisDurum) { if (Session["kullaniciID"] == null) { return(RedirectToAction("Login")); } Siparis s = new Siparis(); s.Load(siparisID); s.DurumGuncelle(siparisDurum, Convert.ToInt32(Session["kullaniciID"])); return(RedirectToAction("SiparisDetay", new { id = siparisID, hata = "Sipariş durumu güncellendi!" })); }