Exemplo n.º 1
0
 public void ValidateTransaction(string orderNumber, string hashCode)
 {
     if (!hashCode.Equals(CorvusPayHashUtil.CalculateSha1(new string[] { GetSecretKey(), orderNumber })))
     {
         throw new CorvusPayRuntimeExceptions.Sha1HashCodeInvalidException();
     }
 }
Exemplo n.º 2
0
        private Dictionary <CorvusPayRequestFieldType, string> GetBasicRequestFields(string orderNumber)
        {
            ValidateNecessaryFields(new string[] { GetStoreId(), orderNumber, GetStoreId() });
            var hash = CorvusPayHashUtil.CalculateSha1(new string[] { GetSecretKey(), orderNumber, GetStoreId() });

            return(new Dictionary <CorvusPayRequestFieldType, string>()
            {
                { CorvusPayRequestFieldType.STORE_ID, GetStoreId() },
                { CorvusPayRequestFieldType.ORDER_NUMBER, orderNumber },
                { CorvusPayRequestFieldType.HASH, hash }
            });
        }
Exemplo n.º 3
0
        protected Dictionary <string, string> CheckTransactionStatusApiCallInternal(string orderNumber, string timestamp)
        {
            ValidateNecessaryFields(new string[] { GetStoreId(), orderNumber, GetStoreId(), GetCurrencyCode(), timestamp });
            var hash          = CorvusPayHashUtil.CalculateSha1(new string[] { GetSecretKey(), orderNumber, GetStoreId(), GetCurrencyCode(), timestamp });
            var requestFields = new Dictionary <CorvusPayRequestFieldType, string>()
            {
                { CorvusPayRequestFieldType.STORE_ID, GetStoreId() },
                { CorvusPayRequestFieldType.ORDER_NUMBER, orderNumber },
                { CorvusPayRequestFieldType.HASH, hash },
                { CorvusPayRequestFieldType.CURRENCY, GetCurrencyCode() },
                { CorvusPayRequestFieldType.TIMESTAMP, timestamp }
            };

            return(ExecuteHttpsPost(CorvusPayConfiguration.CHECK_STATUS_MAPPING, requestFields));
        }