Exemple #1
0
 public bool ShippingAddressDoesNotMatchBillingAddress(CheckoutEngine.StateMachineContext context)
 {
     return(context.Selections.SelectedShippingAddress != null &&
            context.Selections.SelectedBillingAddress != null &&
            context.Selections.SelectedBillingAddress.AddressID != 0 &&
            context.Selections.SelectedBillingAddress.AddressID != context.Selections.SelectedShippingAddress.AddressID);
 }
Exemple #2
0
 public bool ShippingAddressRequired(CheckoutEngine.StateMachineContext context)
 {
     return(!context.ShoppingCart.IsAllDownloadComponents() &&
            !context.ShoppingCart.IsAllSystemComponents() &&
            !context.ShoppingCart.NoShippingRequiredComponents() &&
            !context.ShoppingCart.IsAllEmailGiftCards());
 }
Exemple #3
0
 public bool CartContainsGiftCard(CheckoutEngine.StateMachineContext context)
 {
     return(context
            .ShoppingCart
            .CartItems
            .Where(cartItem => GiftCard.ProductIsEmailGiftCard(cartItem.ProductID))
            .Any());
 }
Exemple #4
0
 public bool CreditCardDetailsMissing(CheckoutEngine.StateMachineContext context)
 {
     if (AppLogic.ActivePaymentGatewayCleaned() == Gateway.ro_GWBRAINTREE)
     {
         return(context.Selections.Braintree == null);
     }
     else
     {
         return(context.Selections.CreditCard == null);
     }
 }
Exemple #5
0
 public bool GiftCardSetupComplete(CheckoutEngine.StateMachineContext context)
 {
     return(context
            .ShoppingCart
            .CartItems
            .Where(cartItem => GiftCard.ProductIsEmailGiftCard(cartItem.ProductID))
            .Select(cartItem => GiftCardManager.LoadByShoppingCartRecordId(cartItem.ShoppingCartRecordID))
            .All(giftCard => giftCard != null &&
                 !string.IsNullOrWhiteSpace(giftCard.EMailName) &&
                 !string.IsNullOrWhiteSpace(giftCard.EMailTo)));
 }
Exemple #6
0
        public bool BillingAddressRequired(CheckoutEngine.StateMachineContext context)
        {
            if (context.ShoppingCart.Total(true) == decimal.Zero &&
                context.ShoppingCart.IsAllDownloadComponents())
            {
                return(false);
            }

            return(context.Selections.SelectedPaymentMethod == null ||
                   context.Selections.SelectedPaymentMethod.RequiresBillingSelection);
        }
Exemple #7
0
        public bool ShippingMethodIsValid(CheckoutEngine.StateMachineContext context)
        {
            if (context.Selections.SelectedShippingMethodId == null)
            {
                return(false);
            }

            var shippingMethods = CachedShippingMethodCollectionProvider.Get(context.Customer, context.Selections.SelectedShippingAddress, context.ShoppingCart.CartItems, context.StoreId);

            return(shippingMethods
                   .Select(shippingMethod => shippingMethod.Id)
                   .Contains(context.Selections.SelectedShippingMethodId.Value));
        }
Exemple #8
0
        public bool ShippingMethodRequired(CheckoutEngine.StateMachineContext context)
        {
            if (context.ShoppingCart.IsAllFreeShippingComponents() &&
                !AppLogic.AppConfigBool("FreeShippingAllowsRateSelection"))
            {
                return(false);
            }

            return(context.ShoppingCart.CartAllowsShippingMethodSelection &&
                   !context.ShoppingCart.IsAllSystemComponents() &&
                   !context.ShoppingCart.IsAllDownloadComponents() &&
                   !context.ShoppingCart.NoShippingRequiredComponents() &&
                   !context.ShoppingCart.IsAllEmailGiftCards());
        }
Exemple #9
0
 public bool RecurringScheduleMismatchOnItems(CheckoutEngine.StateMachineContext context)
 {
     return(context.ShoppingCart.RecurringScheduleConflict);
 }
Exemple #10
0
 public bool CartItemsLessThanMinimumItemCount(CheckoutEngine.StateMachineContext context)
 {
     return(!context.ShoppingCart.MeetsMinimumOrderQuantity(context.Configuration.MinCartItemsBeforeCheckout));
 }
Exemple #11
0
 public bool CartItemsGreaterThanMaximumItemCount(CheckoutEngine.StateMachineContext context)
 {
     return(context.ShoppingCart.ExceedsMaximumOrderQuantity(context.Configuration.MaxCartItemsBeforeCheckout));
 }
Exemple #12
0
 public bool TermsAndConditionsRequired(CheckoutEngine.StateMachineContext context)
 {
     return(context.Configuration.RequireTermsAccepted);
 }
