Example #1
0
 private static string ValidateCountry(DeliverOrderBuilder order)
 {
     return(order.GetCountryCode() == CountryCode.NONE ||
            !Enum.IsDefined(typeof(CountryCode), order.GetCountryCode())
                ? "MISSING VALUE - CountryCode is required, use SetCountryCode(...)."
                : "");
 }
 private static string ValidateCountry(DeliverOrderBuilder order)
 {
     return order.GetCountryCode() == CountryCode.NONE ||
            !Enum.IsDefined(typeof (CountryCode), order.GetCountryCode())
                ? "MISSING VALUE - CountryCode is required, use SetCountryCode(...)."
                : "";
 }
Example #3
0
        private ClientAuthInfo GetStoreAuthorization()
        {
            var type = (_order.GetOrderType() == CONST.OrderType.INVOICE)
                           ? PaymentType.INVOICE
                           : PaymentType.PAYMENTPLAN;

            var auth = new ClientAuthInfo
            {
                Username     = _order.GetConfig().GetUsername(type, _order.GetCountryCode()),
                Password     = _order.GetConfig().GetPassword(type, _order.GetCountryCode()),
                ClientNumber = _order.GetConfig().GetClientNumber(type, _order.GetCountryCode())
            };

            return(auth);
        }
        private static string ValidateInvoiceDetails(DeliverOrderBuilder order)
        {
            string errors = "";

            if (order.GetOrderId() > 0 && order.GetOrderType() == OrderType.INVOICE &&
                (order.GetInvoiceDistributionType() == DistributionType.NONE ||
                 !Enum.IsDefined(typeof(DistributionType), order.GetInvoiceDistributionType())))
            {
                errors += "MISSING VALUE - SetInvoiceDistributionType is required for DeliverInvoiceOrder.\n";
            }

            if (order.GetInvoiceDistributionType() == DistributionType.EINVOICEB2B && order.GetCountryCode() != CountryCode.NO)
            {
                errors += "NOT VALID - Invalid country code, must be CountryCode.NO if InvoiceDistributionType is DistributionType.EInvoiceB2B.\n";
            }

            if (order.GetInvoiceDistributionType() == DistributionType.EINVOICEB2B && order.GetOrderType() == OrderType.PAYMENTPLAN)
            {
                errors += "NOT VALID - Invalid payment method, DistributionType.EINVOICEB2B can only be used when payment method is invoice.\n";
            }

            return(errors);
        }