public IActionResult UpdateRecurringUser(string subscr_id, string txn_id) { try { Model.DatabaseRepository dbr = new Model.DatabaseRepository(_logger, _appEnv); Domain.Socioboard.Models.PaymentTransaction _PaymentTransaction = dbr.FindSingle <Domain.Socioboard.Models.PaymentTransaction>(t => t.paymentId.Contains(subscr_id)); Domain.Socioboard.Models.User _user = dbr.FindSingle <Domain.Socioboard.Models.User>(x => x.Id == _PaymentTransaction.userid); _user.ExpiryDate = _user.ExpiryDate.AddDays(30); _user.TrailStatus = Domain.Socioboard.Enum.UserTrailStatus.active; dbr.Update <Domain.Socioboard.Models.User>(_user); _PaymentTransaction.trasactionId = txn_id; dbr.Update <Domain.Socioboard.Models.PaymentTransaction>(_PaymentTransaction); } catch (Exception ex) { _logger.LogError("UpdateRecurringUser======" + ex.StackTrace); _logger.LogError("UpdateRecurringUser=========" + ex.Message); } return(Ok()); }
public IActionResult UpdateRecurringUser(string subscr_id, string txn_id, DateTime subscr_date, string payer_email, string Payername, string payment_status, string item_name, string amount, string media) { try { string path = _appEnv.WebRootPath + "\\views\\mailtemplates\\invoice.html"; string html = System.IO.File.ReadAllText(path); html = html.Replace("[paymentId]", txn_id); html = html.Replace("[subscr_date]", subscr_date.ToString()); html = html.Replace("[payer_email]", payer_email); html = html.Replace("[Payername]", Payername); html = html.Replace("[payment_status]", payment_status); html = html.Replace("[item_name]", item_name); html = html.Replace("[amount]", amount + "$"); html = html.Replace("[media]", media); _emailSender.SendMailSendGrid(_appSettings.frommail, "", payer_email, "", "", "Socioboard Payment Invoice", html, _appSettings.SendgridUserName, _appSettings.SendGridPassword); Model.DatabaseRepository dbr = new Model.DatabaseRepository(_logger, _appEnv); Domain.Socioboard.Models.PaymentTransaction _PaymentTransaction = dbr.FindSingle <Domain.Socioboard.Models.PaymentTransaction>(t => t.paymentId.Contains(subscr_id)); Domain.Socioboard.Models.User _user = dbr.FindSingle <Domain.Socioboard.Models.User>(x => x.Id == _PaymentTransaction.userid); _user.ExpiryDate = _user.ExpiryDate.AddDays(30); _user.TrailStatus = Domain.Socioboard.Enum.UserTrailStatus.active; dbr.Update <Domain.Socioboard.Models.User>(_user); _PaymentTransaction.trasactionId = txn_id; _PaymentTransaction.paymentdate = DateTime.UtcNow; _PaymentTransaction.payeremail = payer_email; _PaymentTransaction.Payername = Payername; _PaymentTransaction.paymentstatus = payment_status; _PaymentTransaction.itemname = item_name; _PaymentTransaction.media = media; _PaymentTransaction.subscrdate = subscr_date; _PaymentTransaction.amount = amount; dbr.Update(_PaymentTransaction); } catch (Exception ex) { _logger.LogError("UpdateRecurringUser======" + ex.StackTrace); _logger.LogError("UpdateRecurringUser=========" + ex.Message); } return(Ok()); }
public IActionResult GetPaymentTransactiondata(long id) { Model.DatabaseRepository dbr = new Model.DatabaseRepository(_logger, _appEnv); Domain.Socioboard.Models.PaymentTransaction _PaymentTransaction = dbr.Find <Domain.Socioboard.Models.PaymentTransaction>(t => t.id == id).FirstOrDefault(); return(Ok(_PaymentTransaction)); }