diff --git a/SendMail/Business/TxnPush.cs b/SendMail/Business/TxnPush.cs index 1c59e82..bcaf90a 100644 --- a/SendMail/Business/TxnPush.cs +++ b/SendMail/Business/TxnPush.cs @@ -71,7 +71,6 @@ namespace JMETxnPushScheduler.Business GetTxnDetails(item["ID"].ToString()); } } - } else if (_dbRes.Msg == "394488") { if (result.ResponseCode == "0") @@ -179,6 +178,32 @@ namespace JMETxnPushScheduler.Business Console.Write(JsonConvert.SerializeObject(r1)); } + if(cd.payStatus.ToUpper() == "PAID") + { + SendNotificationRequestMobile request = new SendNotificationRequestMobile() + { + IsBulkNotification = false, + UserName = cd.email, + ProcessId = "PaidTxnPushNotification", + ProviderId = NotifyTemplate.PAID_TXN.ToString(), + NotificationTypeId = NOTIFICATION_TYPE.PUSH_NOTIFICATION.ToString(), + Template = NotifyTemplate.PAID_TXN, + Recipients = new List() + { + new RecipientViewModel() + { + NotificationContent = new NotificationDTO() { + Body = JsonConvert.SerializeObject(bodyMappings), + //Title will be set by mapping json + }, + Address= cd.email + } + } + }; + var r1 = NotifierV2.SendNotification(request); + + Console.Write(JsonConvert.SerializeObject(r1)); + } } diff --git a/SendMail/Common/Notification.cs b/SendMail/Common/Notification.cs index 74314f2..cd97d99 100644 --- a/SendMail/Common/Notification.cs +++ b/SendMail/Common/Notification.cs @@ -25,5 +25,8 @@ namespace JMETxnPushScheduler.Common [Description("Email to customer after txn has been accepted by Pay-out partner (Cash Collection)")] CASH_TXN_POST = 4, + [Description("Push notification to the customer afte the txn is paid")] + PAID_TXN = 4 + } } diff --git a/SendMail/Common/TxnDetails.cs b/SendMail/Common/TxnDetails.cs index 10f06db..c8f79b7 100644 --- a/SendMail/Common/TxnDetails.cs +++ b/SendMail/Common/TxnDetails.cs @@ -22,5 +22,6 @@ namespace JMETxnPushScheduler.Common public string TotalAmount { get; set; } public string paymentMethod { get; set; } public string email { get; set; } + public string payStatus { get; set; } } } diff --git a/SendMail/DAO/TxnPushDAO.cs b/SendMail/DAO/TxnPushDAO.cs index d66c4ae..179d373 100644 --- a/SendMail/DAO/TxnPushDAO.cs +++ b/SendMail/DAO/TxnPushDAO.cs @@ -34,8 +34,6 @@ namespace JMETxnPushScheduler.DAO { string sql = "EXEC PROC_TP_TXN_PUSH @FLAG = 'UPDATE-POST_RELEASE'"; sql += ", @TRAN_ID = " + FilterString(id); - - //sql += ", @pCurrCostRate = " + FilterString(pCurrCostRate); //sql += ", @@control2 = " + FilterString(controlNo2); ExecuteDataTable(sql); } @@ -80,6 +78,7 @@ namespace JMETxnPushScheduler.DAO userDetails.serviceCharge = row["serviceCharge"].ToString(); // userDetails.rewardPoints = row["rewardPoints"].ToString(); userDetails.TranDate = row["createdDate"].ToString(); + userDetails.payStatus = row["payStatus"].ToString(); } return userDetails;