Ejemplo n.º 1
0
        /// <summary>
        /// Checking signature v2
        /// </summary>
        /// <param name="data"></param>
        /// <param name="isCredit"></param>
        /// <exception cref="SignatureException"></exception>
        private void IsSignatureValidV2(ResponseModel data, bool isCredit)
        {
            if (data.signature == null)
            {
                throw new SignatureException
                      {
                          SignatureString = data.signature, CalculatedSignature = "No Signature in request"
                      };
            }

            string calculatedSign = Signature.GetRequestSignatureV2(Signature.Base64Encode(data.data), isCredit);

            if (data.signature != calculatedSign)
            {
                throw new SignatureException {
                          SignatureString = data.signature, CalculatedSignature = calculatedSign
                };
            }
        }