class Io::Flow::V0::Models::TaxDutyCalculatorValidationErrorCode

Attributes

value[R]

Public Class Methods

ALL() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 27182
def TaxDutyCalculatorValidationErrorCode.ALL
  @@all ||= [TaxDutyCalculatorValidationErrorCode.generic_error, TaxDutyCalculatorValidationErrorCode.destination_country_not_defined, TaxDutyCalculatorValidationErrorCode.destination_address_iso3166_unrecognized, TaxDutyCalculatorValidationErrorCode.line_item_shipfrom_shipto_country_invalid, TaxDutyCalculatorValidationErrorCode.line_item_ship_from_invalid, TaxDutyCalculatorValidationErrorCode.line_item_currency_iso4217_unrecognized, TaxDutyCalculatorValidationErrorCode.line_quantity_invalid, TaxDutyCalculatorValidationErrorCode.line_item_quantity_invalid, TaxDutyCalculatorValidationErrorCode.line_item_unit_price_precision_invalid, TaxDutyCalculatorValidationErrorCode.line_item_unit_price_negative, TaxDutyCalculatorValidationErrorCode.line_item_discount_amount_precision_invalid, TaxDutyCalculatorValidationErrorCode.line_item_discount_amount_positive, TaxDutyCalculatorValidationErrorCode.line_item_country_of_origin_iso3166_unrecognized, TaxDutyCalculatorValidationErrorCode.line_item_hs_code_invalid, TaxDutyCalculatorValidationErrorCode.line_item_duty_provider_invalid, TaxDutyCalculatorValidationErrorCode.shipping_unit_price_precision_invalid, TaxDutyCalculatorValidationErrorCode.shipping_unit_price_negative, TaxDutyCalculatorValidationErrorCode.shipping_discount_amount_precision_invalid, TaxDutyCalculatorValidationErrorCode.shipping_discount_amount_invalid, TaxDutyCalculatorValidationErrorCode.merchant_of_record_invalid, TaxDutyCalculatorValidationErrorCode.wrong_unit_specified]
end
apply(value) click to toggle source

Returns the instance of TaxDutyCalculatorValidationErrorCode for this value, creating a new instance for an unknown value

# File lib/flow_commerce/flow_api_v0_client.rb, line 27167
def TaxDutyCalculatorValidationErrorCode.apply(value)
  if value.instance_of?(TaxDutyCalculatorValidationErrorCode)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || TaxDutyCalculatorValidationErrorCode.new(value))
  end
end
destination_address_iso3166_unrecognized() click to toggle source

Destination address country is not recognized as a destination country in ISO 3166

# File lib/flow_commerce/flow_api_v0_client.rb, line 27198
def TaxDutyCalculatorValidationErrorCode.destination_address_iso3166_unrecognized
  @@_destination_address_iso3166_unrecognized ||= TaxDutyCalculatorValidationErrorCode.new('destination_address_iso3166_unrecognized')
end
destination_country_not_defined() click to toggle source

Destination address including at minimum a country must be included to properly generate a tax quote

# File lib/flow_commerce/flow_api_v0_client.rb, line 27192
def TaxDutyCalculatorValidationErrorCode.destination_country_not_defined
  @@_destination_country_not_defined ||= TaxDutyCalculatorValidationErrorCode.new('destination_country_not_defined')
end
from_string(value) click to toggle source

Returns the instance of TaxDutyCalculatorValidationErrorCode for this value, or nil if not found

# File lib/flow_commerce/flow_api_v0_client.rb, line 27177
def TaxDutyCalculatorValidationErrorCode.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  TaxDutyCalculatorValidationErrorCode.ALL.find { |v| v.value == value }
end
generic_error() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 27186
def TaxDutyCalculatorValidationErrorCode.generic_error
  @@_generic_error ||= TaxDutyCalculatorValidationErrorCode.new('generic_error')
end
line_item_country_of_origin_iso3166_unrecognized() click to toggle source

