public async Task <IActionResult> PaymentResponse() { string url; var siteUrls = _siteUrlsProvider.GetSiteUrl(_siteIdProvider.GetSiteId()); try { StringBuilder queryString = new StringBuilder(); if (!string.IsNullOrWhiteSpace(_httpContextAccessor.HttpContext.Request.QueryString.ToString())) { queryString.Append(_httpContextAccessor.HttpContext.Request.QueryString.ToString()); } else { if (_httpContextAccessor.HttpContext.Request.Form.Keys.Count > 0) { foreach (string key in _httpContextAccessor.HttpContext.Request.Form.Keys) { queryString.Append($"{key}={_httpContextAccessor.HttpContext.Request.Form[key]}&"); } } } var handleResponse = await HandleResponse(queryString.ToString().TrimEnd('&')); if (handleResponse.Success) { url = $"{siteUrls}/order-confirmation/{handleResponse.TransactionAltId}"; } else { url = $"{siteUrls}/pgerror?{handleResponse.PaymentGatewayError}"; } } catch (Exception ex) { _logger.Log(FIL.Logging.Enums.LogCategory.Error, ex); url = $"{siteUrls}/pgerror"; } Response.Redirect(url); return(View()); }
private void sendEmail(UserInviteCommand model) { try { string siteUrls = _siteUrlsProvider.GetSiteUrl(_siteIdProvider.GetSiteId()); Email email = new Email(); email.To = model.UserEmail; email.Bcc = "*****@*****.**"; email.From = "FeelitLIVE <*****@*****.**>"; email.TemplateName = "FeelInviteeRegistration"; email.Variables = new Dictionary <string, object> { ["signinlink"] = "<a href='" + siteUrls + "/signup" + "' style='margin-right:100px; '>" + "<h3>feelitLIVE.com</h3></a>", ["userpassword"] = model.UserInviteCode }; _emailSender.Send(email); } catch (Exception ex) { } }
private void sendEmail(UsersWebsiteInvite_InterestCommand model) { try { string siteUrls = _siteUrlsProvider.GetSiteUrl(_siteIdProvider.GetSiteId()); Email email = new Email(); email.To = model.Email; email.Bcc = "*****@*****.**"; email.From = "*****@*****.**"; email.TemplateName = "FeelInviteInterestRegistration"; email.Variables = new Dictionary <string, object> { ["useremail"] = model.Email, ["websiteurl"] = "<a href='" + siteUrls + "/signup" + "' style='margin-right:100px; '>" + "<h3>Invite Interest</h3></a>", ["subject"] = "Welcome to feelitLIVE! Activate your account to get started.", }; _emailSender.Send(email); } catch (Exception ex) { } }
private bool sendEmail(UserInviteCommand model) { try { string siteUrls = _siteUrlsProvider.GetSiteUrl(Contracts.Enums.Site.feelaplaceSite); Email email = new Email(); email.To = model.UserEmail; email.Bcc = "*****@*****.**"; email.From = "FeelitLIVE <*****@*****.**>"; email.TemplateName = "FeelInviteeRegistration"; email.Variables = new Dictionary <string, object> { ["signinlink"] = "<a href='" + siteUrls + "/signup" + "' style='margin-right:100px; '>" + "<h3>feelitLIVE.com</h3></a>", ["userpassword"] = model.UserInviteCode }; _emailSender.Send(email); return(true); } catch (Exception ex) { return(false); } }
public async Task <ApproveModaratePlaceResponseViewModel> ApprovePlace(Guid placeAltID, bool isDeactivate, long eventId, FIL.Contracts.Enums.EventStatus eventStatus) { try { string _host = _httpContextAccessor.HttpContext.Request.Host.Host; var session = await _sessionProvider.Get(); ApproveModeratePlaceCommandResult placeCalendarResult = await _commandSender.Send <ApproveModeratePlaceCommand, ApproveModeratePlaceCommandResult>(new ApproveModeratePlaceCommand { PlaceAltId = placeAltID, IsDeactivateFeels = isDeactivate, EventStatus = eventStatus, EventId = eventId, UpdateAlgolia = (_host.Contains("dev") || _host.Contains("localhost")) ? false : true }); if (placeCalendarResult.MasterEventTypeId == Contracts.Enums.MasterEventType.Online && !isDeactivate && eventStatus == 0) { var url = _siteUrlsProvider.GetSiteUrl(_siteIdProvider.GetSiteId()); Email email = new Email(); email.To = placeCalendarResult.Email; email.From = "FeelitLIVE <*****@*****.**>"; email.TemplateName = "creatoreventapprove"; email.Variables = new Dictionary <string, object> { ["eventimage"] = "<img width='100%' alt='Event banner' src='https://s3-us-west-2.amazonaws.com/feelaplace-cdn/images/places/about/" + placeAltID.ToString().ToUpper() + "-about.jpg' />", ["eventlink"] = !placeCalendarResult.IsTokanize ? $"{url}/place/{placeCalendarResult.ParentCategorySlug}/{placeCalendarResult.Slug}/{placeCalendarResult.SubCategorySlug}" : $"{url}/event/{placeCalendarResult.Slug}/{placeCalendarResult.PlaceAltId.ToString().ToLower()}" }; await _accountEmailSender.Send(email); } if (placeCalendarResult.MasterEventTypeId == Contracts.Enums.MasterEventType.Online && eventStatus == EventStatus.WaitingForApproval && placeCalendarResult.Success && !FIL.Contracts.Utils.Constant.TestEmail.TestEmails.Contains(session.User.Email) && !_host.Contains("localhost") && !_host.Contains("dev") ) { StripeConnectAccountCommandResult EventData = await _commandSender.Send <StripeConnectAccountCommand, StripeConnectAccountCommandResult>(new StripeConnectAccountCommand { AuthorizationCode = "", ExtraCommisionPercentage = 25, ExtraCommisionFlat = 0, channels = Channels.Feel, EventId = placeCalendarResult.PlaceAltId, IsStripeConnect = false, ModifiedBy = session.User != null ? session.User.AltId : Guid.Parse("7390283B-4A32-4860-BA3D-B57F1E5F2DAC") }); List <EmailTemplate> emailTemplates = new List <EmailTemplate>(); emailTemplates.Add(new EmailTemplate { TemplateName = "fapcreateevent", To = EventData.Email }); emailTemplates.Add(new EmailTemplate { TemplateName = "FILSubmitEventForApprovalAlertToCorp", To = "*****@*****.**" }); foreach (var emailTemplate in emailTemplates) { StringBuilder ticketCategories = new StringBuilder(); foreach (var eventTicketDetail in EventData.EventTicketDetail) { var eventTicketAttribute = EventData.EventTicketAttribute.Where(s => s.EventTicketDetailId == eventTicketDetail.Id).FirstOrDefault(); var ticketCategory = EventData.TicketCategories.Where(s => s.Id == eventTicketDetail.TicketCategoryId).FirstOrDefault(); ticketCategories.Append("<tr>"); ticketCategories.Append($"<td style='font-family: Verdana, Geneva, Tahoma, sans-serif; font-size: 14px; line-height: 26px; color: #333;' width='200'>{ticketCategory.Name}: </td> <td style='font-family: Verdana, Geneva, Tahoma, sans-serif; font-size: 14px; line-height: 26px; color: #333;'>{EventData.CurrencyType.Code} {eventTicketAttribute.Price}</td> "); ticketCategories.Append("</tr>"); } Email email = new Email(); email.To = emailTemplate.To; email.From = "FeelitLIVE <*****@*****.**>"; email.TemplateName = emailTemplate.TemplateName; email.Variables = new Dictionary <string, object> { ["eventimage"] = "<img width='100%' alt='Event banner' src='https://s3-us-west-2.amazonaws.com/feelaplace-cdn/images/places/about/" + EventData.Event.AltId.ToString().ToUpper() + "-about.jpg' />", ["eventname"] = EventData.Event.Name, ["eventdatetime"] = $"{EventData.EventDetail.StartDateTime.ToString("MMM dd, yyyy").ToUpper()} {EventData.DayTimeMappings.StartTime}", ["ticketcategories"] = ticketCategories.ToString(), }; await _accountEmailSender.Send(email); } } return(new ApproveModaratePlaceResponseViewModel { Success = true }); } catch (Exception e) { return(new ApproveModaratePlaceResponseViewModel { Success = false }); } }
public async Task <TicketAlertUserMappingResponseDataViewModel> saveSignUp([FromBody] TicketAlertUserMappingRequestDataViewModel model) { if (ModelState.IsValid) { try { model.CountriesAltIds = model.CountriesAltIds.Distinct().ToList(); model.TicketAlertEventMapping = model.TicketAlertEventMapping.Distinct().ToList(); var queryResult = await _querySender.Send(new TicketAlertUesrMappingQuery { Countries = model.CountriesAltIds, Email = model.Email, EventAltId = model.EventAltId, EventDetailId = 0, TicketAlertEvents = model.TicketAlertEventMapping }); if (queryResult.IsAlredySignUp) { return(new TicketAlertUserMappingResponseDataViewModel { IsAlreadySignUp = true, Success = false }); } else { FIL.Contracts.Enums.TourTravelPackages TourTravelPackages = FIL.Contracts.Enums.TourTravelPackages.No; if (model.TourAndTavelPackage == 1) { TourTravelPackages = FIL.Contracts.Enums.TourTravelPackages.Yes; } await _commandSender.Send(new TicketAlertUserMappingCommand { CountriesAltId = model.CountriesAltIds, EventAltId = model.EventAltId, EventDetailId = 0, FirstName = model.FirstName, TourTravelPackages = TourTravelPackages, LastName = model.LastName, PhoneCode = model.PhoneCode, PhoneNumber = model.PhoneNumber, Email = model.Email, NumberOfTickets = model.NoOfTickets, TicketAlertEvents = model.TicketAlertEventMapping, Ip = _clientIpProvider.Get() }); try { var siteUrls = _siteUrlsProvider.GetSiteUrl(_siteIdProvider.GetSiteId()); Email email = new Email(); email.To = model.Email; email.From = "FeelitLIVE <*****@*****.**>"; email.TemplateName = "FILTicketAlert"; email.Variables = new Dictionary <string, object> { ["eventname"] = model.EventName }; await _confirmationEmailSender.Send(email); return(new TicketAlertUserMappingResponseDataViewModel { IsAlreadySignUp = false, Success = true }); } catch (Exception e) { return(new TicketAlertUserMappingResponseDataViewModel { IsAlreadySignUp = false, Success = true }); } } } catch (Exception e) { return(new TicketAlertUserMappingResponseDataViewModel { IsAlreadySignUp = false, Success = false }); } } else { return(new TicketAlertUserMappingResponseDataViewModel { IsAlreadySignUp = false, Success = false }); } }
public async Task <PaymentFormResponseViewModel> Charge([FromBody] PaymentFormDataViewModel model) { if (ModelState.IsValid) { try { PaymentCommand paymentQuery; if (model.PaymentGateway == PaymentGateway.Stripe) { paymentQuery = new PaymentCommand { TransactionId = model.TransactionId, PaymentCard = new FIL.Contracts.Commands.Payment.PaymentCard { CardNumber = model.CardNumber, NameOnCard = model.NameOnCard, Cvv = model.Cvv, ExpiryMonth = Convert.ToInt16(model.ExpiryMonth), ExpiryYear = Convert.ToInt16(model.ExpiryYear), CardType = (CardType)model.CardTypeId, }, PaymentRedirectUrl = $"{_siteUrlsProvider.GetSiteUrl(_siteIdProvider.GetSiteId())}/PaymentResponse/PaymentResponse?gateway={(int)PaymentGateway.Stripe}&orderId={model.TransactionId}", Token = model.Token, PaymentOption = (PaymentOptions)model.PaymentOption, BillingAddress = new FIL.Contracts.Commands.Payment.BillingAddress { Address = model.Address, Zipcode = model.Zipcode, City = model.City, State = model.State, Country = model.Country }, PaymentGateway = PaymentGateway.Stripe, ChannelId = Channels.Feel, }; } else { paymentQuery = new PaymentCommand { TransactionId = model.TransactionId, PaymentCard = new FIL.Contracts.Commands.Payment.PaymentCard { CardNumber = model.CardNumber, NameOnCard = model.NameOnCard, Cvv = model.Cvv, ExpiryMonth = Convert.ToInt16(model.ExpiryMonth), ExpiryYear = Convert.ToInt16(model.ExpiryYear), CardType = (CardType)model.CardTypeId, }, PaymentOption = (PaymentOptions)model.PaymentOption, BillingAddress = new FIL.Contracts.Commands.Payment.BillingAddress { Address = model.Address, Zipcode = model.Zipcode, City = model.City, State = model.State, Country = model.Country }, BankAltId = model.BankAltId, CardAltId = model.CardAltId, PaymentGateway = PaymentGateway.CCAvenue, ChannelId = Channels.Feel, Token = model.Token, }; } var result = await _commandSender.Send <PaymentCommand, PaymentCommandResult>(paymentQuery); string _action = result.PaymentHtmlPostResponse == null ? "" : result.PaymentHtmlPostResponse.HtmlPostRequest.Action; string _method = result.PaymentHtmlPostResponse == null ? "" : result.PaymentHtmlPostResponse.HtmlPostRequest.Method; if (model.PaymentGateway == PaymentGateway.Stripe && !result.PaymentResponse.Success && !string.IsNullOrWhiteSpace(result.PaymentResponse.RedirectUrl)) { _action = PaymentGatewayError.RequireSourceAction.ToString(); _method = result.PaymentResponse.RedirectUrl; } return(new PaymentFormResponseViewModel { TransactionAltId = result.TransactionAltId, Success = result.PaymentResponse == null ? true : result.PaymentResponse.Success, ErrorMessage = result.PaymentResponse == null ? "" : result.PaymentResponse.PaymentGatewayError == PaymentGatewayError.None ? "" : result.PaymentResponse.PaymentGatewayError.ToString(), Action = _action, Method = _method, FormFields = result.PaymentHtmlPostResponse == null ? new Dictionary <string, string>() : result.PaymentHtmlPostResponse.HtmlPostRequest.FormFields, }); } catch (Exception ex) { return(new PaymentFormResponseViewModel { Success = false, ErrorMessage = ex.ToString() }); } } return(new PaymentFormResponseViewModel { Success = false }); }