Ejemplo n.º 1
0
        private static string CalcTimeStamp(string ServiceUrl, bool IgnoreInvalidServerCertificate)
        {
            ServicePointManager.ServerCertificateValidationCallback = null;
            if (IgnoreInvalidServerCertificate)
                ServicePointManager.ServerCertificateValidationCallback =
                       new RemoteCertificateValidationCallback(ValidateServerCertificate);

            MerchantUtility s = new MerchantUtility { Url = ServiceUrl };
            return s.CalcTimeStamp();
        }
Ejemplo n.º 2
0
        public static void GetCommitReportByPageNumber(string ServiceUrl, bool IgnoreInvalidServerCertificate, string MerchantId,
                                           string Terminal, string TransactionKey,
                                           string FromShamsiDate, string ToShamsiDate, string FromHour, string ToHour,
                                           string TraceNo, string Amount, string OrderId,
                                           int PageNumber, out int TotelPage,
                                           out string XMLData, out string XMLSchema)
        {
            ServicePointManager.ServerCertificateValidationCallback = null;
            if (IgnoreInvalidServerCertificate)
                ServicePointManager.ServerCertificateValidationCallback =
                       new RemoteCertificateValidationCallback(ValidateServerCertificate);


            MerchantUtility rptService = new MerchantUtility { Url = ServiceUrl };

            string TimeStamp = rptService.CalcTimeStamp();

            string textInput = string.Concat(TimeStamp, MerchantId, Terminal, TransactionKey);
            MD5 hash = new MD5CryptoServiceProvider();
            ASCIIEncoding encoding = new ASCIIEncoding();
            byte[] Input = encoding.GetBytes(textInput);
            byte[] result = hash.ComputeHash(Input);
            string Fp = BitConverter.ToString(result);

            XMLData = rptService.GetCommitReportByPageNumber(MerchantId, Terminal, TimeStamp, Fp, FromShamsiDate, ToShamsiDate, FromHour, ToHour, TraceNo,
                                                             Amount, OrderId, PageNumber, out TotelPage, out XMLSchema);

        }