Exemple #13
0
 public bool SubtotalDoesNotMeetMinimumAmount(CheckoutEngine.StateMachineContext context)
 {
     return(!context.ShoppingCart.MeetsMinimumOrderAmount(context.Configuration.CartMinOrderAmount));
 }
Exemple #14
0
 public bool PaymentMethodPresent(CheckoutEngine.StateMachineContext context)
 {
     return(context.Selections.SelectedPaymentMethod != null &&
            !string.IsNullOrEmpty(context.Selections.SelectedPaymentMethod.Name));
 }
Exemple #15
0
 public bool BillingAddressPresent(CheckoutEngine.StateMachineContext context)
 {
     return(context.Selections.SelectedBillingAddress != null &&
            context.Selections.SelectedBillingAddress.AddressID != 0);
 }
Exemple #16
0
 public bool PaymentMethodIsPurchaseOrder(CheckoutEngine.StateMachineContext context)
 {
     return(context.Selections.SelectedPaymentMethod != null &&
            context.Selections.SelectedPaymentMethod.Name == AppLogic.ro_PMPurchaseOrder);
 }
Exemple #17
0
 public bool PaymentMethodIsCreditCard(CheckoutEngine.StateMachineContext context)
 {
     return(context.Selections.SelectedPaymentMethod != null &&
            context.Selections.SelectedPaymentMethod.Name == AppLogic.ro_PMCreditCard);
 }
Exemple #18
0
 public bool PaymentMethodIsMicroPay(CheckoutEngine.StateMachineContext context)
 {
     return(context.Selections.SelectedPaymentMethod != null &&
            context.Selections.SelectedPaymentMethod.Name == AppLogic.ro_PMMicropay);
 }
Exemple #19
0
 public static bool AmazonPaymentsDetailsMissing(CheckoutEngine.StateMachineContext context)
 {
     return(context.Selections.AmazonPayments == null);
 }
Exemple #20
0
 public static bool PaymentMethodIsAmazonPayments(CheckoutEngine.StateMachineContext context)
 {
     return(context.Selections.SelectedPaymentMethod != null &&
            context.Selections.SelectedPaymentMethod.Name == AppLogic.ro_PMAmazonPayments);
 }
Exemple #21
0
 public bool PaymentMethodIsPayPalExpress(CheckoutEngine.StateMachineContext context)
 {
     return(context.Selections.SelectedPaymentMethod != null &&
            context.Selections.SelectedPaymentMethod.Name == AppLogic.ro_PMPayPalExpress);
 }
Exemple #22
0
 public bool TermsAndConditionsNotAccepted(CheckoutEngine.StateMachineContext context)
 {
     return(!context.Selections.TermsAndConditionsAccepted);
 }
Exemple #23
0
 public bool PaymentMethodRequired(CheckoutEngine.StateMachineContext context)
 {
     return(!(context.ShoppingCart.Total(true) == 0 &&
              context.Configuration.SkipPaymentEntryOnZeroDollarCheckout) &&
            !context.ShoppingCart.GiftCardCoversTotal());
 }
Exemple #24
0
        public bool CustomerAccountRequired(CheckoutEngine.StateMachineContext context)
        {
            var checkoutAccountStatus = CheckoutAccountStatusProvider.GetCheckoutAccountStatus(context.Customer, context.Selections.Email);

            return(checkoutAccountStatus.State == CheckoutAccountState.Unvalidated);
        }
Exemple #25
0
 public bool MicroPayBalanceIsInsufficient(CheckoutEngine.StateMachineContext context)
 {
     return(context.ShoppingCart.Total(true) > context.Customer.MicroPayBalance);
 }
Exemple #26
0
 public bool Always(CheckoutEngine.StateMachineContext context)
 {
     return(true);
 }
Exemple #27
0
 public bool BillingAddressRequired(CheckoutEngine.StateMachineContext context)
 {
     return(context.Selections.SelectedPaymentMethod == null ||
            context.Selections.SelectedPaymentMethod.RequiresBillingSelection);
 }
Exemple #28
0
 public bool ShoppingCartIsEmpty(CheckoutEngine.StateMachineContext context)
 {
     return(context.ShoppingCart.IsEmpty());
 }
Exemple #29
0
 public bool ShippingAddressMustMatchBillingAddress(CheckoutEngine.StateMachineContext context)
 {
     return(!AppConfigProvider.GetAppConfigValue <bool>("AllowShipToDifferentThanBillTo"));
 }
Exemple #30
0
 public bool PurchaseOrderDetailsMissing(CheckoutEngine.StateMachineContext context)
 {
     return(context.Selections.PurchaseOrder == null);
 }