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);
    }
Example #2
0
    private void CreateDummyRow(IList <CustomerRewardPoint> list)
    {
        CustomerRewardPoint customerRewardPoint = new CustomerRewardPoint();

        customerRewardPoint.RewardPointID = "-1";

        list.Add(customerRewardPoint);
    }
    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);
        }
    }
Example #4
0
    private bool IsPointReferenceLabelVisible(string pointID)
    {
        CustomerRewardPoint rewardPoint = DataAccessContextDeluxe.CustomerRewardPointRepository.GetOne(pointID);

        if (ConvertUtilities.ToInt32(rewardPoint.OrderID) > 0)
        {
            return(false);
        }
        else
        {
            return(true);
        }
    }
Example #5
0
    protected void uxAddPointButton_Click(object sender, EventArgs e)
    {
        CustomerRewardPoint customerRewardPoint = new CustomerRewardPoint();

        customerRewardPoint.Point         = ConvertUtilities.ToInt32(uxPointText.Text);
        customerRewardPoint.Reference     = uxReferenceText.Text;
        customerRewardPoint.ReferenceDate = DateTime.Now;
        customerRewardPoint.StoreID       = uxStoreList.SelectedValue;
        customerRewardPoint.CustomerID    = CurrentID;
        DataAccessContextDeluxe.CustomerRewardPointRepository.Save(customerRewardPoint);

        RefreshGrid();

        ClearPointInputFiels();

        uxMessage.DisplayMessage(Resources.CustomerRewardPointMessages.AddSuccess);
    }
Example #6
0
    private void UpdateOrder()
    {
        Order order = DataAccessContext.OrderRepository.GetOne(CurrentOrderID);

        order.OrderDate = GetOrderDate(GetCalendarDate("uxOrderDateCalendarPopup"));
        order.UserName  = GetText("uxUserNameText");
        order.Billing   = new Address(GetText("uxFirstNameText"), GetText("uxLastNameText"),
                                      GetText("uxCompanyText"), GetText("uxAddress1Text"), GetText("uxAddress2Text"),
                                      GetText("uxCityText"), GetStateList("uxStateList"), GetText("uxZipText"),
                                      GetCountryList("uxCountryList"), GetText("uxPhoneText"), GetText("uxFaxText"));
        order.Email    = GetText("uxEmailText");
        order.Shipping = new ShippingAddress(
            new Address(GetText("uxShippingFirstNameText"), GetText("uxShippingLastNameText"),
                        GetText("uxShippingCompanyText"), GetText("uxShippingAddress1Text"),
                        GetText("uxShippingAddress2Text"), GetText("uxShippingCityText"),
                        GetStateList("StateListShipping"), GetText("uxShippingZipText"),
                        GetCountryList("CountryListShipping"), GetText("uxShippingPhoneText"),
                        GetText("uxShippingFaxText")),
            false);
        order.PaymentMethod       = GetText("uxPaymentMethodText");
        order.ShippingMethod      = GetText("uxShippingMethodText");
        order.PaymentComplete     = GetCheck("uxPaymentCompleteCheck");
        order.Processed           = GetCheck("uxProcessedCheck");
        order.Status              = GetDrop("uxStatusDrop");
        order.Cancelled           = GetCheck("uxCancelledCheck");
        order.IPAddress           = GetText("uxIPAddressText");
        order.Subtotal            = DataAccessContext.OrderItemRepository.GetSubtotal(CurrentOrderID);
        order.Tax                 = ConvertUtilities.ToDecimal(GetText("uxTaxText"));
        order.ShippingCost        = ConvertUtilities.ToDecimal(GetText("uxShippingCostText"));
        order.CouponID            = GetText("uxCouponIDText");
        order.CouponDiscount      = ConvertUtilities.ToDecimal(GetText("uxCouponDiscountText"));
        order.CustomerComments    = GetText("uxCommentText");
        order.BaseCurrencyCode    = GetText("uxBaseCodeText");
        order.UserCurrencyCode    = GetText("uxUserCurrencyCodeText");
        order.UserConversionRate  = ConvertUtilities.ToDouble(GetText("uxConversionRateText"));
        order.InvoiceNotes        = GetText("uxInvoiceNotesText");
        order.GiftCertificateCode = GetText("uxGiftCertificateCodeText");
        order.GiftCertificate     = ConvertUtilities.ToDecimal((GetText("uxGiftCertificateText")));
        order.TrackingNumber      = GetText("uxTrackingNumerText");
        order.TrackingMethod      = GetDrop("uxTrackingMethodDrop");
        order.HandlingFee         = ConvertUtilities.ToDecimal(GetText("uxHandlingFeeText"));
        order.ContainsRecurring   = IsOrderContainRecurring();
        order.AvsAddrStatus       = ((DropDownList)uxFormView.Row.FindControl("uxAvsAddrDrop")).SelectedValue;
        order.AvsZipStatus        = ((DropDownList)uxFormView.Row.FindControl("uxAvsZipDrop")).SelectedValue;
        order.CvvStatus           = ((DropDownList)uxFormView.Row.FindControl("uxCvvDrop")).SelectedValue;
        order.PONumber            = GetText("uxPONumberText");

        if (IsSaleTaxExemptVisible(true) && !String.IsNullOrEmpty(GetText("uxTaxExepmtIDText")))
        {
            order.IsTaxExempt      = true;
            order.TaxExemptID      = GetText("uxTaxExepmtIDText");
            order.TaxExemptCountry = GetCountryList("uxTaxExemptCountryList");
            order.TaxExemptState   = GetStateList("uxTaxExemptStateList");
        }
        else
        {
            order.IsTaxExempt      = false;
            order.TaxExemptID      = String.Empty;
            order.TaxExemptCountry = String.Empty;
            order.TaxExemptState   = String.Empty;
        }

        DataAccessContext.OrderRepository.Save(order);
        if (order.PaymentComplete)
        {
            CustomerRewardPoint.UpdateRewardPoint(order);

            if (!order.IsSubscriptionApplied)
            {
                OrderNotifyService orderNotifyService = new OrderNotifyService(order.OrderID);
                orderNotifyService.UpdateCustomerSubscription(order);
                order.IsSubscriptionApplied = true;
                DataAccessContext.OrderRepository.Save(order);
            }
        }
    }