Exemplo n.º 1
0
        public void UpdateConsumerInformation(PaymentMethod paymentMethod, ConsumerLegalAddressResult consumerLegalAddress)
        {
            Log.InfoFormat("Updating consumer information for payment with ID:{0} belonging to order with ID: {1}", paymentMethod.Payment.Id, paymentMethod.OrderGroupId);
            if (!(paymentMethod.Payment is ExtendedPayExPayment))
            {
                Log.ErrorFormat("Payment with ID:{0} belonging to order with ID: {1} is not an ExtendedPayExPayment, cannot update consumer information", paymentMethod.Payment.Id, paymentMethod.OrderGroupId);
                return;
            }

            ExtendedPayExPayment payment = paymentMethod.Payment as ExtendedPayExPayment;

            try
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    payment.FirstName     = consumerLegalAddress.FirstName;
                    payment.LastName      = consumerLegalAddress.LastName;
                    payment.StreetAddress = consumerLegalAddress.Address;
                    payment.PostNumber    = consumerLegalAddress.PostNumber;
                    payment.City          = consumerLegalAddress.City;
                    payment.CountryCode   = consumerLegalAddress.Country;
                    payment.AcceptChanges();
                    scope.Complete();
                    Log.InfoFormat("Successfully updated consumer information for payment with ID:{0} belonging to order with ID: {1}", paymentMethod.Payment.Id, paymentMethod.OrderGroupId);
                }
            }
            catch (Exception e)
            {
                Log.Error("Could not update consumer information. See next log item for more information", e);
                Log.ErrorFormat(
                    "Could not update consumer information for payment with ID:{0}. ConsumerLegalAddressResult:{1}.",
                    payment.Id, consumerLegalAddress);
            }
        }
Exemplo n.º 2
0
        private CustomerDetails CreateModel(PaymentMethod currentPayment)
        {
            if (!(currentPayment.Payment is ExtendedPayExPayment))
            {
                return(null);
            }

            ExtendedPayExPayment payment = currentPayment.Payment as ExtendedPayExPayment;

            return(new CustomerDetails
            {
                SocialSecurityNumber = payment.SocialSecurityNumber,
                CountryCode = payment.CountryCode,
            });
        }
        private CustomerDetails CreateModel(PaymentMethod currentPayment)
        {
            if (!(currentPayment.Payment is ExtendedPayExPayment))
            {
                return(null);
            }

            ExtendedPayExPayment payment = currentPayment.Payment as ExtendedPayExPayment;

            return(new CustomerDetails
            {
                SocialSecurityNumber = payment.SocialSecurityNumber,
                FirstName = payment.FirstName,
                LastName = payment.LastName,
                StreetAddress = payment.StreetAddress,
                City = payment.City,
                CoAddress = payment.CoAddress,
                CountryCode = payment.CountryCode,
                Email = payment.Email,
                IpAddress = currentPayment.Payment.ClientIpAddress,
                MobilePhone = payment.MobilePhone,
                PostNumber = payment.PostNumber,
            });
        }
 public void UpdateAddress(Mediachase.Commerce.Orders.Cart cart, ExtendedPayExPayment payment)
 {
 }