public ActionResult ProcessPayment(int id, int quantity, string paymentIntentId, string fullName, string emailAddress, string phoneNumber = "") { try { var result = _stripeService.GetPaymentIntentById(paymentIntentId); var contact = _contactService.GetOrCreateContact("", fullName, emailAddress); _userService.UpdateActiveUserEmailAddressIfFromFacebook(contact); return(Json(new { success = true, purchaseModel = new PurchaseModel { ItemId = id, Quantity = quantity, ContactId = contact.Id, CustomerName = fullName, CustomerEmailAddress = emailAddress, Amount = result.Amount > 0 ? (double)result.Amount / 100 : 0, Description = result.Description, Currency = result.Currency?.ToUpper() ?? "USD", Status = result.Status } })); } catch (Exception ex) { _logger.Error($"PaymentController => ProcessPayment => Error: {ex.GetFullErrorMessage()}"); return(Json(new { success = false, errorMsg = ex.Message })); } }