private OrderNotifyService CreateOrder(CheckoutDetails checkout) { OrderCreateService orderCreateService = new OrderCreateService( StoreContext.ShoppingCart, checkout, StoreContext.Culture, CurrenntCurrency, AffiliateHelper.GetAffiliateCode(), WebUtilities.GetVisitorIP()); OrderNotifyService orderBusiness; OrderAmount amount = orderCreateService.GetOrderAmount(StoreContext.Customer) .Add(CartItemPromotion.CalculatePromotionShippingAndTax( checkout, StoreContext.ShoppingCart.SeparateCartItemGroups(), StoreContext.Customer)); Order order = orderCreateService.PlaceOrder(amount, StoreContext.Customer, DataAccessContext.StoreRetriever, StoreContext.Culture); GiftRegistry.UpdateGiftRegistryQuantity(StoreContext.ShoppingCart, checkout); CustomerRewardPoint.UpdateRedeemPoint(checkout, StoreContext.Customer, order); orderBusiness = new OrderNotifyService(order.OrderID); return(orderBusiness); }
private void ProcessOnPayPalProUSPayment(CheckoutDetails checkout) { PayPalProUSPaymentMethod paypalPayment = (PayPalProUSPaymentMethod)checkout.PaymentMethod; bool result = false; PaymentAppResult paymentResult; RecurringPaymentResult recurringPaymentResult; ProcessPaymentService process = ProcessPaymentService.CreateNew(new HttpService(), StoreContext.ShoppingCart); result = process.ProcessPayPalProUSPayment( StoreContext.GetOrderAmount().Total, DataAccessContext.CurrencyRepository.GetOne(DataAccessContext.Configurations.GetValue("PaymentCurrency")), StoreContext.Culture, checkout, StoreContext.ShoppingCart, StoreContext.Customer, UrlPath.StorefrontUrl, WebUtilities.GetVisitorIP(), out paymentResult, out recurringPaymentResult); if (result) { OrderCreateService orderCreateService = new OrderCreateService( StoreContext.ShoppingCart, StoreContext.CheckoutDetails, StoreContext.Culture, CurrenntCurrency, AffiliateHelper.GetAffiliateCode(), WebUtilities.GetVisitorIP(), recurringPaymentResult ); Order order; OrderAmount amount = orderCreateService.GetOrderAmount(StoreContext.Customer) .Add(CartItemPromotion.CalculatePromotionShippingAndTax( StoreContext.CheckoutDetails, StoreContext.ShoppingCart.SeparateCartItemGroups(), StoreContext.Customer)); order = orderCreateService.PlaceOrder(amount, StoreContext.Customer, DataAccessContext.StoreRetriever, StoreContext.Culture); GiftRegistry.UpdateGiftRegistryQuantity(StoreContext.ShoppingCart, StoreContext.CheckoutDetails); CustomerRewardPoint.UpdateRedeemPoint(StoreContext.CheckoutDetails, StoreContext.Customer, order); OrderNotifyService orderBusiness = new OrderNotifyService(order.OrderID); ProcessCreditCardPaymentSuccess( orderBusiness, paymentResult.GatewayOrderID, paymentResult.PaymentLog, paymentResult.CvvStatus, paymentResult.AvsAddrStatus, paymentResult.AvsZipStatus); } else { ProcessCreditCardPaymentFailure(paymentResult.ErrorMessage); } }