Esempio n. 1
0
        public FinalizeTransactionResult FinalizeTransaction(string orderRef, long amount, long vatAmount, string clientIpAddress)
        {
            Log.InfoFormat("Calling FinalizeTransaction for orderRef:{0}.", orderRef);

            string hash      = _hasher.Create(_payExSettings.AccountNumber, orderRef, amount, vatAmount, clientIpAddress, _payExSettings.EncryptionKey);
            string xmlResult = _orderFacade.FinalizeTransaction(_payExSettings.AccountNumber, orderRef, amount, vatAmount, clientIpAddress, hash);

            FinalizeTransactionResult result = _resultParser.Deserialize <FinalizeTransactionResult>(xmlResult);

            if (result.Status.Success)
            {
                Log.InfoFormat("Successfully called FinalizeTransaction for orderRef:{0}. Result:{1}", orderRef, xmlResult);
            }
            else
            {
                Log.ErrorFormat("Error when calling FinalizeTransaction for orderRef:{0}. Result:{1}", orderRef, xmlResult);
            }
            return(result);
        }