Example #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();
        }
Example #2
0
        public static int CheckRequestStatus(string ServiceURL, bool IgnoreInvalidServerCertificate, long OrderID, string CardAcqID, string TerminalID, string transactionKey,
                                            string RequestKey, long AmountTrans, out string RetrivalRefNo,
                                            out string AppStatus)
        {
            ServicePointManager.ServerCertificateValidationCallback = null;
            if (IgnoreInvalidServerCertificate)
                ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(ValidateServerCertificate);

            string timestampOrder = CalcTimeStamp(ServiceURL, IgnoreInvalidServerCertificate);
            string fpOrder = CalcFpOrder(CardAcqID, AmountTrans, transactionKey, OrderID, timestampOrder);

            MerchantUtility cm = new MerchantUtility { Url = ServiceURL };


            int AppStatusCode = cm.CheckRequestStatusEx(OrderID, AmountTrans, CardAcqID, TerminalID, RequestKey,
                                                        timestampOrder, fpOrder, out RetrivalRefNo, out AppStatus
                                                       );


            return AppStatusCode;
        }
Example #3
0
 public static CheckStatusResult GetRequestStatus(string ServiceURL, bool IgnoreInvalidServerCertificate, long OrderID, string MerchantId,
                                                  string TerminalId, string TranactionKey, string RequestKey, long AmountTrans
                                                 )
 {
     ServicePointManager.ServerCertificateValidationCallback = null;
     if (IgnoreInvalidServerCertificate)
         ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(ValidateServerCertificate);
     MerchantUtility cm = new MerchantUtility { Url = ServiceURL };
     return cm.GetRequestStatusResult(OrderID, MerchantId, TerminalId, TranactionKey, RequestKey, AmountTrans);
 }
Example #4
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);

        }
Example #5
0
        public static CheckStatusResult CheckAuthStatus(string ServiceURL, bool IgnoreInvalidServerCertificate, long MerchantID, long TerminalID, long orderId, string RequestKey, string CardNumber)
        {
            ServicePointManager.ServerCertificateValidationCallback = null;
            if (IgnoreInvalidServerCertificate)
                ServicePointManager.ServerCertificateValidationCallback =
                       new RemoteCertificateValidationCallback(ValidateServerCertificate);

            MerchantUtility cm = new MerchantUtility { Url = ServiceURL };
            CheckStatusResult Res = cm.GetAuthRequestStatus(MerchantID.ToString(), TerminalID.ToString(), orderId, RequestKey, CardNumber);


            return Res;
        }
Example #6
0
        public static CheckStatusResult CheckBillStatus(string ServiceURL, bool IgnoreInvalidServerCertificate, long MerchantID, long TerminalID, long orderId, string RequestKey, BillInfo bInfo)
        {
            ServicePointManager.ServerCertificateValidationCallback = null;
            if (IgnoreInvalidServerCertificate)
                ServicePointManager.ServerCertificateValidationCallback =
                       new RemoteCertificateValidationCallback(ValidateServerCertificate);

            MerchantUtility cm = new MerchantUtility { Url = ServiceURL };
            CheckStatusResult Res = cm.CheckBillStatus(MerchantID.ToString(), TerminalID.ToString(), orderId, RequestKey, bInfo.BillID, bInfo.BillPaymentID);


            return Res;
        }