public IActionResult Donation(int price) { Guid paymentIdGuid = Guid.NewGuid(); string paymentId = $"PAYID-{paymentIdGuid}"; if (!_packageService.IsPackageValid(price)) { return(View("Invalid")); } ViewBag.ClientId = _paypalService.GetClientId(); ViewBag.Price = price; ViewBag.Currency = _packageService.GetCurrency(); ViewBag.PaymentId = paymentId.ToString(); ViewBag.Description = $"Donation for {_packageService.GetCashValue(price)} Cash!"; DonationCheckout donationCheckout = new DonationCheckout() { Price = price, Description = paymentId }; donationCheckout.DefineCashAmount(_packageService); DonationTransaction dt = new DonationTransaction() { CashAmount = donationCheckout.Cash, PaymentMethod = "PayPal", Price = donationCheckout.Price, GatewayTransactionId = donationCheckout.Description }; _donationTransactionService.Create(dt, _sessionUser.Email, _sessionUser.Nickname); return(View()); }