Example #1
0
 public PersistedCheckoutContext(CreditCardDetails creditCard,
                                 PayPalExpressDetails payPalExpress,
                                 PurchaseOrderDetails purchaseOrder,
                                 BraintreeDetails braintree,
                                 AmazonPaymentsDetails amazonPayments,
                                 bool termsAndConditionsAccepted,
                                 bool over13Checked,
                                 ShippingEstimateDetails shippingEstimateDetails,
                                 int?offsiteRequiresBillingAddressId,
                                 int?offsiteRequiresShippingAddressId,
                                 string email,
                                 int?selectedShippingMethodId)
 {
     CreditCard                       = creditCard;
     PayPalExpress                    = payPalExpress;
     PurchaseOrder                    = purchaseOrder;
     Braintree                        = braintree;
     AmazonPayments                   = amazonPayments;
     TermsAndConditionsAccepted       = termsAndConditionsAccepted;
     Over13Checked                    = over13Checked;
     ShippingEstimateDetails          = shippingEstimateDetails;
     OffsiteRequiresBillingAddressId  = offsiteRequiresBillingAddressId;
     OffsiteRequiresShippingAddressId = offsiteRequiresShippingAddressId;
     Email = email;
     SelectedShippingMethodId = selectedShippingMethodId;
 }
Example #2
0
        Address BuildEstimatorAddressFromContext(ShippingEstimateDetails shippingEstimateDetails, Customer customer)
        {
            var address = new Address(customer.CustomerID, AddressTypes.Shipping);

            if (shippingEstimateDetails == null)
            {
                return(address);
            }

            if (!string.IsNullOrEmpty(shippingEstimateDetails.Country))
            {
                address.Country = shippingEstimateDetails.Country;
            }

            if (!string.IsNullOrEmpty(shippingEstimateDetails.City))
            {
                address.City = shippingEstimateDetails.City;
            }

            if (!string.IsNullOrEmpty(shippingEstimateDetails.State))
            {
                address.State = shippingEstimateDetails.State;
            }

            if (!string.IsNullOrEmpty(shippingEstimateDetails.PostalCode))
            {
                address.Zip = shippingEstimateDetails.PostalCode;
            }

            return(address);
        }
 public PersistedCheckoutContext(
     CreditCardDetails creditCard,
     ECheckDetails eCheck,
     PayPalExpressDetails payPalExpress,
     PurchaseOrderDetails purchaseOrder,
     AcceptJsDetailsCreditCard acceptJsDetailsCreditCard,
     AcceptJsDetailsECheck acceptJsDetailsECheck,
     BraintreeDetails braintree,
     SagePayPiDetails sagePayPi,
     AmazonPaymentsDetails amazonPayments,
     bool termsAndConditionsAccepted,
     bool over13Checked,
     ShippingEstimateDetails shippingEstimate,
     int?offsiteRequiredBillingAddressId,
     int?offsiteRequiredShippingAddressId,
     string email,
     int?selectedShippingMethodId)
 {
     CreditCard                       = creditCard;
     ECheck                           = eCheck;
     PayPalExpress                    = payPalExpress;
     PurchaseOrder                    = purchaseOrder;
     AcceptJsDetailsCreditCard        = acceptJsDetailsCreditCard;
     AcceptJsDetailsECheck            = acceptJsDetailsECheck;
     Braintree                        = braintree;
     SagePayPi                        = sagePayPi;
     AmazonPayments                   = amazonPayments;
     TermsAndConditionsAccepted       = termsAndConditionsAccepted;
     Over13Checked                    = over13Checked;
     ShippingEstimate                 = shippingEstimate;
     OffsiteRequiredBillingAddressId  = offsiteRequiredBillingAddressId;
     OffsiteRequiredShippingAddressId = offsiteRequiredShippingAddressId;
     Email = email;
     SelectedShippingMethodId = selectedShippingMethodId;
 }