Line item country of origin is not recognized as a country of origin in ISO 3166

# File lib/flow_commerce/flow_api_v0_client.rb, line 27254
def TaxDutyCalculatorValidationErrorCode.line_item_country_of_origin_iso3166_unrecognized
  @@_line_item_country_of_origin_iso3166_unrecognized ||= TaxDutyCalculatorValidationErrorCode.new('line_item_country_of_origin_iso3166_unrecognized')
end
line_item_currency_iso4217_unrecognized() click to toggle source

Line item provided currency is not recognized as a calculation currency in ISO 4217

# File lib/flow_commerce/flow_api_v0_client.rb, line 27216
def TaxDutyCalculatorValidationErrorCode.line_item_currency_iso4217_unrecognized
  @@_line_item_currency_iso4217_unrecognized ||= TaxDutyCalculatorValidationErrorCode.new('line_item_currency_iso4217_unrecognized')
end
line_item_discount_amount_positive() click to toggle source

Line item Unit discount must be less than or equal to 0

# File lib/flow_commerce/flow_api_v0_client.rb, line 27248
def TaxDutyCalculatorValidationErrorCode.line_item_discount_amount_positive
  @@_line_item_discount_amount_positive ||= TaxDutyCalculatorValidationErrorCode.new('line_item_discount_amount_positive')
end
line_item_discount_amount_precision_invalid() click to toggle source

Line item Unit discount amount is more precise than the maximum allowed for this currency

# File lib/flow_commerce/flow_api_v0_client.rb, line 27243
def TaxDutyCalculatorValidationErrorCode.line_item_discount_amount_precision_invalid
  @@_line_item_discount_amount_precision_invalid ||= TaxDutyCalculatorValidationErrorCode.new('line_item_discount_amount_precision_invalid')
end
line_item_duty_provider_invalid() click to toggle source

Line item country of origin and shipto country resulted in inability to calculate duty.

# File lib/flow_commerce/flow_api_v0_client.rb, line 27266
def TaxDutyCalculatorValidationErrorCode.line_item_duty_provider_invalid
  @@_line_item_duty_provider_invalid ||= TaxDutyCalculatorValidationErrorCode.new('line_item_duty_provider_invalid')
end
line_item_hs_code_invalid() click to toggle source

Line item does not appear to contain a properly formed hs code. Please provide a 6 digit code or a 4-14 digit code specific to the destination country

# File lib/flow_commerce/flow_api_v0_client.rb, line 27260
def TaxDutyCalculatorValidationErrorCode.line_item_hs_code_invalid
  @@_line_item_hs_code_invalid ||= TaxDutyCalculatorValidationErrorCode.new('line_item_hs_code_invalid')
end
line_item_quantity_invalid() click to toggle source

Line item quantity must be greater than 0

# File lib/flow_commerce/flow_api_v0_client.rb, line 27226
def TaxDutyCalculatorValidationErrorCode.line_item_quantity_invalid
  @@_line_item_quantity_invalid ||= TaxDutyCalculatorValidationErrorCode.new('line_item_quantity_invalid')
end
line_item_ship_from_invalid() click to toggle source

Every line’s ship from address must include a country to properly generate a tax quote

# File lib/flow_commerce/flow_api_v0_client.rb, line 27210
def TaxDutyCalculatorValidationErrorCode.line_item_ship_from_invalid
  @@_line_item_ship_from_invalid ||= TaxDutyCalculatorValidationErrorCode.new('line_item_ship_from_invalid')
end
line_item_shipfrom_shipto_country_invalid() click to toggle source

This is a cross-border calculator. No line’s ship from country can be the same as the destination country

# File lib/flow_commerce/flow_api_v0_client.rb, line 27204
def TaxDutyCalculatorValidationErrorCode.line_item_shipfrom_shipto_country_invalid
  @@_line_item_shipfrom_shipto_country_invalid ||= TaxDutyCalculatorValidationErrorCode.new('line_item_shipfrom_shipto_country_invalid')
