From 451f560b30ef509112958a6e1a036f450a49e9cf Mon Sep 17 00:00:00 2001 From: shakun Date: Mon, 25 Sep 2023 22:08:48 +0545 Subject: [PATCH] SMS n rename IME response --- .../BusinessLogic/SMSApiService/SMSService.cs | 4 ++-- .../SMSApiService/SmsResponse.cs | 23 +++++++++++++++++++ Common/Models/Enums/GeneralEnum.cs | 1 + ThirdPartyAPIs/Config/Mapping.json | 4 ++-- 4 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 Business/BusinessLogic/SMSApiService/SmsResponse.cs diff --git a/Business/BusinessLogic/SMSApiService/SMSService.cs b/Business/BusinessLogic/SMSApiService/SMSService.cs index a067b11..10ccc94 100644 --- a/Business/BusinessLogic/SMSApiService/SMSService.cs +++ b/Business/BusinessLogic/SMSApiService/SMSService.cs @@ -41,7 +41,7 @@ namespace Business.BusinessLogic.SMSApiService StringBuilder sb = new StringBuilder(); byte[] buf = new byte[1024]; string url = _baseUrl + - "?username=" + _userName + "&password=" + _password + "&option=xml" + + "?username=" + _userName + "&password=" + _password + "&number=" + model.MobileNumber + "&message=" + HttpUtility.UrlEncode(model.SMSBody) + "&orig=" + HttpUtility.UrlEncode(_senderId); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); @@ -62,7 +62,7 @@ namespace Business.BusinessLogic.SMSApiService var result = sb.ToString(); - if (result.Contains("SUCCESS 722")) + if (result.Contains("SUCCESS")) { _tPResponse.ResponseCode = "0"; _tPResponse.Msg = "SMS Sent Successfully!"; diff --git a/Business/BusinessLogic/SMSApiService/SmsResponse.cs b/Business/BusinessLogic/SMSApiService/SmsResponse.cs new file mode 100644 index 0000000..237e0cd --- /dev/null +++ b/Business/BusinessLogic/SMSApiService/SmsResponse.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Serialization; + +namespace Business.BusinessLogic.SMSApiService +{ + [XmlRoot(ElementName = "response")] + public class SmsResponse + { + [XmlElement(ElementName = "credits")] + public string Credits { get; set; } + [XmlElement(ElementName = "credits_used")] + public string Credits_used { get; set; } + [XmlAttribute(AttributeName = "status")] + public string Status { get; set; } + [XmlAttribute(AttributeName = "id")] + public string Id { get; set; } + } + +} diff --git a/Common/Models/Enums/GeneralEnum.cs b/Common/Models/Enums/GeneralEnum.cs index f9d4b9c..17518f8 100644 --- a/Common/Models/Enums/GeneralEnum.cs +++ b/Common/Models/Enums/GeneralEnum.cs @@ -54,6 +54,7 @@ namespace Common.Models.Enums [Description("Email to customer for OTP")] OTP_EMAIL = 8, + FORCE_PASSWORD_CHANGE = 9, TRANSACTION_APPROVED = 10, TRANSACTION_MODIFY = 11, diff --git a/ThirdPartyAPIs/Config/Mapping.json b/ThirdPartyAPIs/Config/Mapping.json index 76ad9f6..a91c2a9 100644 --- a/ThirdPartyAPIs/Config/Mapping.json +++ b/ThirdPartyAPIs/Config/Mapping.json @@ -25,7 +25,7 @@ { "SValue": "OTP_EMAIL", "DValue": "App_Data\\Templates\\OTP_EMAIL.html", - "Dtext": "IME Verification" + "Dtext": "IME London Verification" }, { "SValue": "BANK_TXN_POST", @@ -58,7 +58,7 @@ "Dtext": "Registration Completion Email" }, { - "SValue": "RESET_PASSWORD", + "SValue": "RESET_PASSWORD_EMAIL", "DValue": "App_Data\\Templates\\RESET_PASSWORD_EMAIL.html", "Dtext": "Reset Password" }