示例#1
0
        public TransactionRegistration BuildRegistration(CartModel cartModel)
        {
            var shoppingBasket          = _sagePayItemCreator.GetShoppingBasket(cartModel);
            var billingAddress          = _sagePayItemCreator.GetAddress(cartModel.BillingAddress);
            var deliveryAddress         = _sagePayItemCreator.GetAddress(cartModel.ShippingAddress ?? cartModel.BillingAddress);
            var transactionRegistration = new TransactionRegistration
            {
                AllowGiftAid       = _sagePaySettings.AllowGiftAidString,
                Amount             = shoppingBasket.Total,
                Apply3DSecure      = _sagePaySettings.Apply3DSecure,
                ApplyAVSCV2        = _sagePaySettings.ApplyAVSCV2,
                Basket             = shoppingBasket.ToString(),
                BillingAddress1    = billingAddress.Address1,
                BillingAddress2    = billingAddress.Address2,
                BillingCity        = billingAddress.City,
                BillingCountry     = billingAddress.Country,
                BillingFirstNames  = billingAddress.Firstnames,
                BillingPhone       = billingAddress.Phone,
                BillingPostcode    = billingAddress.PostCode,
                BillingState       = billingAddress.State,
                BillingSurname     = billingAddress.Surname,
                Currency           = _ecommerceSettings.CurrencyCode(),
                CustomerEMail      = cartModel.OrderEmail,
                DeliveryAddress1   = deliveryAddress.Address1,
                DeliveryAddress2   = deliveryAddress.Address2,
                DeliveryCity       = deliveryAddress.City,
                DeliveryCountry    = deliveryAddress.Country,
                DeliveryFirstNames = deliveryAddress.Firstnames,
                DeliveryPhone      = deliveryAddress.Phone,
                DeliveryPostcode   = deliveryAddress.PostCode,
                DeliveryState      = deliveryAddress.State,
                DeliverySurname    = deliveryAddress.Surname,
                Description        =
                    string.Format("Order from {0}", _site.Name),
                NotificationUrl = _sagePayUrlResolver.BuildNotificationUrl(),
                Profile         = _sagePaySettings.PaymentFormProfileString,
                TxType          = "PAYMENT",
                VPSProtocol     = _sagePaySettings.Protocol,
                Vendor          = _sagePaySettings.VendorName,
                VendorTxCode    = cartModel.CartGuid.ToString()
            };

            return(transactionRegistration);
        }
 public TransactionRegistration BuildRegistration(CartModel cartModel)
 {
     var shoppingBasket = _sagePayItemCreator.GetShoppingBasket(cartModel);
     var billingAddress = _sagePayItemCreator.GetAddress(cartModel.BillingAddress);
     var deliveryAddress = _sagePayItemCreator.GetAddress(cartModel.ShippingAddress ?? cartModel.BillingAddress);
     var transactionRegistration = new TransactionRegistration
                                       {
                                           AllowGiftAid = _sagePaySettings.AllowGiftAidString,
                                           Amount = shoppingBasket.Total,
                                           Apply3DSecure = _sagePaySettings.Apply3DSecure,
                                           ApplyAVSCV2 = _sagePaySettings.ApplyAVSCV2,
                                           Basket = shoppingBasket.ToString(),
                                           BillingAddress1 = billingAddress.Address1,
                                           BillingAddress2 = billingAddress.Address2,
                                           BillingCity = billingAddress.City,
                                           BillingCountry = billingAddress.Country,
                                           BillingFirstNames = billingAddress.Firstnames,
                                           BillingPhone = billingAddress.Phone,
                                           BillingPostcode = billingAddress.PostCode,
                                           BillingState = billingAddress.State,
                                           BillingSurname = billingAddress.Surname,
                                           Currency = _ecommerceSettings.CurrencyCode(),
                                           CustomerEMail = cartModel.OrderEmail,
                                           DeliveryAddress1 = deliveryAddress.Address1,
                                           DeliveryAddress2 = deliveryAddress.Address2,
                                           DeliveryCity = deliveryAddress.City,
                                           DeliveryCountry = deliveryAddress.Country,
                                           DeliveryFirstNames = deliveryAddress.Firstnames,
                                           DeliveryPhone = deliveryAddress.Phone,
                                           DeliveryPostcode = deliveryAddress.PostCode,
                                           DeliveryState = deliveryAddress.State,
                                           DeliverySurname = deliveryAddress.Surname,
                                           Description =
                                               string.Format("Order from {0}", _site.Name),
                                           NotificationUrl = _sagePayUrlResolver.BuildNotificationUrl(),
                                           Profile = _sagePaySettings.PaymentFormProfileString,
                                           TxType = "PAYMENT",
                                           VPSProtocol = _sagePaySettings.Protocol,
                                           Vendor = _sagePaySettings.VendorName,
                                           VendorTxCode = cartModel.CartGuid.ToString()
                                       };
     return transactionRegistration;
 }