end
line_item_unit_price_negative() click to toggle source

Line Item Unit amount must be greater than or equal to 0

# File lib/flow_commerce/flow_api_v0_client.rb, line 27237
def TaxDutyCalculatorValidationErrorCode.line_item_unit_price_negative
  @@_line_item_unit_price_negative ||= TaxDutyCalculatorValidationErrorCode.new('line_item_unit_price_negative')
end
line_item_unit_price_precision_invalid() click to toggle source

Provided value for unit amount is more precise than the maximum allowed for this currency

# File lib/flow_commerce/flow_api_v0_client.rb, line 27232
def TaxDutyCalculatorValidationErrorCode.line_item_unit_price_precision_invalid
  @@_line_item_unit_price_precision_invalid ||= TaxDutyCalculatorValidationErrorCode.new('line_item_unit_price_precision_invalid')
end
line_quantity_invalid() click to toggle source

Order must contain at least one line of ordered goods

# File lib/flow_commerce/flow_api_v0_client.rb, line 27221
def TaxDutyCalculatorValidationErrorCode.line_quantity_invalid
  @@_line_quantity_invalid ||= TaxDutyCalculatorValidationErrorCode.new('line_quantity_invalid')
end
merchant_of_record_invalid() click to toggle source

Only ‘Flow’ is supported as Merchant of Record

# File lib/flow_commerce/flow_api_v0_client.rb, line 27292
def TaxDutyCalculatorValidationErrorCode.merchant_of_record_invalid
  @@_merchant_of_record_invalid ||= TaxDutyCalculatorValidationErrorCode.new('merchant_of_record_invalid')
end
new(value) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 27162
def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end
shipping_discount_amount_invalid() click to toggle source

Shipping discount must be less than or equal to 0

# File lib/flow_commerce/flow_api_v0_client.rb, line 27287
def TaxDutyCalculatorValidationErrorCode.shipping_discount_amount_invalid
  @@_shipping_discount_amount_invalid ||= TaxDutyCalculatorValidationErrorCode.new('shipping_discount_amount_invalid')
end
shipping_discount_amount_precision_invalid() click to toggle source

Shipping discount amount is more precise than the maximum allowed for this currency

# File lib/flow_commerce/flow_api_v0_client.rb, line 27282
def TaxDutyCalculatorValidationErrorCode.shipping_discount_amount_precision_invalid
  @@_shipping_discount_amount_precision_invalid ||= TaxDutyCalculatorValidationErrorCode.new('shipping_discount_amount_precision_invalid')
end
shipping_unit_price_negative() click to toggle source

Shipping amount must be greater than or equal to 0

# File lib/flow_commerce/flow_api_v0_client.rb, line 27276
def TaxDutyCalculatorValidationErrorCode.shipping_unit_price_negative
  @@_shipping_unit_price_negative ||= TaxDutyCalculatorValidationErrorCode.new('shipping_unit_price_negative')
end
shipping_unit_price_precision_invalid() click to toggle source

Shipping amount is more precise than the maximum allowed for this currency

# File lib/flow_commerce/flow_api_v0_client.rb, line 27271
def TaxDutyCalculatorValidationErrorCode.shipping_unit_price_precision_invalid
  @@_shipping_unit_price_precision_invalid ||= TaxDutyCalculatorValidationErrorCode.new('shipping_unit_price_precision_invalid')
end
wrong_unit_specified() click to toggle source

Only weight units may be specified for a unit weight.

# File lib/flow_commerce/flow_api_v0_client.rb, line 27297
def TaxDutyCalculatorValidationErrorCode.wrong_unit_specified
  @@_wrong_unit_specified ||= TaxDutyCalculatorValidationErrorCode.new('wrong_unit_specified')
end

Public Instance Methods

to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 27301
def to_hash
  value
end