Esempio n. 1
0
        public PurchaseInvoiceSaleResult PurchaseInvoiceSale(string orderRef, CustomerDetails customerDetails)
        {
            Log.InfoFormat("Calling PurchaseInvoiceSale for order with orderRef:{0}. CustomerDetails:{1}", orderRef, customerDetails);

            string hash      = _hasher.Create(_payExSettings.AccountNumber, orderRef, customerDetails, _payExSettings.EncryptionKey);
            string xmlResult = _orderFacade.PurchaseInvoiceSale(_payExSettings.AccountNumber, orderRef, customerDetails, hash);

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

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