Exemple #1
0
        private static string GenerateEncryptedKeySendOTP(DataSendOTP data)
        {
            string saltKey = "123@ptm";
            string key     = data.NoSPBU + data.NoTelp + saltKey;

            string encKey = EncryptToSHA256(key);

            return(encKey);
        }
Exemple #2
0
        public static string SendOTP(string mobileNumber, string NoSPBU = "")
        {
            DataSendOTP data = new DataSendOTP();

            data.NoSPBU = NoSPBU;
            data.NoTelp = mobileNumber;
            //data.NoSPBU = "";
            //data.NoTelp = "+628122725643";
            string encKey = GenerateEncryptedKeySendOTP(data);
            JavaScriptSerializer _jsserializer = new JavaScriptSerializer();
            string strJSON = _jsserializer.Serialize(data);

            PertaminaServices.SVC_MS2Mobile service = new PertaminaServices.SVC_MS2Mobile();
            string responseMessageJSON = service.SendOTP(encKey, strJSON);
            //string responseMessageJSON = SVC_MS2Mobile.SendOTP(encKey, strJSON);
            SentOTPResponseFromService otpSentResponse = _jsserializer.Deserialize <SentOTPResponseFromService>(responseMessageJSON);

            return(otpSentResponse.OTP);
        }