public string AddOrderAddress(long accountNumber, PayExAddress address, string hash)
 {
     return Client.AddOrderAddress2(accountNumber, address.OrderRef, address.BillingAddress.FirstName,
         address.BillingAddress.LastName, address.BillingAddress.Line1,
         address.BillingAddress.Line2, address.BillingAddress.Line3, address.BillingAddress.PostCode,
         address.BillingAddress.City, address.BillingAddress.State, address.BillingAddress.Country,
         address.BillingAddress.CountryCode, address.BillingAddress.Email, address.BillingAddress.Phone,
         address.BillingAddress.Mobile, address.ShippingAddress.FirstName, address.ShippingAddress.LastName,
         address.ShippingAddress.Line1, address.ShippingAddress.Line2, address.ShippingAddress.Line3,
         address.ShippingAddress.PostCode, address.ShippingAddress.City, address.ShippingAddress.State,
         address.ShippingAddress.Country, address.ShippingAddress.CountryCode, address.ShippingAddress.Email,
         address.ShippingAddress.Phone, address.ShippingAddress.Mobile, hash);
 }
예제 #2
0
        public string Create(long accountNumber, PayExAddress address, string encryptionKey)
        {
            var stringToHash = string.Concat(accountNumber, address.OrderRef, address.BillingAddress.FirstName,
                address.BillingAddress.LastName, address.BillingAddress.Line1,
                address.BillingAddress.Line2, address.BillingAddress.Line3, address.BillingAddress.PostCode,
                address.BillingAddress.City, address.BillingAddress.State, address.BillingAddress.Country,
                address.BillingAddress.CountryCode, address.BillingAddress.Email, address.BillingAddress.Phone,
                address.BillingAddress.Mobile, address.ShippingAddress.FirstName, address.ShippingAddress.LastName,
                address.ShippingAddress.Line1, address.ShippingAddress.Line2, address.ShippingAddress.Line3,
                address.ShippingAddress.PostCode, address.ShippingAddress.City, address.ShippingAddress.State,
                address.ShippingAddress.Country, address.ShippingAddress.CountryCode, address.ShippingAddress.Email,
                address.ShippingAddress.Phone, address.ShippingAddress.Mobile, encryptionKey);

            return CreateHash(stringToHash);
        }
        public static PayExAddress OrderAddress(Cart cart, PaymentInformation payment, InitializeResult result)
        {
            PayExAddress payexAddress = new PayExAddress(result.OrderRef.ToString());

            if (cart == null || cart.OrderForms == null || cart.OrderForms.Count == 0)
                return payexAddress;

            OrderForm orderForm = cart.OrderForms[0];

            OrderAddress billingAddress = cart.OrderAddresses.ToArray().FirstOrDefault(x => x.Name == orderForm.BillingAddressId);
            if (billingAddress != null)
                payexAddress.BillingAddress.Populate(billingAddress);

            if (orderForm.Shipments != null && orderForm.Shipments.Count > 0 && orderForm.Shipments[0] != null)
            {
                OrderAddress shippingAddress = cart.OrderAddresses.ToArray().FirstOrDefault(x => x.Name == orderForm.Shipments[0].ShippingAddressId);
                if (shippingAddress != null)
                    payexAddress.ShippingAddress.Populate(shippingAddress);
            }

            return payexAddress;
        }