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

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

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

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