} // End of the CreateInvoiceCorporateTest method /// <summary> /// Create a production invoice for a company /// </summary> private static Dictionary<string, string> CreateInvoiceCorporateProduction(string orderReference, Order order, Domain domain, KeyStringList settings, KeyStringList tt) { // Create the dictionary to return Dictionary<string, string> responseData = new Dictionary<string, string>(10); // Create the PayEx order Annytab.Webshop.Payex.Production.PxOrder pxOrder = new Annytab.Webshop.Payex.Production.PxOrder(); // Get the data that we need Int64 accountNumber = 0; Int64.TryParse(settings.Get("PAYEX-ACCOUNT-NUMBER"), out accountNumber); string orderRef = orderReference; string companyRef = order.customer_id.ToString(); string companyName = order.invoice_name; string streetAddress = order.invoice_address_1; string coAddress = ""; string postalCode = order.invoice_post_code.Replace(" ", ""); string city = order.invoice_city; string country = order.country_code; string organizationNumber = order.customer_org_number; string phoneNumber = order.customer_mobile_phone; string email = order.customer_email; string productCode = ""; string creditCheckRef = ""; Int32 mediaDistribution = 11; string invoiceDate = ""; Int16 invoiceDueDays = 0; Int32 invoiceNumber = 0; string invoiceLayout = ""; string invoiceText = tt.Get("order") + " " + order.id.ToString() + " - " + domain.webshop_name; // Create the md5 hash string hash = GetMD5Hash(accountNumber.ToString() + orderRef + companyRef + companyName + streetAddress + coAddress + postalCode + city + country + organizationNumber + phoneNumber + email + productCode + creditCheckRef + mediaDistribution.ToString() + invoiceText + invoiceDate + invoiceDueDays.ToString() + invoiceNumber + invoiceLayout + settings.Get("PAYEX-ENCRYPTION-KEY")); // Create the invoice string xmlResponse = pxOrder.PurchaseInvoiceCorporate(accountNumber, orderRef, companyRef, companyName, streetAddress, coAddress, postalCode, city, country, organizationNumber, phoneNumber, email, productCode, creditCheckRef, mediaDistribution, invoiceText, invoiceDate, invoiceDueDays, invoiceNumber, invoiceLayout, hash); // Create the xml document XmlDocument doc = new XmlDocument(); try { // Load the xml document doc.LoadXml(xmlResponse); // Add data from the xml responseData.Add("error_code", ParseXmlNode(doc, "/payex/status/errorCode")); responseData.Add("description", ParseXmlNode(doc, "/payex/status/description")); responseData.Add("transaction_status", ParseXmlNode(doc, "/payex/transactionStatus")); responseData.Add("transaction_number", ParseXmlNode(doc, "/payex/transactionNumber")); } catch (Exception ex) { responseData.Add("exception", ex.Message); } // Return the response data return responseData; } // End of the CreateInvoiceCorporateProduction method