コード例 #1
0
        /// <summary>A MD5 checksum to ensure data integrity. See http://quickpay.net/faq/md5check/ for more information.</summary>
        public string CalculateMD5()
        {
            string md5String =
                MsgType + _ordernumber + _amount + _currency + _time + _state + _qpstat + _qpstatmsg + _chstat +
                _chstatmsg
                + _merchant + _merchantemail + _transaction + _cardtype + CardNumber + _cardexpire +
                SplitPayment + FraudProbability + FraudRemarks + FraudReport + Fee + Secret;

            using (var md5 = new MD5CryptoServiceProvider())
            {
                byte[] md5Hash    = md5.ComputeHash(Encoding.UTF8.GetBytes(md5String));
                string md5HashStr = PaymentRequestParameters.ToHexString(md5Hash);
                if (!Md5Check.IsMatch(md5HashStr))
                {
                    throw new ArgumentException();
                }
                return(md5HashStr);
            }
        }
コード例 #2
0
        private void Authorize(PaymentRequestParameters request)
        {
            NameValueCollection data = request.ToNameValueCollection();

            Authorize(data);
        }