public string PurchaseInvoiceSale(long accountNumber, string orderRef, CustomerDetails customerDetails, string hash)
 {
     return Client.PurchaseInvoiceSale(accountNumber, orderRef, customerDetails.SocialSecurityNumber, customerDetails.FirstName,
         customerDetails.LastName, customerDetails.StreetAddress,
         customerDetails.CoAddress, customerDetails.PostNumber, customerDetails.City, customerDetails.CountryCode, customerDetails.Email,
         customerDetails.MobilePhone, customerDetails.IpAddress, hash);
 }
 public string Create(long accountNumber, string orderRef, CustomerDetails customerDetails, string encryptionKey)
 {
     var stringToHash = string.Concat(accountNumber, orderRef, customerDetails.SocialSecurityNumber, customerDetails.FirstName, customerDetails.LastName, customerDetails.StreetAddress, customerDetails.CoAddress,
         customerDetails.PostNumber, customerDetails.City, customerDetails.CountryCode, customerDetails.Email, customerDetails.MobilePhone, customerDetails.IpAddress, encryptionKey);
     return CreateHash(stringToHash);
 }
        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;
        }
 public string PurchaseFinancingInvoice(long accountNumber, string orderRef, string paymentMethod, CustomerDetails customerDetails, string hash)
 {
     return Client.PurchaseFinancingInvoice(accountNumber, orderRef, customerDetails.SocialSecurityNumber, customerDetails.FullName, 
         customerDetails.StreetAddress, customerDetails.CoAddress, customerDetails.PostNumber, customerDetails.City, customerDetails.CountryCode, paymentMethod, customerDetails.Email,
         customerDetails.MobilePhone, customerDetails.IpAddress, hash);
 }
Example #5
0
        public PurchasePartPaymentSaleResult PurchasePartPaymentSale(string orderRef, CustomerDetails customerDetails)
        {
            Log.Info($"Calling PurchasePartPaymentSale for order with orderRef:{orderRef}. CustomerDetails:{customerDetails}");

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

            var result = _resultParser.Deserialize<PurchasePartPaymentSaleResult>(xmlResult);
            if (result.Status.Success)
                Log.Info($"Successfully called PurchasePartPaymentSale for order with orderRef:{orderRef}. Result:{xmlResult}");
            else
                 Log.Error($"Error when calling PurchasePartPaymentSale for order with orderRef:{orderRef}. Result:{xmlResult}");
            return result;
        }