Ejemplo n.º 1
0
 public static CheckoutStageStatus UpdateDisabled(this CheckoutStageStatus status, bool?disabled)
 {
     return(new CheckoutStageStatus(
                required: status.Required,
                available: status.Available,
                fulfilled: status.Fulfilled,
                disabled: disabled));
 }
Ejemplo n.º 2
0
 public CheckoutStageContext(
     CheckoutStageStatus account,
     CheckoutStageStatus paymentMethod,
     CheckoutStageStatus billingAddress,
     CheckoutStageStatus shippingAddress,
     CheckoutStageStatus shippingMethod,
     CheckoutStageStatus giftCardSetup,
     CheckoutStageStatus placeOrderButton)
 {
     Account          = account;
     PaymentMethod    = paymentMethod;
     BillingAddress   = billingAddress;
     ShippingAddress  = shippingAddress;
     ShippingMethod   = shippingMethod;
     GiftCardSetup    = giftCardSetup;
     PlaceOrderButton = placeOrderButton;
 }
Ejemplo n.º 3
0
        CheckoutStageDisplayState ConvertStageStatusToDisplayState(CheckoutStageStatus status, bool showCheckoutStageErrors)
        {
            if (status.Required == false)
            {
                return(CheckoutStageDisplayState.Disabled);
            }

            if (status.Fulfilled == false && showCheckoutStageErrors)
            {
                return(CheckoutStageDisplayState.Failing);
            }

            if (status.Available == true || status.Fulfilled == true)
            {
                return(CheckoutStageDisplayState.Passing);
            }

            if (showCheckoutStageErrors)
            {
                return(CheckoutStageDisplayState.Failing);
            }

            return(CheckoutStageDisplayState.Unknown);
        }
Ejemplo n.º 4
0
 public static CheckoutStageContext UpdateShippingAddress(this CheckoutStageContext context, CheckoutStageStatus shippingAddress)
 {
     return(new CheckoutStageContext(
                account: context.Account,
                paymentMethod: context.PaymentMethod,
                billingAddress: context.BillingAddress,
                shippingAddress: shippingAddress,
                shippingMethod: context.ShippingMethod,
                giftCardSetup: context.GiftCardSetup,
                placeOrderButton: context.PlaceOrderButton));
 }